issue190:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue190:latex [2023/03/01 11:06] – traduction complete darkjam | 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).** |
- | Voyons ce que nous avons couvert jusqu’à présent dans cette série sur le latex (voir le tableau ci-dessous). | + | Voyons ce que nous avons couvert jusqu’à présent dans cette série sur LaTeX (voir le tableau ci-dessous). |
- | 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 generate a PDF of about fifty to sixty pages. This is a task that Latex is much better at than word processors. I have written a few books using word processors. I wish I had known Latex at the time. If you wish to write several chapters, there are two obvious ways to do that in a word processor. The first is to put all of your work in one large file. That gets very unwieldy to navigate and will get painfully slow to edit, especially if your work includes anything other than text. Any graphics or tables will slow down editing work. | + | **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 generate a PDF of about fifty to sixty pages. This is a task that Latex is much better at than word processors. I have written a few books using word processors. I wish I had known Latex at the time. If you wish to write several chapters, there are two obvious ways to do that in a word processor. The first is to put all of your work in one large file. That gets very unwieldy to navigate and will get painfully slow to edit, especially if your work includes anything other than text. Any graphics or tables will slow down editing work.** |
- | Il y a dix-sept | + | Il y a dix-sept |
- | 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 to chapter can be painful. I know the major word processors have something like a “master document” that will pull all the individual files together. My experience is the master document method combines the weaknesses of both of the above methods, without generating any significant benefits. If you write a text and require references, endnotes, etc., these are difficult to manage with word processors' | + | **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 to chapter can be painful. I know the major word processors have something like a “master document” that will pull all the individual files together. My experience is the master document method combines the weaknesses of both of the above methods, without generating any significant benefits. If you write a text and require references, endnotes, etc., these are difficult to manage with word processors' |
- | 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), 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, | + | 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 |
- | 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. | + | **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.** |
- | Latex utilise ce qui est une approche de document maître. Contrairement aux traitements de texte, elle fonctionne. | + | LaTeX utilise ce qui est une approche de document maître. Contrairement aux traitements de texte, elle fonctionne. |
- | 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. | + | **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 (section) en utilisant | + | É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 |
- | 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, | + | **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' | + | 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. | + | **... 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 document, celle-ci doit accepter un ajout mensuel. Il s’avère que Latex fait de la combinaison | + | ...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. | + | **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 garder | + | 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 |
- | 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. | + | **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 maintenant | + | Il y a deux tâches que nous devons faire pour générer un grand document à partir de plusieurs petits, tout en gardant |
- | 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. | + | **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{}. | 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 46: | Ligne 55: | ||
\end{document} | \end{document} | ||
- | When we are finished, it will also contain all of the \usepackage instructions | + | Lorsque nous aurons terminé, il contiendra également toutes les instructions |
- | Lorsque nous aurons terminé, il contiendra également toutes les instructions | + | **\documentclass[letterpaper,11pt]{book} |
+ | %preamble (this is a comment) | ||
+ | \usepackage[utf8]{inputenc} | ||
+ | \author{Your Name} (optional) | ||
+ | \title{Your Title} (optional) | ||
+ | \date{January 2022} (optional) | ||
+ | \usepackage{graphicx, geometry, amsfonts, fancyhdr, xcolor, setspace, hyperref, cite, enumerate} | ||
+ | \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 63: | 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 |
- | Note : Si vous copiez et collez ce code dans votre IDE Latex, supprimez les éléments entre parenthèses (crochets ronds) ou commentez toutes les lignes qui ont des parenthèses ou vous aurez des erreurs lors de la compilation. | + | **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 |
- | 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 |
- | Pas besoin d’utiliser l’extension de fichier tex. Latex supposera que le fichier est un type de fichier tex. Si vous avez compilé les petits documents individuellement, | + | **\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 statements as needed so your book is complete. If you need any “back matter" | + | 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 |
- | 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, | + | **\backmatter |
+ | % bibliography, glossary and index would go here. | ||
+ | \include{appendix} | ||
+ | \bibliography{bibliography} | ||
+ | \end{document} | ||
+ | |||
+ | If you compile your book now you will get at least one major error. It will stop the compilation until you correct it. This is the second step, the step that is repetitive since it has to be done in every small file. You have to make sure any instructions that are in the master file do not compile or do not appear in the small files. You have two choices. You can remove the duplicates or you can comment them out. I strongly suggest the second – comment out the instructions | ||
\backmatter | \backmatter | ||
Ligne 89: | 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 |
- | Si vous compilez votre livre maintenant vous obtiendrez au moins une erreur majeure. Il arrêtera la compilation jusqu’à ce que vous la corrigez. C’est la deuxième étape, celle qui est répétitive puisqu’elle doit être faite dans chaque petit dossier. Vous devez vous assurer que les instructions qui sont dans le fichier maître ne compilent pas ou n’apparaissent pas dans les petits fichiers. Vous avez deux choix. Vous pouvez supprimer les doublons ou les commenter. Je vous suggère fortement de commenter les instructions qui ne sont plus nécessaires. Cela vous permettra de compiler les petits fichiers individuellement sans avoir à se rappeler ce qui est nécessaire pour les rendre à nouveau complets. | + | **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. | 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 |
- | Ces paquets ne sont pas nécessaires dans chaque petit fichier, mais au moins un des petits | + | **Now your small documents |
- | Now your small documents | + | Bon. Vos petits |
- | Maintenant, 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} |
- | \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, |
- | 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} |
- | Si vous écrivez de la fiction, vous n’avez probablement pas besoin de l’instruction d’étiquette puisqu’il est peu probable que vous allez avoir des références croisées. En non-fiction, | + | Si vous écrivez de la fiction, vous n’avez probablement pas besoin de l’instruction d’étiquette puisqu’il est peu probable que vous ayez des références croisées. En non-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. | + | **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' | + | L' |
- | 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.) | + | **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.)** |
- | 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 FCM-168 à la page 3. (Découvrez ce qui se passe si vous laissez les commentaires sur les instructions frontmatter et mainmatter | + | 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 |
- | Here is the Table of Contents for a more complete set of includes from other Latex articles. | + | **Here is the Table of Contents for a more complete set of includes from other Latex articles.** |
- | Voici la table des matières comprenant plus d' | + | Voici la table des matières comprenant plus d' |
- | That is it for this issue. Keep working with Latex and your favourite IDE, or try another IDE. | + | **That is it for this issue. Keep working with Latex and your favourite IDE, or try another IDE.** |
- | C’est tout pour ce numéro. Continuez à travailler avec Latex et votre IDE préféré, ou essayez un autre IDE. | + | C’est tout pour ce numéro. Continuez à travailler avec LaTeX et votre IDE préféré, ou essayez un autre IDE. |
issue190/latex.1677665170.txt.gz · Dernière modification : 2023/03/01 11:06 de darkjam