issue214:latex
                Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| issue214:latex [2025/03/02 08:11] – créée d52fr | issue214:latex [2025/03/06 10:16] (Version actuelle) – andre_domenech | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | Once again we will venture into the world of Latex. For those who are new to this series, in each issue I explore another facet of Latex, one of the offshoots of a remarkable, freely available, open source, typesetting software package called Tex. Developed and written by Stanford University professor Donald Knuth, it was released in 1978. Professor Knuth wanted to have a typesetting program which would print his documents with the same look no matter what operating system was used. This was imperative in mathematics and computer science - which uses complex and complicated formulas. Tex has been expanded since 1978 to make it possible for anyone to produce well designed, high quality, books (either printed or electronic) with minimal knowledge of typesetting. Tex documents look the same not only independent of operating systems but also independent of when they are generated. In the 1970s and 1980s memory and storage were both expensive. Tex was designed to be modular so the user only loaded into memory the modules needed for one particular document. For example, if a document does not have a table, then do not load the table module. | + | **Once again we will venture into the world of Latex. For those who are new to this series, in each issue I explore another facet of Latex, one of the offshoots of a remarkable, freely available, open source, typesetting software package called Tex. Developed and written by Stanford University professor Donald Knuth, it was released in 1978. Professor Knuth wanted to have a typesetting program which would print his documents with the same look no matter what operating system was used. This was imperative in mathematics and computer science - which uses complex and complicated formulas. Tex has been expanded since 1978 to make it possible for anyone to produce well designed, high quality, books (either printed or electronic) with minimal knowledge of typesetting. Tex documents look the same not only independent of operating systems but also independent of when they are generated. In the 1970s and 1980s memory and storage were both expensive. Tex was designed to be modular so the user only loaded into memory the modules needed for one particular document. For example, if a document does not have a table, then do not load the table module. | 
