issue194:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue194:latex [2023/07/01 06:48] – créée d52fr | issue194:latex [2023/07/07 16:30] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | For this project, I am going to put together a small book from several files. Since I like to cook, I also collect recipes, particularly recipes of Chinese dishes. So this book is going to be a cookbook. The techniques and procedures can be used for any book. I went over putting several files together to generate one PDF in FCM #190. This project will use the techniques discussed in that previous work and expand upon them. | + | **For this project, I am going to put together a small book from several files. Since I like to cook, I also collect recipes, particularly recipes of Chinese dishes. So this book is going to be a cookbook. The techniques and procedures can be used for any book. I went over putting several files together to generate one PDF in FCM #190. This project will use the techniques discussed in that previous work and expand upon them. |
The first thing we need to do is open a new document. The document class needs to be “book”. The document class “article” could be used but that will change the options available. For example, ‘article’ sets margins for printing one side only. The ‘book’ class is designed to produce a PDF that could be printed and bound as a book with two-sided printing. This means margins are not left and right, but inside and outside. It also means the text of the book starts on a right-hand page and that each chapter starts on a right-hand page. If a chapter ends with a right-hand, odd-numbered page, then a blank left-hand page is inserted before the next chapter starts. When using the document class ‘article’, | The first thing we need to do is open a new document. The document class needs to be “book”. The document class “article” could be used but that will change the options available. For example, ‘article’ sets margins for printing one side only. The ‘book’ class is designed to produce a PDF that could be printed and bound as a book with two-sided printing. This means margins are not left and right, but inside and outside. It also means the text of the book starts on a right-hand page and that each chapter starts on a right-hand page. If a chapter ends with a right-hand, odd-numbered page, then a blank left-hand page is inserted before the next chapter starts. When using the document class ‘article’, | ||
- | Top right is the code I will start with. I have put my annotations below the code. | + | Top right is the code I will start with. I have put my annotations below the code.** |
- | All lines starting with a percent symbol are comments. All lines starting with a back slash are Latex instructions. \frontmatter, \mainmatter, \backmatter instructions work with the ‘book’ document class but are not allowed in the article | + | Pour ce projet, je vais assembler un petit livre à partir de plusieurs fichiers. Comme j'aime cuisiner, je collectionne aussi des recettes, notamment des recettes de plats chinois. Ce livre sera donc un livre de recettes. Les techniques et les procédures peuvent être utilisées pour n' |
- | \tableofcontents uses the \chapter instructions in each of the recipes to make the table-of-contents automatically. The \include commands bring the individual recipe files into the PDF. These files are in the same directory as this “master” file. That is not necessary. If they were in one or more different directories, | + | La première chose à faire est d' |
+ | |||
+ | En haut à droite se trouve le code avec lequel je vais commencer. J'ai placé mes annotations sous le code. | ||
+ | |||
+ | |||
+ | **All lines starting with a percent symbol are comments. All lines starting with a back slash are LaTeX instructions. \frontmatter, | ||
+ | |||
+ | \tableofcontents uses the \chapter instructions in each of the recipes to make the table-of-contents automatically. The \include commands bring the individual recipe files into the PDF. These files are in the same directory as this “master” file. That is not necessary. If they were in one or more different directories, | ||
This revision of the cookbook does not have any back matter. A real cookbook would have a recipe name index and an ingredient index. Since these recipes include ingredients specific to Chinese food, I might also include a glossary. Those are topics for another article (or two). | This revision of the cookbook does not have any back matter. A real cookbook would have a recipe name index and an ingredient index. Since these recipes include ingredients specific to Chinese food, I might also include a glossary. Those are topics for another article (or two). | ||
Ligne 23: | Ligne 30: | ||
\begin{enumerate} starts a numbered or ordered list | \begin{enumerate} starts a numbered or ordered list | ||
\item Put 3 cups of the flour into a bowl. | \item Put 3 cups of the flour into a bowl. | ||
+ | ... | ||
+ | \end{enumerate}** | ||
+ | |||
+ | Toutes les lignes commençant par un symbole de pourcentage sont des commentaires. Toutes les lignes commençant par une barre oblique arrière sont des instructions LaTeX. Les instructions \frontmatter, | ||
+ | |||
+ | \tableofcontents utilise les instructions \chapter dans chacune des recettes pour créer automatiquement la table des matières. Les commandes \include intègrent les fichiers individuels des recettes dans le PDF. Ces fichiers se trouvent dans le même répertoire que le fichier « master » (maître). Ce n'est pas nécessaire. S'ils se trouvaient dans un ou plusieurs répertoires différents, | ||
+ | |||
+ | Cette version d'un livre de recettes ne comporte pas de quatrième de couverture. Un véritable livre de recettes comporterait un index des noms de recettes et un index des ingrédients. Étant donné que ces recettes comprennent des ingrédients spécifiques à la cuisine chinoise, je pourrais également inclure un glossaire. Ces sujets feront l' | ||
+ | |||
+ | En haut à droite se trouve un exemple d'un des fichiers inclus. | ||
+ | |||
+ | Notes pour le fichier inclus : | ||
+ | \chapitre{titre du chapitre} | ||
+ | \section*{nom de la section} L' | ||
+ | \begin{itemize} commence une liste non ordonnée ou à puces. | ||
+ | \item 3 1/2 tasses de farine. | ||
+ | \item 1 cuillère à soupe de matière grasse. | ||
+ | \end{itemize} | ||
+ | \section*{Instructions} | ||
+ | \begin{enumerate} commence une liste numérotée ou ordonnée. | ||
+ | \item Mettez 3 tasses de farine dans un bol. | ||
... | ... | ||
\end{enumerate} | \end{enumerate} | ||
- | When the PDF is built, the instruction \include{Bao} is replaced by the contents of the Bao.tex file. That means the Bao.tex file does not have any of the introductory or concluding instructions. This particular recipe does have text after the list of instructions. It is important not to include the \end{document} instruction at the end of the included file. | ||
- | This is my first edit of the first part of the cookbook. It requires more work. For example, the fraction in 3 1/2 cups of flour needs to look like a fraction. I could write it as a decimal, but that would cause confusion. “Does 3.5 mean 3 ½ or 35 cups?” So I need to change the 1/2 so that Latex formats it as ½. (Any other fractions should be reformatted as well.) Ideally, all dry ingredients would be measured in grams, and all liquid ingredients in millilitres. That would eliminate the fractions but also make the cookbook unsaleable in Canada and the U.S.A. | ||
- | There is at least one file currently included that has more than one recipe in it. I want to separate each recipe into a different tex file and a different include, so I can arrange the recipes in the order I want. I will probably add “chapters” – which will be section dividers: perhaps meat, eggs, vegetables, soup, fish, etc. Or perhaps sections for dishes from different parts of China. | + | **When the PDF is built, the instruction \include{Bao} is replaced by the contents of the Bao.tex file. That means the Bao.tex file does not have any of the introductory or concluding instructions. This particular recipe does have text after the list of instructions. It is important not to include the \end{document} instruction at the end of the included file. |
+ | |||
+ | This is my first edit of the first part of the cookbook. It requires more work. For example, the fraction in 3 1/2 cups of flour needs to look like a fraction. I could write it as a decimal, but that would cause confusion. “Does 3.5 mean 3 ½ or 35 cups?” So I need to change the 1/2 so that LaTeX formats it as ½. (Any other fractions should be reformatted as well.) Ideally, all dry ingredients would be measured in grams, and all liquid ingredients in millilitres. That would eliminate the fractions but also make the cookbook unsaleable in Canada and the U.S.A. | ||
+ | |||
+ | There is at least one file currently included that has more than one recipe in it. I want to separate each recipe into a different tex file and a different include, so I can arrange the recipes in the order I want. I will probably add “chapters” – which will be section dividers: perhaps meat, eggs, vegetables, soup, fish, etc. Or perhaps sections for dishes from different parts of China.** | ||
+ | |||
+ | Lorsque le PDF est construit, l' | ||
+ | |||
+ | Il s'agit de ma première édition de la première partie du livre de recettes. Elle nécessite plus de travail. Par exemple, la fraction dans « 3 1/2 tasses de farine » doit ressembler à une fraction. Je pourrais l' | ||
+ | |||
+ | Il y a au moins un fichier actuellement inclus qui contient plus d'une recette. Je souhaite séparer chaque recette dans un fichier TeX différent et dans un \include différent, afin de pouvoir classer les recettes dans l' | ||
+ | |||
+ | |||
+ | |||
+ | **Cookbooks deserve to be illustrated with photos. Some recipes can benefit from images as well as words to show how a dish is put together. | ||
+ | |||
+ | I need to decide if I am happy with the way the book looks. Do I want to change the page size or the margins or the default fonts being used? Do I want to add some color? Drop caps are nice if used judiciously. There is the end matter to build: index, indices, glossary. You can probably think of other changes you would make if you were writing, editing, publishing a book. We will work through some or perhaps all of these features in the next few columns.** | ||
- | Cookbooks deserve to be illustrated with photos. | + | Les livres de recettes méritent d' |
- | I need to decide if I am happy with the way the book looks. Do I want to change the page size or the margins or the default fonts being used? Do I want to add some color? Drop caps are nice if used judiciously. There is the end matter to build: index, indices, | + | Je dois décider si je suis satisfait de l' |
issue194/latex.1688186932.txt.gz · Dernière modification : 2023/07/01 06:48 de d52fr