issue181:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue181:latex [2022/05/27 19:44] – créée d52fr | issue181:latex [2022/06/03 15:04] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Erik covered a lot of ground quickly in the previous nine articles about Latex. By the way the “X” in TeX is pronounced in the same way as the German or Scottish “ch” – very similar to the English “k”. It is quite different from the “x” in Texas. So Latex sounds like “latek”, | + | **Erik covered a lot of ground quickly in the previous nine articles about Latex. By the way the “X” in TeX is pronounced in the same way as the German or Scottish “ch” – very similar to the English “k”. It is quite different from the “x” in Texas. So Latex sounds like “latek”, |
To start my part in this series, I am going to step back a bit from typing code and define some basic Latex terms. If you have ever typed HTML code (not just used some software to generate HTML code), you should notice some similarities between HTML and Latex. Latex pre-dates HTML by more than ten years, perhaps Berners-Lee was familiar with Latex when he designed HTML. | To start my part in this series, I am going to step back a bit from typing code and define some basic Latex terms. If you have ever typed HTML code (not just used some software to generate HTML code), you should notice some similarities between HTML and Latex. Latex pre-dates HTML by more than ten years, perhaps Berners-Lee was familiar with Latex when he designed HTML. | ||
- | Environment: | + | Environment: |
- | Erik has already introduced you to these environments: | + | Erik a rapidement couvert beaucoup de terrain dans les neuf articles précédents sur LaTeX. À propos, le « X » de TeX se prononce de la même manière que le « ch » allemand ou écossais - très similaire au « k » anglais. Il est très différent du « x » dans Texas. Ainsi, la prononciation de LaTeX ressemble à « latek », et ne rime pas avec le tissu synthétique Spandex. |
+ | |||
+ | Pour commencer ma partie de cette série, je vais prendre un peu de recul par rapport à la saisie de code et définir quelques termes de base du LaTeX. Si vous avez déjà tapé du code HTML (et pas seulement utilisé un logiciel pour générer du code HTML), vous devriez remarquer certaines similitudes entre HTML et LaTeX. LaTeX précède le HTML de plus de dix ans ; peut-être Berners-Lee était-il familier avec LaTeX lorsqu' | ||
+ | |||
+ | L' | ||
+ | |||
+ | |||
+ | **Erik has already introduced you to these environments: | ||
As you know, if you have followed this series, every Latex project has to start with the document environment. All other environments are used with the document environment. | As you know, if you have followed this series, every Latex project has to start with the document environment. All other environments are used with the document environment. | ||
- | Unlike word processors, Latex forces a document to have one consistent structure or style or “look”. People use Latex because of this built-in consistency. Two documents with identical preambles will have exactly the same look. That has enormous benefits for organizations. If you are writing a note to your favourite aunt, this consistency probably does not matter. If your writing represents your employer, it is (or should be) very important to your employer that your documents look the same as the documents produced by your colleagues. | + | Unlike word processors, Latex forces a document to have one consistent structure or style or “look”. People use Latex because of this built-in consistency. Two documents with identical preambles will have exactly the same look. That has enormous benefits for organizations. If you are writing a note to your favourite aunt, this consistency probably does not matter. If your writing represents your employer, it is (or should be) very important to your employer that your documents look the same as the documents produced by your colleagues.** |
- | This consistency also means that, if you change the preamble, then the look of your document changes. If you write an article for Journal A, you will use Journal A’s Latex style. If Journal A decides not to publish your article, you can change the preamble to match Journal B’s Latex style and submit it to Journal B without making any other changes in your document. Doing the same thing in a word processor is almost always much more work. | + | Erik vous a déjà présenté ces environnements : document, figure, table, tabular, abstract, equation. Les environnements peuvent être appelés les uns dans les autres. Par exemple, vous pouvez placer un environnement figure, dans un environnement tabular, dans un environnement table. Les environnements doivent être fermés dans l' |
+ | |||
+ | Comme vous le savez, si vous avez suivi cette série, chaque projet LaTeX doit commencer par l' | ||
+ | |||
+ | Contrairement aux traitements de texte, LaTeX oblige un document d' | ||
+ | |||
+ | |||
+ | **This consistency also means that, if you change the preamble, then the look of your document changes. If you write an article for Journal A, you will use Journal A’s Latex style. If Journal A decides not to publish your article, you can change the preamble to match Journal B’s Latex style and submit it to Journal B without making any other changes in your document. Doing the same thing in a word processor is almost always much more work. | ||
In Part 7, FCM#174, Erik already showed a C.V. style from latextemplates.com. We will do some more work with styles later in this series. This time, I am going to introduce two other environments, | In Part 7, FCM#174, Erik already showed a C.V. style from latextemplates.com. We will do some more work with styles later in this series. This time, I am going to introduce two other environments, | ||
Ligne 17: | Ligne 31: | ||
In Latex numbered lists are built in the “enumerate” environment. The code looks like this: | In Latex numbered lists are built in the “enumerate” environment. The code looks like this: | ||
- | \begin{enumerate} which must be closed with \end{enumerate} | + | \begin{enumerate} which must be closed with \end{enumerate}** |
- | To get a numbered list, each item starts with the command \item. It does what you would expect: starts an item in the list. Items are enumerated by numbers by default. If you wish to use numbering other than standard Arabic numerals, then insert \usepackage{enumerate} in the preamble of your document, the block between documentclass[]{} and begin{document}. Then you can use a variety of “numbers” for the items in the list: for example lower and Upper case Roman numerals, or lower and Upper case letters. You can also add parentheses, or periods, or text, [Example i]. The modification to the numbering scheme is placed between square brackets after \begin{enumerate}[...] | + | Cette cohérence signifie également que, si vous modifiez le préambule, l' |
- | The environment for the other type of list is “itemize”. It is used for what are normally called “bulleted lists”. It also uses the command \item for each item in the list. \item can have the type of bullet in square brackets if the writer wishes to use something other than the default bullet which is a small black circle. For example to have a dash in front of each item use \item[-] (shown second down on the right, and in the image bottom right) | + | Dans la partie 7 du FCM n° 174, Erik a déjà montré un style de C.V. provenant de latextemplates.com. Nous travaillerons davantage avec les styles plus tard dans cette série. Cette fois, je vais présenter deux autres environnements, |
- | Remember the % sign starts a comment which is visible in the Latex code but not in the final PDF. | + | Dans LaTeX, les listes numérotées sont construites dans l' |
+ | |||
+ | \begin{enumerate} qui doit être fermé par \end{enumerate}. | ||
+ | |||
+ | |||
+ | **To get a numbered list, each item starts with the command \item. It does what you would expect: starts an item in the list. Items are enumerated by numbers by default. If you wish to use numbering other than standard Arabic numerals, then insert \usepackage{enumerate} in the preamble of your document, the block between documentclass[]{} and begin{document}. Then you can use a variety of “numbers” for the items in the list: for example lower and Upper case Roman numerals, or lower and Upper case letters. You can also add parentheses, | ||
+ | |||
+ | The environment for the other type of list is “itemize”. It is used for what are normally called “bulleted lists”. It also uses the command \item for each item in the list. \item can have the type of bullet in square brackets if the writer wishes to use something other than the default bullet which is a small black circle. For example to have a dash in front of each item use \item[-] (shown second down on the right, and in the image bottom right)** | ||
+ | |||
+ | Pour obtenir une liste numérotée, | ||
+ | |||
+ | L' | ||
+ | |||
+ | |||
+ | **Remember the % sign starts a comment which is visible in the Latex code but not in the final PDF. | ||
As in word processors and HTML, Latex lists can be nested. If you do nest two or more lists, remember the rule: nested environments must be closed in the reverse order they are opened. Environments are opened from the outside to the inside, they must be closed from the inside to the outside. | As in word processors and HTML, Latex lists can be nested. If you do nest two or more lists, remember the rule: nested environments must be closed in the reverse order they are opened. Environments are opened from the outside to the inside, they must be closed from the inside to the outside. | ||
- | Bulleted lists and numbered lists can be nested in each other. If you add \usepackage{enumerate} to the preamble of your documents (the block between documentclass{...} and begin{document}), | + | Bulleted lists and numbered lists can be nested in each other. If you add \usepackage{enumerate} to the preamble of your documents (the block between documentclass{...} and begin{document}), |
+ | |||
+ | N' | ||
+ | |||
+ | Comme dans les traitements de texte et le HTML, les listes Latex peuvent être imbriquées. Si vous imbriquez deux listes ou plus, rappelez-vous la règle suivante : les environnements imbriqués doivent être fermés dans l' | ||
+ | Les listes à puces et les listes numérotées peuvent être imbriquées les unes dans les autres. Si vous ajoutez \usepackage{enumerate} au préambule de vos documents (le bloc entre documentclass{...} et begin{document}), | ||
issue181/latex.1653673472.txt.gz · Dernière modification : 2022/05/27 19:44 de d52fr