issue207:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue207:latex [2024/07/27 10:23] – créée auntiee | issue207:latex [2024/08/06 17:43] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Welcome back to another adventure with Latex. This time we are going to explore the geometry package. Geometry is a page layout package. The user sets some dimensions of objects on each page of the document and the package can calculate the remaining values. Values are specified using key/value pairs which is advantageous for both clarity and uniformity with other packages. In most cases, there are a number of different sets of settings which can produce the same result. For example, setting the paper size, margin ratio and the left margin will determine the right margin; or setting the paper size, margin ratio and right margin will determine the left margin. Any key setting which violates one (or more) of the others will generate a warning and geometry will ignore one of the key settings. | + | **Welcome back to another adventure with Latex. This time we are going to explore the geometry package. Geometry is a page layout package. The user sets some dimensions of objects on each page of the document and the package can calculate the remaining values. Values are specified using key/value pairs which is advantageous for both clarity and uniformity with other packages. In most cases, there are a number of different sets of settings which can produce the same result. For example, setting the paper size, margin ratio and the left margin will determine the right margin; or setting the paper size, margin ratio and right margin will determine the left margin. Any key setting which violates one (or more) of the others will generate a warning and geometry will ignore one of the key settings. |
- | Before we continue, a few words about paper sizes, which are the controlling factors in page design. Most countries in the world use A4 paper as the default paper size. Canada, the Philippines, | + | Before we continue, a few words about paper sizes, which are the controlling factors in page design. Most countries in the world use A4 paper as the default paper size. Canada, the Philippines, |
- | The geometry package also accepts several other less frequently used paper sizes: b0paper – b6paper, c0paper – c6paper, b0j – b6j (Japanese sizes), as well as letterpaper (216mm x 279mm), legalpaper (216mm x 356mm), and executivepaper (184mm x 267mm) to accommodate North American standards. It is also possible to set paperwidth and paperheight to specific dimensions if necessary or desirable. | + | Bienvenue dans cette nouvelle aventure avec LaTeX. Cette fois-ci, nous allons explorer le paquet geometry. Geometry est un paquet de mise en page. L' |
+ | |||
+ | Avant de poursuivre, quelques mots sur les formats de papier, qui sont les facteurs déterminants de la conception des pages. La plupart des pays du monde utilisent le format A4 comme format de papier par défaut. Le Canada, les Philippines et les États-Unis utilisent un format de papier par défaut appelé « letter ». Le format A4 fait partie d'une série de formats de papier reconnus par l'ISO. A0 est le plus grand. Une feuille A0 mesure un mètre carré (841 mm x 1189 mm, arrondi au mm le plus proche). Chaque format de feuille correspond exactement à la moitié du format précédent, | ||
+ | |||
+ | |||
+ | **The geometry package also accepts several other less frequently used paper sizes: b0paper – b6paper, c0paper – c6paper, b0j – b6j (Japanese sizes), as well as letterpaper (216mm x 279mm), legalpaper (216mm x 356mm), and executivepaper (184mm x 267mm) to accommodate North American standards. It is also possible to set paperwidth and paperheight to specific dimensions if necessary or desirable. | ||
Geometry supports either portrait (short dimension horizontal), | Geometry supports either portrait (short dimension horizontal), | ||
Ligne 9: | Ligne 14: | ||
Geometry supports two-sided printing with the twoside Boolean key. If a document is to be printed two-sided, it may require extra space for the inner margin to allow for the space required for binding. This key is bindingoffset – which adds the specified amount to the inner margin. | Geometry supports two-sided printing with the twoside Boolean key. If a document is to be printed two-sided, it may require extra space for the inner margin to allow for the space required for binding. This key is bindingoffset – which adds the specified amount to the inner margin. | ||
- | I have set up some example pages to show a small part of the flexibility of the geometry package. Example one is a fairly standard page: [paper=letterpaper, | + | I have set up some example pages to show a small part of the flexibility of the geometry package. Example one is a fairly standard page: [paper=letterpaper, |
- | One magazine I subscribe to has a final paper size of 19cm x 26cm. It has two columns of text printed on both sides of the page. The outside margin is 2.5cm, the inside margin is also 2.5cm including the space required for binding. The top margin is 2.3cm and the bottom margin is 3.3cm. The footer appears 2.5cm below the text block. Geometry does not control what happens inside the text block, so setting for two columns and setting the space between columns is in the control of another package. Settings for this magazine could be: Example 2 settings: [paperheight=26cm, | + | Le paquet geometry accepte également plusieurs autres formats de papier moins fréquemment utilisés : papier b0 - papier b6, papier c0 - papier c6, b0j - b6j (formats japonais), ainsi que letterpaper (216 mm x 279 mm), legalpaper (216 mm x 356 mm) et executivepaper (184 mm x 267 mm) pour répondre aux normes nord-américaines. Il est également possible de définir des dimensions spécifiques pour la largeur et la hauteur du papier, si cela est nécessaire ou souhaitable. |
+ | |||
+ | Geometry prend en charge l' | ||
+ | |||
+ | Geometry supporte l' | ||
+ | |||
+ | J'ai créé quelques pages d' | ||
+ | |||
+ | |||
+ | **One magazine I subscribe to has a final paper size of 19cm x 26cm. It has two columns of text printed on both sides of the page. The outside margin is 2.5cm, the inside margin is also 2.5cm including the space required for binding. The top margin is 2.3cm and the bottom margin is 3.3cm. The footer appears 2.5cm below the text block. Geometry does not control what happens inside the text block, so setting for two columns and setting the space between columns is in the control of another package. Settings for this magazine could be: Example 2 settings: [paperheight=26cm, | ||
This combination of settings is only one way to specify the layout for this magazine. The page designer could also work from letter size paper or A4 paper, and use the four margins to control the size of the text block. There are often two or more ways to use the many settings available in the geometry package to specify a layout. | This combination of settings is only one way to specify the layout for this magazine. The page designer could also work from letter size paper or A4 paper, and use the four margins to control the size of the text block. There are often two or more ways to use the many settings available in the geometry package to specify a layout. | ||
- | Remember the goal of Latex / Tex is to generate a standard PDF file which can be read on screen, or printed. When doing page design, it is important to know what the readers expect. It may be desirable for some design elements to be different if the document is to be read on screen compared to being printed. | + | Remember the goal of LaTeX / Tex is to generate a standard PDF file which can be read on screen, or printed. When doing page design, it is important to know what the readers expect. It may be desirable for some design elements to be different if the document is to be read on screen compared to being printed.** |
+ | |||
+ | Un magazine auquel je suis abonné a un format final de 19 cm x 26 cm. Il comporte deux colonnes de texte imprimées sur les deux côtés de la page. La marge extérieure est de 2,5 cm, la marge intérieure est également de 2,5 cm, y compris l' | ||
+ | Paramètres du 2e exemple : [paperheight=26cm, | ||
+ | |||
+ | Cette combinaison de paramètres n'est qu'une façon de spécifier la mise en page de ce magazine. Le concepteur de pages peut également travailler sur du papier de format letter ou A4 et utiliser les quatre marges pour contrôler la taille du bloc de texte. Il y a souvent deux façons ou plus d' | ||
+ | |||
+ | N' | ||
- | Changing geometry mid document (1) | + | **Changing geometry mid document (1) |
\newgeometry{options} changes the page layout mid-document. \newgeometry is almost similar to \geometry except that \newgeometry disables all the options specified by \usepackage and \geometry in the preamble and skips paper size-related options. | \newgeometry{options} changes the page layout mid-document. \newgeometry is almost similar to \geometry except that \newgeometry disables all the options specified by \usepackage and \geometry in the preamble and skips paper size-related options. | ||
Ligne 24: | Ligne 46: | ||
\savegeometry{name} saves the page dimensions as ‘name’ where you put this command. \loadgeometry{name} loads the page dimensions saved as ’name’. | \savegeometry{name} saves the page dimensions as ‘name’ where you put this command. \loadgeometry{name} loads the page dimensions saved as ’name’. | ||
- | Types of options for geometry are: Boolean (true – false), one option, (key=value) two option key={value1, | + | Types of options for geometry are: Boolean (true – false), one option, (key=value) two option key={value1, |
- | Options available | + | Changement de géométrie en milieu de document (1) |
+ | |||
+ | \newgeometry{options} modifie la mise en page en cours de document. \newgeometry est presque similaire à \geometry sauf que \newgeometry désactive toutes les options spécifiées par \usepackage et \geometry dans le préambule et ignore les options liées au format du papier. | ||
+ | |||
+ | \restoregeometry restaure la mise en page spécifiée dans le préambule. Cette commande n'a pas d' | ||
+ | |||
+ | \savegeometry{name} enregistre les dimensions de la page sous ' | ||
+ | |||
+ | Les types d' | ||
+ | |||
+ | |||
+ | **Options available | ||
There are five pages of options in five different categories in the documentation for the geometry package. The ones in this article are only a few of the common ones. | There are five pages of options in five different categories in the documentation for the geometry package. The ones in this article are only a few of the common ones. | ||
Ligne 32: | Ligne 65: | ||
The papersize category includes all of the sizes I discussed at the beginning of this article plus others. Paperwidth and paperheight can be given using the papersize parameter with two values: width, height. The papersize category includes portrait, landscape, and screen. Screen is a special size for presentations: | The papersize category includes all of the sizes I discussed at the beginning of this article plus others. Paperwidth and paperheight can be given using the papersize parameter with two values: width, height. The papersize category includes portrait, landscape, and screen. Screen is a special size for presentations: | ||
- | The layout size group has a small number of options useful to set layout sizes which are not dependent on paper size. This is another set of options for adjustments for the magazine whose final size is smaller than standard letter paper. | + | The layout size group has a small number of options useful to set layout sizes which are not dependent on paper size. This is another set of options for adjustments for the magazine whose final size is smaller than standard letter paper.** |
- | Next is a long list of parameters in the body size group. (Body refers to the text body, the container for the contents of the article, book, journal, etc.) This group is followed by margin size. I hope it is obvious that body size and margin size are dependent on each other. It is often possible to get the desired body size using appropriate margin sizes and vice versa. | + | **Next is a long list of parameters in the body size group. (Body refers to the text body, the container for the contents of the article, book, journal, etc.) This group is followed by margin size. I hope it is obvious that body size and margin size are dependent on each other. It is often possible to get the desired body size using appropriate margin sizes and vice versa. |
- | Finally, there is a group called native size. These options can override the defaults built into Latex. For example, the default spaces allocated for headers and footers can be eliminated. For another example, look at either of the two images. There is space set aside in the right margin for margin notes (or outside margin in two-sided layouts). Using the reversemarginpar instruction puts that space in the left margin (or inside margin in two-sided layouts). | + | Finally, there is a group called native size. These options can override the defaults built into Latex. For example, the default spaces allocated for headers and footers can be eliminated. For another example, look at either of the two images. There is space set aside in the right margin for margin notes (or outside margin in two-sided layouts). Using the reversemarginpar instruction puts that space in the left margin (or inside margin in two-sided layouts).** |
- | Changing geometry mid-document (2) | + | Options disponibles |
+ | |||
+ | Il y a cinq pages d' | ||
+ | |||
+ | La catégorie papersize (format de papier) comprend tous les formats dont j'ai parlé au début de cet article, ainsi que d' | ||
+ | |||
+ | Le groupe layout size (taille de la mise en page) comporte un petit nombre d' | ||
+ | |||
+ | Vient ensuite une longue liste de paramètres dans le groupe « body size » (taille du corps). (Le corps fait référence au corps du texte, qui contient le contenu de l' | ||
+ | |||
+ | Enfin, il existe un groupe appelé « native size » (taille native). Ces options peuvent remplacer les valeurs par défaut intégrées dans LaTeX. Par exemple, les espaces par défaut alloués aux en-têtes et aux pieds de page peuvent être supprimés. Pour un autre exemple, regardez l'une des deux images. Un espace est réservé dans la marge droite pour les notes de marge (ou la marge extérieure dans les mises en page recto-verso). L' | ||
+ | |||
+ | |||
+ | **Changing geometry mid-document (2) | ||
The newgeometry command allows changing all options in the geometry package except page orientation (portrait, landscape) and paper size: | The newgeometry command allows changing all options in the geometry package except page orientation (portrait, landscape) and paper size: | ||
Ligne 47: | Ligne 93: | ||
• Both \newgeometry and \restoregeometry issue \newpage commands before changing the page layout. | • Both \newgeometry and \restoregeometry issue \newpage commands before changing the page layout. | ||
- | As mentioned above, it is also possible to build a collection, a library of geometry “styles” using the \savegeometry{name}. For example, assume you regularly published PDF files using two or more different page layouts. Assume they are called L1 and L2. Start the document in the usual way and include the geometry package. After the \begin{document} command, issue the appropriate \loadgeometry{L1} command for an L1 layout. No need to remember what the various layout dimensions are. This ability would also allow for quick and easy use of different page layouts for pages with illustrations and pages without illustrations in the same document, for example. | + | As mentioned above, it is also possible to build a collection, a library of geometry “styles” using the \savegeometry{name}. For example, assume you regularly published PDF files using two or more different page layouts. Assume they are called L1 and L2. Start the document in the usual way and include the geometry package. After the \begin{document} command, issue the appropriate \loadgeometry{L1} command for an L1 layout. No need to remember what the various layout dimensions are. This ability would also allow for quick and easy use of different page layouts for pages with illustrations and pages without illustrations in the same document, for example.** |
- | Documentation | + | Changement de géométrie en cours de document (2) |
+ | |||
+ | La commande newgeometry permet de modifier toutes les options de geometry, à l' | ||
+ | ••Si elle est utilisée, elle doit apparaître après la commande \begin{document}. | ||
+ | ••Elle peut modifier un ou plusieurs des paramètres définis à l' | ||
+ | ••La commande newgeometry peut être émise plusieurs fois dans un document. | ||
+ | ••Pour revenir aux paramètres d' | ||
+ | ••Les commandes \newgeometry et \restoregeometry émettent toutes deux la commande \newpage avant de modifier la mise en page. | ||
+ | |||
+ | Comme indiqué ci-dessus, il est également possible de créer une collection, une bibliothèque de « styles » pour geometry à l'aide de la commande \savegeometry{name}. Par exemple, supposons que vous publiez régulièrement des fichiers PDF en utilisant deux ou plusieurs mises en page différentes. Supposons qu' | ||
+ | |||
+ | |||
+ | **Documentation | ||
I strongly urge you to read through the documentation for the geometry package (as I have done for all packages I have discussed). The first 17 pages contain all of the information most users will need. The rest of the 42 pages gives the code and explanations. Pages 16-17 contain eleven annotated examples from simple to complex. There is probably at least one of them that can be the base for the page layout you wish to use. | I strongly urge you to read through the documentation for the geometry package (as I have done for all packages I have discussed). The first 17 pages contain all of the information most users will need. The rest of the 42 pages gives the code and explanations. Pages 16-17 contain eleven annotated examples from simple to complex. There is probably at least one of them that can be the base for the page layout you wish to use. | ||
Ligne 56: | Ligne 114: | ||
To generate views of page layouts like those in this article, the following code is very useful. Place it in the preamble, i.e. before the \begin{document} instruction. This needs to be used with each command on a separate line; otherwise any command immediately after a percent sign will be treated as a comment – which will cause errors. | To generate views of page layouts like those in this article, the following code is very useful. Place it in the preamble, i.e. before the \begin{document} instruction. This needs to be used with each command on a separate line; otherwise any command immediately after a percent sign will be treated as a comment – which will cause errors. | ||
+ | |||
+ | \usepackage{layouts} | ||
+ | \newcommand\showpage{% | ||
+ | \setlayoutscale{0.5}% | ||
+ | \setlabelfont{\large}% | ||
+ | \printheadingsfalse | ||
+ | \printparametersfalse | ||
+ | \currentpage\pagedesign}** | ||
+ | |||
+ | Documentation | ||
+ | |||
+ | Je vous recommande vivement de lire la documentation relative au paquet geometry (comme je l'ai fait pour tous les logiciels dont j'ai parlé). Les 17 premières pages contiennent toutes les informations dont la plupart des utilisateurs auront besoin. Le reste des 42 pages présente le code et les explications. Les pages 16 et 17 contiennent onze exemples annotés, du plus simple au plus complexe. Il y en a probablement au moins un qui peut servir de base à la mise en page que vous souhaitez utiliser. | ||
+ | |||
+ | Remarque particulière | ||
+ | |||
+ | Pour générer des vues de mises en page comme celles de cet article, le code suivant est très utile. Placez-le dans le préambule, c' | ||
\usepackage{layouts} | \usepackage{layouts} | ||
Ligne 64: | Ligne 138: | ||
\printparametersfalse | \printparametersfalse | ||
\currentpage\pagedesign} | \currentpage\pagedesign} | ||
+ | |||
+ | |||
+ | **Put any parameters for the geometry package below these layouts package commands. In the body of the document, use the \showpage command to generate the view of the layout. If you set the layout scale to 1, you will get an image that will be the finished size of the layout design. It can be saved as a PDF file and printed if desired. However the image will be shown or printed inside the margins of a standard page, and so will probably flow past the existing right and bottom margins. | ||
+ | |||
+ | Thanks again for reading and following along in my adventures with Latex. So far, it has been not only interesting but also educational. I have learned a lot and I hope you have too. Talk to you again in the next issue.** | ||
- | Put any parameters for the geometry | + | Placez tous les paramètres du paquet |
- | Thanks again for reading and following along in my adventures with Latex. So far, it has been not only interesting but also educational. I have learned | + | Merci encore d' |
issue207/latex.1722068629.txt.gz · Dernière modification : 2024/07/27 10:23 de auntiee