Outils pour utilisateurs

Outils du site


issue168:tutoriel1

Ceci est une ancienne révision du document !


Website: https://www.latex-project.org/ Prerequisites: A willingness to learn. Target audience: N00bs 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. When it comes to typesetting, LaTeX is the undisputed champ. It outweighs its opponents in the sheer number of options alone. At first, LaTeX is a bit confusing and difficult to use. Not to scare you, but I suggest looking here: http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf

However, our intent with these tutorials is to help you unravel its mysteries and become a wizard at your Ubuntu computer. To help you get there, TeX studio is our IDE of choice. An IDE is a helper tool, nothing more. You actually do not even need it, but it makes things a lot easier. So fire up Tex studio, click the new tab button, and let’s get started. (If this seems foreign to you, see last issue). This is where I left you last issue. Which is fine and well for a cover page, but you may want to break up your writing into sections, so let's do just that. You can simply add a “/section” identifier and that will be the heading of your section. See, it’s not as crazy as it first seems.

If you missed our last issue, it is available to download in the back issues section: https://fullcirclemagazine.org/downloads/ You can make as many sections as you like. Try it now. You can even copy-paste them if you like. As you add sections, you will see them in the left-most pane in a tree view. This can be handy for writers wanting to keep their scenes or chapters together. If you used the auto-complete function, you may have noticed there was more than one ‘section’. If you added more sections, you may have noticed that they were numbered. If you would not like them numbered, you choose the option with the ‘*’ , or you can simply insert a star in front of the curly braces.

Here is our ‘code’ so far: \documentclass[a4paper]{article} \title{Your FCM bootcamp for \LaTeX} \author{ErikTheUnready} \begin{document} \maketitle \section{How I got hold of Bill Gates's balls… or, how to evade golf course security} \section{Autographs in the rear} \section*{Disguises you need to wear} \end{document} So far we have done nothing difficult to remember or difficult to grasp. The same is true for making subsections. It is simply ‘\subsection{}’

Go on, make a few, we know you want to. The same principle applies here regarding the ‘*’ before your curly braces. Say you want a subsection of a subsection, then you need to use the ‘\subsubsection{}’ command. So far, so good. Now the odd one; it’s the ‘\paragraph{title}’ - this will not make a paragraph, but a highlighted title, before your next sentence. Go ahead and try that now. To make a paragraph, you still need to do it in the old fashioned way.

If you listen to a lot of music, you will know what I am talking about when I use the word “tags”. When making a latex document, you will often put pictures in. You can “tag” these with a label, like ‘figure1’ or ‘fig:1’. These types of labels are not seen, but searchable. You can now reference this figure (fig:1) you tagged from anywhere in the document and it will always match up. Yes, even though this is a section. (We will get to images later). Instead of fig for figure, you can use sec: for section. You use the \ref command to reference a label you created. As you can see in our example, our label is under heading 3.2 now, but if I were to add a section before that, the pointer will now point to 3.3 or whatever it becomes. The key name does not matter, but it is good to stick to something standardised. The key: \label{pinkmoonmonkeys} - is just as valid as our example. Go ahead and tag a section with a label.

Moving along. If you want to insert a text symbol that was not on your keyboard, you can do so. For example \textdollar will insert the dollar symbol. I suggest doing a search in the comprehensive symbols list as there is no way you will remember them all. Just remember the format: \command[option]{argument} If the symbol is already on your keyboard, just like in BASH, you need to escape the character. Here is our ‘code’ so far, you can copy to see it in action: I want you to notice spaces. What caught your eye? Answers to: misc@fullcirclemagazine.org Unlike a word processor, we do not see Bold or Italic in the menu. My suggestion to newbies is to type \text in the IDE, and wait for the dropdown menu and scroll through that. To emphasise something, use /emph.

TIP: beware of using /emph as an option to something like a section, as it will move the word onto a new line. We have choices of \textit and \textsl – italics and slanted text. You can even try \textsc to change the word to small caps. Note that bold is \textbf for bold font. The catch comes when you need more than one option. What do you do? This problem is taken care of by nesting. We ‘nest’ our commands inside each other. Open a new window with CTRL+N or click the ‘new’ button and enter the following: \documentclass[a4paper]{article} \begin{document} Let us emphasize some \emph{emphasized text}. Commands can be \textsl{\textbf{nested}}. \emph{Note how \emph{emphasizing} changes when nested.} \end{document}

Compile and preview this new document. Notice how each command is ‘nested’ in its own curly braces inside the other command’s curly braces (see image below). So what did we learn in this issue? 1. a ‘*’ can negate automatic numbering. 2. When you refer to something, rather tag it with a \label 3. You can insert symbols, but also escape them. 4. We can nest commands. 5. Some things change, depending on their location. Is Latex becoming less cryptic? Did we make a mistake? Know of a better way? Then we would like to hear from you – misc@fullcirclemagazine.org

issue168/tutoriel1.1620108054.txt.gz · Dernière modification : 2021/05/04 08:00 de d52fr