issue169:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue169:latex [2021/06/01 07:39] – créée d52fr | issue169:latex [2021/06/06 17:53] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | You may ask, “Why another Latex tutorial when there are so many Youtube videos? | + | **You may ask, “Why another Latex tutorial when there are so many Youtube videos? |
And my answer would be, after watching countless outdated videos that were badly planned and badly executed and gave me no answers, THIS tutorial was born. I am no expert, this is what I wish the tutorials actually taught me. | And my answer would be, after watching countless outdated videos that were badly planned and badly executed and gave me no answers, THIS tutorial was born. I am no expert, this is what I wish the tutorials actually taught me. | ||
- | When it comes to typesetting, | + | When it comes to typesetting, |
- | Last issue, we explored more basic concepts, one of them was tagging with labels. We can dive into the nuances of fonts and columns if there is interest, but for now, we soldier on. If you recall, we spoke about tagging your images with fig:2 or whatever, but instead of a figure, we tagged a section. The reason was that I wanted to further explore the issue of images and common mistakes in a totally separate tutorial. | + | Vous vous demandez peut-être |
- | Place your cursor on a new line and this time go to the “wizards” menu item and choose: insert graphic. Follow the prompts to get your ‘code’ filled in for you. Compile (F6)... What went wrong? Should a wizard not just work? You are welcome to google/ | + | Et ma réponse serait la suivante |
- | Explanation: | + | En matière de composition, |
+ | |||
+ | |||
+ | **Last issue, we explored more basic concepts, one of them was tagging with labels. We can dive into the nuances of fonts and columns if there is interest, but for now, we soldier on. If you recall, we spoke about tagging your images with fig:2 or whatever, but instead of a figure, we tagged a section. The reason was that I wanted to further explore the issue of images and common mistakes in a totally separate tutorial. | ||
+ | |||
+ | Place your cursor on a new line and this time go to the “wizards” menu item and choose: insert graphic. Follow the prompts to get your ‘code’ filled in for you. Compile (F6)... What went wrong? Should a wizard not just work? You are welcome to google/ | ||
+ | |||
+ | Dans le dernier numéro, nous avons exploré des concepts de base, notamment l' | ||
+ | |||
+ | Placez votre curseur sur une nouvelle ligne et, cette fois, allez dans l' | ||
+ | Je vais également couvrir - vous laisser faire/faire - les erreurs les plus courantes que les débutants font. | ||
+ | |||
+ | |||
+ | **Explanation: | ||
Latex is very “geeky”. It is like a programming language. You cannot use graphics (or other add-ons, we will get to those) without telling Latex that you will be using graphics. It has to be in the pre-processor space too, not anywhere else – that is where all the backslash stuff, written in red, is, before your “/ | Latex is very “geeky”. It is like a programming language. You cannot use graphics (or other add-ons, we will get to those) without telling Latex that you will be using graphics. It has to be in the pre-processor space too, not anywhere else – that is where all the backslash stuff, written in red, is, before your “/ | ||
- | The wizard will automatically use the picture’s name as a label, so you can save yourself a lot of time by changing the names of your pictures beforehand. However, I have no picture of snoopy displayed (I used a picture of snoopy). Instead I have a black block. This is the “demo”. | + | The wizard will automatically use the picture’s name as a label, so you can save yourself a lot of time by changing the names of your pictures beforehand. However, I have no picture of snoopy displayed (I used a picture of snoopy). Instead I have a black block. This is the “demo”.** |
+ | |||
+ | Explication : | ||
+ | |||
+ | Le LaTeX est très « geek ». C'est comme un langage de programmation. Vous ne pouvez pas utiliser d' | ||
+ | |||
+ | L' | ||
+ | |||
+ | |||
+ | **Go back, remove the “[demo]” from that line, and use the wizard again. When you compile your document, you will be greeted by a new error. TL;DR – you need to specify a path to a directory that has your images. The full path in the \includegraphics{} statement does not work. *(Even when they say so.) This also has to be added in the pre-processor space at the top. Here again, I was met with frustration, | ||
+ | |||
+ | TIP: When using images in your Latex documents, I suggest you make a separate folder for them. ** | ||
+ | |||
+ | Revenez en arrière, supprimez le « [demo] » de cette ligne et utilisez à nouveau l' | ||
- | Go back, remove the “[demo]” from that line, and use the wizard again. When you compile your document, you will be greeted by a new error. TL;DR – you need to specify a path to a directory that has your images. The full path in the \includegraphics{} statement does not work. *(Even when they say so.) This also has to be added in the pre-processor space at the top. Here again, I was met with frustration, | + | ASTUCE : Lorsque vous utilisez des images |
- | TIP: When using images in your Latex documents, I suggest you make a separate folder for them. | ||
- | Check the type of image you are adding as currently it can be only a .png, a .jpg, or a .pdf file. | + | **Check the type of image you are adding as currently it can be only a .png, a .jpg, or a .pdf file. |
Deep breath, we will get there. Sometimes one needs to make mistakes to understand your subject better. Now you can understand my frustration at other tutorials that just do not work. Open your file browser and navigate to the picture you would like to insert. Click and drag it into TeXstudio. You will now see this: | Deep breath, we will get there. Sometimes one needs to make mistakes to understand your subject better. Now you can understand my frustration at other tutorials that just do not work. Open your file browser and navigate to the picture you would like to insert. Click and drag it into TeXstudio. You will now see this: | ||
Ligne 30: | Ligne 55: | ||
\end{figure} | \end{figure} | ||
- | This is why I recommend making a “Figures” folder in your current working folder and dumping your pictures there. This used to trip me up when I was trying to get to grips with LaTeX. Now that you have made the mistake with me, hopefully this will stick. | + | This is why I recommend making a “Figures” folder in your current working folder and dumping your pictures there. This used to trip me up when I was trying to get to grips with LaTeX. Now that you have made the mistake with me, hopefully this will stick.** |
- | Now, when you click on run, you should see “Process exited normally”, | + | Vérifiez le type d' |
+ | |||
+ | Respirez profondément, | ||
+ | |||
+ | |||
+ | \begin{figure} | ||
+ | \includegraphics{Figures/ | ||
+ | \caption{} | ||
+ | \label{figure: | ||
+ | \end{figure} | ||
+ | |||
+ | C'est pourquoi je recommande de créer un dossier « Figures » dans votre dossier de travail actuel et d'y déposer vos images. C'est ce que je faisais souvent lorsque j' | ||
+ | |||
+ | |||
+ | **Now, when you click on run, you should see “Process exited normally”, | ||
Depending on the size of your image, if you do not supply any options, the image will be all over the place, even off the page. Now again, as we learned with the \documentclass example, the options go before the curly braces in square brackets. | Depending on the size of your image, if you do not supply any options, the image will be all over the place, even off the page. Now again, as we learned with the \documentclass example, the options go before the curly braces in square brackets. | ||
- | It is always a good idea to use a larger image than needed as it will show in the end product’s quality. We can restrain our image thus: Inside your square brackets, type “w” and the word “width=” should appear with two of the most common options. Choose “linewidth” and hit F5. | + | It is always a good idea to use a larger image than needed as it will show in the end product’s quality. We can restrain our image thus: Inside your square brackets, type “w” and the word “width=” should appear with two of the most common options. Choose “linewidth” and hit F5. ** |
- | What happened to your image? We have no lines in our document yet, so our line width is 0. This is another common mistake you need to watch out for. Hover your mouse cursor over the word “linewidth” and read the tool tip carefully. | + | Maintenant, lorsque vous cliquez sur exécuter, vous devriez voir « Process exited normally » (Traitement terminé normalement), |
+ | |||
+ | En fonction de la taille de votre image, si vous ne fournissez aucune option, l' | ||
+ | |||
+ | C'est toujours une bonne idée d' | ||
+ | |||
+ | |||
+ | **What happened to your image? We have no lines in our document yet, so our line width is 0. This is another common mistake you need to watch out for. Hover your mouse cursor over the word “linewidth” and read the tool tip carefully. | ||
So how would we wrangle our image to a more manageable size? We simply specify the height and width in centimetres. Add the following to the square brackets and press F5 again: | So how would we wrangle our image to a more manageable size? We simply specify the height and width in centimetres. Add the following to the square brackets and press F5 again: | ||
Ligne 44: | Ligne 90: | ||
height= 3cm, | height= 3cm, | ||
- | Looking better already! Another popular option is angle. This can be a positive or negative integer. Since you are reading FCM, I have no doubt you know how angles work, so I will leave that to you to play with. | + | Looking better already! Another popular option is angle. This can be a positive or negative integer. Since you are reading FCM, I have no doubt you know how angles work, so I will leave that to you to play with. ** |
- | My image is currently at the top, what if I want it at the bottom? Right next to \begin{figure} simply add a [b] thus: | + | Qu' |
+ | Comment faire pour ramener notre image à une taille plus gérable ? Il suffit de spécifier la hauteur et la largeur en centimètres. Ajoutez ce qui suit entre les crochets et appuyez de nouveau sur F5 : | ||
+ | height=3cm, | ||
+ | C'est déjà mieux ! Une autre option appréciée est l' | ||
+ | |||
+ | |||
+ | **My image is currently at the top, what if I want it at the bottom? Right next to \begin{figure} simply add a [b] thus: | ||
\begin{figure}[b] | \begin{figure}[b] | ||
Ligne 59: | Ligne 111: | ||
This will put your image at the bottom of the page (NOT at the end of your text). If you want it at the end of the text, you need to use an [h]. If you want the image on its own page, you need to specify the [p] option. | This will put your image at the bottom of the page (NOT at the end of your text). If you want it at the end of the text, you need to use an [h]. If you want the image on its own page, you need to specify the [p] option. | ||
- | You may have noticed that I added a caption and a label. By default, if you drag the image in, it will use the name of the file in here, be sure to change it to something useful. | + | You may have noticed that I added a caption and a label. By default, if you drag the image in, it will use the name of the file in here, be sure to change it to something useful.** |
- | Add a section and copy the following code to reference your image (as you type /ref{ TeXstudio should fill in the image reference for you). | + | Mon image est actuellement en haut, que faire si je la veux en bas ? Juste à côté de \begin{figure} ajoutez simplement un [b] ainsi : |
+ | |||
+ | \begin{figure}[b] | ||
+ | \includegraphics[height= 3cm, | ||
+ | \caption{C' | ||
+ | \label{fig: | ||
+ | \end{figure} | ||
+ | |||
+ | Cela placera votre image en bas de la page (PAS à la fin de votre texte). Si vous voulez qu' | ||
+ | |||
+ | Vous avez peut-être remarqué que j'ai ajouté une légende et une étiquette. Par défaut, si vous faites insérer l' | ||
+ | |||
+ | |||
+ | **Add a section and copy the following code to reference your image (as you type /ref{ TeXstudio should fill in the image reference for you). | ||
\section A | \section A | ||
Ligne 75: | Ligne 140: | ||
Join us in the next issue for more LaTeX, where we will tackle more n00b stumbling blocks. | Join us in the next issue for more LaTeX, where we will tackle more n00b stumbling blocks. | ||
- | If you have any comments or queries, email us: misc@fullcirclemagazine.org | + | If you have any comments or queries, email us: misc@fullcirclemagazine.org** |
+ | |||
+ | Ajoutez une section et copiez le code suivant pour référencer votre image (lorsque vous tapez /ref{, TeXstudio devrait remplir la référence de l' | ||
+ | |||
+ | \section A | ||
+ | |||
+ | Comme vous pouvez le voir dans la figure \ref{fig: | ||
+ | |||
+ | Appuyez à nouveau sur F5 pour voir votre travail artistique. | ||
+ | |||
+ | Il est maintenant facile de faire référence à n' | ||
+ | |||
+ | J' | ||
+ | |||
+ | Rejoignez-nous dans le prochain numéro pour plus de LaTeX, où nous nous attaquerons à d' | ||
+ | |||
+ | Si vous avez des commentaires ou des questions, envoyez-nous un courriel à l' | ||
issue169/latex.1622525943.txt.gz · Dernière modification : 2021/06/01 07:39 de d52fr