issue190:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue190:latex [2023/02/26 12:08] – créée auntiee | issue190:latex [2023/03/01 16:47] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Let’s take a look at what we have covered so far in this series about Latex (see table below). | + | **Let’s take a look at what we have covered so far in this series about Latex (see table below).** |
- | There are seventeen pieces of information about using Latex. | + | Voyons ce que nous avons couvert jusqu’à présent dans cette série sur LaTeX (voir le tableau ci-dessous). |
- | The second way is to put each chapter or each section in its own file. If you do that, keeping page numbering consistent and correct is a major chore. If you use Styles in a word processor (which you should), keeping the styles consistent from chapter | + | **There are seventeen pieces of information about using Latex. (This one makes eighteen.) Assume we want to put all of them together to make a small book, a quick introduction to some of the major features of Latex. At two or three pages each, we should |
- | Latex uses what is a master document approach. Unlike word processors it works. You will learn how it works if you follow along with what I do this time. | + | Il y a dix-sept éléments d' |
- | Obviously what I do in this article will not generate | + | **The second way is to put each chapter or each section in its own file. If you do that, keeping page numbering consistent and correct is a major chore. If you use Styles |
- | To start with, we will need at least some of the eighteen articles from the previous issues. What is needed is each article in plain text, in an ASCII file which is what tex files are. Since some of the articles include graphics, it would be best to have each article in its own folder. The “root” file will be called latexbk.tex, and will sit in a folder that also contains eighteen sub-folders: fcm167, fcm168, etc. In the folder for each issue will be a file called fcm###.tex plus any graphics that are part of that issue (next page, top right for the code). | + | La deuxième façon est de mettre chaque chapitre ou chaque section dans son propre dossier. Si vous faites cela, garder la numérotation des pages cohérente et correcte est une corvée majeure. Si vous utilisez des styles dans un traitement de texte (ce que vous devriez faire), garder les styles cohérents d’un chapitre à l’autre peut être douloureux. Je sais que les grands spécialistes du traitement de texte ont quelque chose comme un « document principal » qui regroupe tous les dossiers individuels. Mon expérience est que la méthode de document maître combine les faiblesses des deux méthodes ci-dessus, sans générer d’avantages significatifs. Si vous écrivez un texte et que vous avez besoin de références, |
- | ... and so on, for all seventeen of the articles that Eric and I have written. Of course we expect to write more about Latex in the future. Whatever method used to put all of the code from the seventeen articles into one document | + | **Latex uses what is a master |
- | Note I have copied only the Latex document | + | LaTeX utilise ce qui est une approche de document |
- | There are two tasks we need to do to generate a large document from several small ones, while still maintaining the small ones as independent files. The first step is to make a “master” file. The second is to remove all the elements from the individual files that make them independent files. Neither task is difficult. However the second step will be repetitious since it has to be done on every small file. | + | |
- | The master file contains the overall instructions for the book. It has everything from \documentclass[]{} down to \begindocument{} and it also has the \enddocument{} code. | + | **Obviously what I do in this article will not generate a fifty page PDF. However I hope you will learn the techniques needed to build multiple chapter (section) output using Latex.** |
+ | |||
+ | Évidemment ce que je fais dans cet article ne générera pas un PDF de cinquante pages. Cependant, j’espère que vous apprendrez les techniques nécessaires pour construire plusieurs chapitres (sections) en utilisant LaTeX. | ||
+ | |||
+ | **To start with, we will need at least some of the eighteen articles from the previous issues. What is needed is each article in plain text, in an ASCII file which is what tex files are. Since some of the articles include graphics, it would be best to have each article in its own folder. The “root” file will be called latexbk.tex, | ||
+ | |||
+ | Pour commencer, nous aurons besoin d’au moins quelques-uns des dix-huit articles des numéros précédents. Il est nécessaire d' | ||
+ | |||
+ | **... and so on, for all seventeen of the articles that Eric and I have written. Of course we expect to write more about Latex in the future. Whatever method used to put all of the code from the seventeen articles into one document needs to accept a monthly addition. As it turns out, Latex makes combining “chapters” into a “book” a very simple job.** | ||
+ | |||
+ | ...et ainsi de suite, pour les dix-sept articles qu’Eric et moi avons écrits. Bien sûr, nous nous attendons à en écrire davantage sur le LaTeX à l’avenir. Quelle que soit la méthode utilisée pour mettre tout le code des dix-sept articles dans un seul document, celle-ci doit accepter un ajout mensuel. Il s’avère que LaTeX fait de l' | ||
+ | |||
+ | **Note I have copied only the Latex document code from these two articles. I did that to keep this article a reasonable size. Any tex file or any plain text file that can be converted to a tex file can easily be included in a larger document.** | ||
+ | |||
+ | Notez que j’ai copié seulement le code de document de LaTeX de ces deux articles. J’ai fait cela pour que la taille de cet article reste raisonnable. Tout fichier TeX ou tout fichier texte qui peut être converti en fichier TeX peut facilement être inclus dans un document plus grand. | ||
+ | |||
+ | **There are two tasks we need to do to generate a large document from several small ones, while still maintaining the small ones as independent files. The first step is to make a “master” file. The second is to remove all the elements from the individual files that make them independent files. Neither task is difficult. However the second step will be repetitious since it has to be done on every small file.** | ||
+ | |||
+ | Il y a deux tâches que nous devons faire pour générer un grand document à partir de plusieurs petits, tout en gardant les petits comme fichiers indépendants. La première étape consiste à créer un fichier « maître » et la deuxième consiste à supprimer tous les éléments des fichiers individuels qui en font des fichiers indépendants. Aucune de ces tâches n’est difficile. Toutefois, la deuxième étape sera répétitive puisqu’elle doit être effectuée pour chaque petit dossier. | ||
+ | |||
+ | **The master file contains the overall instructions for the book. It has everything from \documentclass[]{} down to \begindocument{} and it also has the \enddocument{} code. ** | ||
+ | |||
+ | Le fichier principal contient les instructions générales pour le livre. Il a tout ce qui est compris entre \documentclass[]{} et \begindocument{}. Il se termine par \enddocument{}. | ||
+ | |||
+ | **\documentclass[a4paper]{article} | ||
+ | \title{Your First Book} | ||
+ | \author{Your Name} | ||
+ | \begin{document} | ||
+ | ... | ||
+ | \end{document} | ||
+ | |||
+ | When we are finished, it will also contain all of the \usepackage instructions in all of your small files. Simply copy and paste any \usepackage instructions to the master file before commenting them. The top of your master document might look like this when you are finished.** | ||
\documentclass[a4paper]{article} | \documentclass[a4paper]{article} | ||
Ligne 25: | Ligne 55: | ||
\end{document} | \end{document} | ||
- | When we are finished, it will also contain all of the \usepackage | + | Lorsque nous aurons terminé, il contiendra également toutes les instructions |
+ | |||
+ | **\documentclass[letterpaper, | ||
+ | %preamble (this is a comment) | ||
+ | \usepackage[utf8]{inputenc} | ||
+ | \author{Your Name} (optional) | ||
+ | \title{Your Title} (optional) | ||
+ | \date{January 2022} (optional) | ||
+ | \usepackage{graphicx, | ||
+ | \begin{document} | ||
+ | \frontmatter (optional) | ||
+ | \maketitle (No title? Remove this code) | ||
+ | \tableofcontents (No table of contents - remove) | ||
+ | \mainmatter (optional) | ||
+ | |||
+ | Note: If you are going to copy and paste this code into your Latex IDE, remove the items in parentheses (round brackets) or comment out all lines that have parentheses or there will be errors when compiling.** | ||
\documentclass[letterpaper, | \documentclass[letterpaper, | ||
Ligne 40: | Ligne 85: | ||
\mainmatter (optional) | \mainmatter (optional) | ||
- | Note: If you are going to copy and paste this code into your Latex IDE, remove the items in parentheses | + | Note : Si vous copiez et collez ce code dans votre IDE LaTeX, supprimez les éléments entre parenthèses |
- | A series of “include” statements replace the text which would appear in any regular Tex document. | + | **A series of “include” statements replace the text which would appear in any regular Tex document.** |
+ | |||
+ | Une série « \include » remplace le texte qui apparaîtrait dans tout document TeX ordinaire. | ||
+ | |||
+ | **\include{fcm167} | ||
+ | |||
+ | No need to use the tex file extension. Latex will assume the file is a tex file type. If you have compiled the small documents individually, | ||
\include{fcm167} | \include{fcm167} | ||
- | No need to use the tex file extension. Latex will assume the file is a tex file type. If you have compiled the small documents | + | Pas besoin d’utiliser l’extension de fichier |
+ | |||
+ | **\include{fcm167/ | ||
+ | |||
+ | Add as many include statements as needed so your book is complete. If you need any “back matter" | ||
\include{fcm167/ | \include{fcm167/ | ||
- | Add as many include | + | Ajoutez autant de déclarations d’inclusion que nécessaire pour que votre livre soit complet. Si vous avez besoin d’une table des matières, index ou glossaire pour votre livre, mettez ces instructions après la dernière déclaration d’inclusion. Fermez ensuite le fichier. |
+ | |||
+ | **\backmatter | ||
+ | % bibliography, | ||
+ | \include{appendix} | ||
+ | \bibliography{bibliography} | ||
+ | \end{document} | ||
+ | |||
+ | If you compile | ||
\backmatter | \backmatter | ||
Ligne 58: | Ligne 121: | ||
\end{document} | \end{document} | ||
- | If you compile your book now you will get at least one major error. It will stop the compilation | + | Si vous compilez votre livre maintenant, vous obtiendrez au moins une erreur majeure. Elle arrêtera la compilation |
- | Remember to copy and paste any usepackage[]{} statements from the small files into the master file before you make them comments. You can see a line of packages in the sample document. | + | **Remember to copy and paste any usepackage[]{} statements from the small files into the master file before you make them comments. You can see a line of packages in the sample document.** |
+ | |||
+ | N’oubliez pas de copier et coller les instructions usepackage[]{} des petits fichiers dans le fichier principal avant de les commenter. Vous pouvez voir une ligne de paquets dans l’exemple de document. | ||
+ | |||
+ | **\usepackage{graphicx, | ||
+ | |||
+ | These packages are not needed in every small file but at least one of the small documents requires one (or more) of these packages. If all of them are not included in a usepackage instruction the final book will not look as it should.** | ||
\usepackage{graphicx, | \usepackage{graphicx, | ||
- | These packages are not needed in every small file but at least one of the small documents | + | Ces paquets ne sont pas nécessaires dans chaque petit fichier, mais au moins un des petits |
- | Now your small documents will start with any chapter or section title and possibly a label so you can use cross references from one or more of the other small files in the book. | + | **Now your small documents will start with any chapter or section title and possibly a label so you can use cross references from one or more of the other small files in the book.** |
+ | |||
+ | Bon. Vos petits documents commenceront avec n’importe quel titre de chapitre ou de section et éventuellement une étiquette afin que vous puissiez utiliser des références croisées à partir d’un ou plusieurs des autres petits fichiers du livre. | ||
+ | |||
+ | **\chapter{Chapter 1}\label{chap01} | ||
+ | |||
+ | If you are writing fiction, you probably do not need the label instruction since it is unlikely you are going to have cross references. In non-fiction, | ||
\chapter{Chapter 1}\label{chap01} | \chapter{Chapter 1}\label{chap01} | ||
- | If you are writing | + | Si vous écrivez de la fiction, |
+ | |||
+ | **The sample code for the master file with the Tex code from FCM-167 and FCM-168 generates a six-page PDF. The first page is the title, then a blank page so the Table of Contents can start on a right-hand page. (I used documentclass = book.) Then there is another blank page so the contents can start on a right-hand page. The one line of text from FCM-167 is on physical page 5 (page 1 in the book) and the text from FCM-168 is on physical page 6.** | ||
+ | |||
+ | L' | ||
+ | |||
+ | **If I change the documentclass | ||
+ | |||
+ | Si je change la classe documentclass en article, les instructions frontmatter et mainmatter doivent être supprimées ou commentées. Une fois cela fait, l’article se compile en trois pages. Le titre et la table des matières apparaissent à la page 1, le texte de FCM-167 à la page 2, et celui de FCM-168 à la page 3. (Découvrez ce qui se passe si vous laissez les commentaires sur les instructions frontmatter et mainmatter et que vous changez le documentclass en book.) | ||
- | The sample code for the master file with the Tex code from FCM-167 and FCM-168 generates a six-page PDF. The first page is the title, then a blank page so the Table of Contents | + | **Here |
- | If I change the documentclass to article, both the frontmatter and mainmatter instructions have to be removed or commented. Once that is done, the article compiles to three pages. The title and Table of Contents appear on page 1, the text from FCM-167 on page 2, and FCM-168 on page 3. (Find out what happens if you leave frontmatter and mainmatter commented and change to documentclass = book.) | + | Voici la table des matières comprenant plus d' |
- | Here is the Table of Contents | + | **That |
- | That is it for this issue. Keep working with Latex and your favourite | + | C’est tout pour ce numéro. Continuez à travailler avec LaTeX et votre IDE préféré, ou essayez un autre IDE. |
issue190/latex.1677409699.txt.gz · Dernière modification : 2023/02/26 12:08 de auntiee