| - | Typesetting instructions always start with a backslash followed by a keyword. The keyword may have options which are surrounded by square brackets and/or content which is surrounded by curly brackets. Latex is a document production system which uses Tex as its base. It may be the most popular document production system based on Tex but there are others including PdfTex, XeTex, and Luatex. Each system has its own supporters, its own strengths and weaknesses. Some macros (packages) are usable in only one or more systems, some macros work in all. | + | Typesetting instructions always start with a backslash followed by a keyword. The keyword may have options which are surrounded by square brackets and/or content which is surrounded by curly brackets. Latex is a document production system which uses Tex as its base. It may be the most popular document production system based on Tex but there are others including PdfTex, XeTex, and Luatex. Each system has its own supporters, its own strengths and weaknesses. Some macros (packages) are usable in only one or more systems, some macros work in all.** | 
| - | This time, we will explore a few more of the many packages available at ctan.org. (CTAN is the Comprehensive | + | Nous allons à nouveau nous aventurer dans le monde de LaTeX. Pour ceux qui ne connaissent pas cette série, dans chaque numéro, j' | 
| + | |||
| + | Les instructions de composition commencent toujours par une barre oblique inverse suivie d'un mot-clé. Le mot-clé peut avoir des options entourées de crochets et/ou un contenu entouré d' | ||
| + | |||
| + | |||
| + | **This time, we will explore a few more of the many packages available at ctan.org. (CTAN is the Comprehensive | ||
| I have worked my way through the alphabetical list of topics to “F”. The number of packages that start with F is enormous. I picked just a few for this issue. The first one I will explore this time is fancyhdr, developed in 1994 and last revised in 2025 January. The user manual is 131 pages in English, it is also available in Italian. There are “training slides” available in German. It is discussed in vol 1 of The Latex Companion. Instructions for users are on the first 85 pages of the manual, the remaining pages cover implementation and change logs. This seems like a lot of information about headers and footers, document features most of us take for granted or ignore. To use the fancyhdr package issue these two commands: | I have worked my way through the alphabetical list of topics to “F”. The number of packages that start with F is enormous. I picked just a few for this issue. The first one I will explore this time is fancyhdr, developed in 1994 and last revised in 2025 January. The user manual is 131 pages in English, it is also available in Italian. There are “training slides” available in German. It is discussed in vol 1 of The Latex Companion. Instructions for users are on the first 85 pages of the manual, the remaining pages cover implementation and change logs. This seems like a lot of information about headers and footers, document features most of us take for granted or ignore. To use the fancyhdr package issue these two commands: | ||
| Ligne 26: | Ligne 31: | ||
| \fancyfoot[c]{page \thepage} % thepage means the current page | \fancyfoot[c]{page \thepage} % thepage means the current page | ||
| + | |||
| + | \begin{document} | ||
| + | |||
| + | \lipsum[1-4]** | ||
| + | |||
| + | Cette fois-ci, nous allons explorer quelques-uns des nombreux paquets disponibles sur ctan.org. (CTAN est le Comprehensive TeX Archive Network.) CTAN est également la base Web du groupe international TUG : TeX Users Group. J' | ||
| + | |||
| + | J'ai parcouru la liste alphabétique des sujets jusqu' | ||
| + | |||
| + | \usepackage[options]{fancyhdr} | ||
| + | |||
| + | \pagestyle{fancy} | ||
| + | |||
| + | Il existe de nombreuses commandes qui font partie du paquet fancyhdr ; elles peuvent être saisies dans le préambule du document, avant la commande begin{document}. Certaines peuvent également être saisies dans le corps du document. Lisez et utilisez les exemples de la documentation. Voici le code de la première image (page suivante, en haut à gauche). | ||
| + | |||
| + | \usepackage{fancyhdr} | ||
| + | |||
| + | \pagestyle{fancy} | ||
| + | |||
| + | \usepackage{lipsum} % insère des paragraphes de texte sans signification | ||
| + | |||
| + | \fancyhead[L]{En-tête gauche} % Majuscules ou minuscules et texte pour l' | ||
| + | |||
| + | \fancyhead[R]{En-tête droit} | ||
| + | |||
| + | \pagenumbering{arabic} % quatre autres options disponibles | ||
| + | |||
| + | \fancyfoot[c]{page \thepage} % thepage désigne la page actuelle | ||
| \begin{document} | \begin{document} | ||
| Ligne 31: | Ligne 64: | ||
| \lipsum[1-4] | \lipsum[1-4] | ||
| - | The next package I will take a look at is fancypar, offering five predefined decorative styles for text paragraphs according to the documentation. Again, I encourage you to read the documentation. (This manual is only 19 pages, with lots of example code and images of results.) Here is the code for the second graphic (top right): | + | |
| + | **The next package I will take a look at is fancypar, offering five predefined decorative styles for text paragraphs according to the documentation. Again, I encourage you to read the documentation. (This manual is only 19 pages, with lots of example code and images of results.) Here is the code for the second graphic (top right): | ||
| \usepackage[x11names]{xcolor} | \usepackage[x11names]{xcolor} | ||
| Ligne 45: | Ligne 79: | ||
| \NotebookPar{This time we will play ...} | \NotebookPar{This time we will play ...} | ||
| - | I dropped the paragraph text out of the code because it is just sample text. You can see the results in an image. This package allows for great customization. Be warned, if you use a color name that is not recognized, the color defaults to black. If you want more (much more) information about supported color schemes and color models, read the documentation for the xcolor package. | + | I dropped the paragraph text out of the code because it is just sample text. You can see the results in an image. This package allows for great customization. Be warned, if you use a color name that is not recognized, the color defaults to black. If you want more (much more) information about supported color schemes and color models, read the documentation for the xcolor package.** | 
| - | Next, I will work with a package that could be useful for people who need assistance with layout and positioning. It is called fgruler (foreground ruler), and it puts a rule on a selected page, or all pages, at a fixed position. It can be loaded either with | + | Le prochain paquet que je vais examiner est fancypar, qui propose, d' | 
| + | |||
| + | \usepackage[x11names]{xcolor} | ||
| + | |||
| + | \usepackage[linecolor=Chocolate1!100!white!80]{fancypar} | ||
| + | |||
| + | \usepackage{lipsum} | ||
| + | |||
| + | \begin{document} | ||
| + | \NotebookPar{This time we will play ...} | ||
| + | \fancyparsetup{spiral=false, | ||
| + | |||
| + | \NotebookPar{This time we will play ...} | ||
| + | |||
| + | J'ai supprimé le texte du paragraphe du code car il s'agit simplement d'un exemple de texte. Vous pouvez voir les résultats dans l' | ||
| + | |||
| + | |||
| + | **Next, I will work with a package that could be useful for people who need assistance with layout and positioning. It is called fgruler (foreground ruler), and it puts a rule on a selected page, or all pages, at a fixed position. It can be loaded either with | ||
| usepackage[options]{fgruler} | usepackage[options]{fgruler} | ||
| Ligne 65: | Ligne 116: | ||
| There are ten other option=value pairs available. Most options have several values attached to them. | There are ten other option=value pairs available. Most options have several values attached to them. | ||
| - | Fgruler can also be used to insert a ruler into the text with the \ruler command with its three options as shown in the code below. Again, there are a significant number of possibilities for the position, direction, length, color and style of the inserted ruler. | + | Fgruler can also be used to insert a ruler into the text with the \ruler command with its three options as shown in the code below. Again, there are a significant number of possibilities for the position, direction, length, color and style of the inserted ruler.** | 
| - | The documentation is among the best I have read so far for a Latex package. There are lots of snippets of code and the corresponding examples. There are no pages in the documentation which describe the various behind-the-scenes commands used to make this package. Instead, there are seven pages of examples and illustrations followed by 28 individual pages with 28 sets of commands and results. | + | Ensuite, je vais travailler avec un paquet qui pourrait être utile pour les personnes qui ont besoin d'aide pour la mise en page et le positionnement. Il s' | 
| + | |||
| + | usepackage[options]{fgruler} | ||
| + | |||
| + | ou | ||
| + | |||
| + | \usepackage{fgruler} | ||
| + | |||
| + | \setfgruler{package options} | ||
| + | |||
| + | La commande setfgruler peut également être utilisée dans le corps d'un document. Les options incluent | ||
| + | |||
| + | unit=cm (règle métrique – par défaut) ou unit=in (pouces) | ||
| + | |||
| + | type=upperleft, | ||
| + | |||
| + | Dix autres paires option=valeur sont disponibles. La plupart des options ont plusieurs valeurs qui leur sont associées. | ||
| + | |||
| + | Fgruler peut également être utilisé pour insérer une règle dans le texte avec la commande \ruler avec ses trois options comme indiqué dans le code ci-après (page suivante). Là encore, il existe un nombre important de possibilités pour la position, la direction, la longueur, la couleur et le style de la règle insérée. | ||
| + | |||
| + | |||
| + | **The documentation is among the best I have read so far for a Latex package. There are lots of snippets of code and the corresponding examples. There are no pages in the documentation which describe the various behind-the-scenes commands used to make this package. Instead, there are seven pages of examples and illustrations followed by 28 individual pages with 28 sets of commands and results. | ||
| Here is the code. Again I deleted most of the text to save space. (shown above) | Here is the code. Again I deleted most of the text to save space. (shown above) | ||
| Ligne 82: | Ligne 154: | ||
| \ruler[cm]{rightdown}{10cm} %Inserts ruler in text 10cm long. | \ruler[cm]{rightdown}{10cm} %Inserts ruler in text 10cm long. | ||
| - | I spent a short time with the fncychap package. It has seven predefined styles for chapter level headings. In addition, the user can also modify the existing styles or generate new ones with the information available in the documentation. What is not mentioned but which should be obvious is the chapter level heading is available in the document class “book”, not in document class “article”. The book document class defaults to two-sided printing which brings its own benefits and costs. | + | I spent a short time with the fncychap package. It has seven predefined styles for chapter level headings. In addition, the user can also modify the existing styles or generate new ones with the information available in the documentation. What is not mentioned but which should be obvious is the chapter level heading is available in the document class “book”, not in document class “article”. The book document class defaults to two-sided printing which brings its own benefits and costs.** | 
| - | I wanted to generate labels using Latex. The flabels package initially was attractive. However it is designed to generate a specific label for the spines of A4-sized binders. So I looked for some other package to demonstrate. Since I worked as a teacher and continue to do volunteer teaching, I chose the fancyhandout package. | + | La documentation est parmi les meilleures que j'ai lues jusqu' | 
| + | |||
| + | Voici le code. Là encore, j'ai supprimé la majeure partie du texte pour gagner de la place. (illustré ci-dessus) | ||
| + | |||
| + | \usepackage[x11names]{xcolor} %Obligatoire si vous souhaitez des couleurs autres que le noir | ||
| + | |||
| + | \usepackage{fgruler} | ||
| + | |||
| + | \begin{document} | ||
| + | \setfgruler{unit=cm, | ||
| + | |||
| + | Cette fois-ci, nous allons jouer avec... | ||
| + | |||
| + | \ruler[cm]{rightdown}{10cm} %Insère une règle dans le texte sur une longueur de 10 cm. | ||
| + | |||
| + | J'ai passé un peu de temps avec le paquet fncychap. Il dispose de sept styles prédéfinis pour les titres au niveau des chapitres. De plus, l' | ||
| + | |||
| + | |||
| + | **I wanted to generate labels using Latex. The flabels package initially was attractive. However it is designed to generate a specific label for the spines of A4-sized binders. So I looked for some other package to demonstrate. Since I worked as a teacher and continue to do volunteer teaching, I chose the fancyhandout package. | ||
| Fancyhandout makes a new class of document. It uses three levels of headings, section, subsection and subsubsection, | Fancyhandout makes a new class of document. It uses three levels of headings, section, subsection and subsubsection, | ||
| Ligne 90: | Ligne 180: | ||
| Here (previous page) is the code that generated the sample [above]. It is longer than I usually show, I hope it will be helpful. I can already anticipate using this package in my volunteer teaching. | Here (previous page) is the code that generated the sample [above]. It is longer than I usually show, I hope it will be helpful. I can already anticipate using this package in my volunteer teaching. | ||
| - | Because my system has a limited number of F packages, I have decided to look at how to install new packages to an existing Latex system in the next issue. Hope you can join me for that important topic. | + | Because my system has a limited number of F packages, I have decided to look at how to install new packages to an existing Latex system in the next issue. Hope you can join me for that important topic.** | 
| + | |||
| + | Je voulais générer des étiquettes en utilisant LaTeX. Le paquet flabels était initialement intéressant. Cependant, il est conçu pour générer une étiquette spécifique pour les dos de classeurs de format A4. J'ai donc cherché un autre paquet à démontrer. Comme je travaille comme enseignant et que je continue à faire de l' | ||
| + | |||
| + | Fancyhandout crée une nouvelle classe de document. Il utilise trois niveaux de titres, section, sous-section et sous-sous-section, | ||
| + | |||
| + | Voici (page précédente, | ||
| + | |||
| + | Comme mon système dispose d'un nombre limité de paquets F, j'ai décidé d' | ||
issue214/latex.1740899468.txt.gz · Dernière modification : 2025/03/02 08:11 de d52fr
                
                