issue187:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue187:latex [2022/11/27 08:41] – créée auntiee | issue187:latex [2022/11/29 18:39] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | This time, in the tour of the many features of Tex / Latex, I am going to explore headers and footers. It is important you are clear what these two words mean. People often confuse headers with headings and confuse footers with footnotes: | + | **This time, in the tour of the many features of Tex / Latex, I am going to explore headers and footers. It is important you are clear what these two words mean. People often confuse headers with headings and confuse footers with footnotes: |
Headers are small bits of text that appear at the top, the head, of each page. | Headers are small bits of text that appear at the top, the head, of each page. | ||
Ligne 7: | Ligne 7: | ||
Headers are often a shortened form of the article title or the chapter title in a book. Sometimes headers contain page numbering. More often, footers contain page numbering. In magazines and journals, the title of the publication and the publication date usually appear in either the header or the footer. | Headers are often a shortened form of the article title or the chapter title in a book. Sometimes headers contain page numbering. More often, footers contain page numbering. In magazines and journals, the title of the publication and the publication date usually appear in either the header or the footer. | ||
- | Headers and footers contain information that is usually independent of the body, the text of the document. For example, in a magazine, like Full Circle Magazine, the title of the magazine and the date of publication is the same no matter what the article is about. | + | Headers and footers contain information that is usually independent of the body, the text of the document. For example, in a magazine, like Full Circle Magazine, the title of the magazine and the date of publication is the same no matter what the article is about.** |
- | Headings are short bits of text that are almost always set in larger sized type than the rest of the document. The text of a heading should be related to the body text that follows it. Footnotes used to be used for bibliographic references. That practice has been replaced in many publications by the use of endnotes or in-text citations. (Millions of students around the world are thankful for this change.) Footnotes are directly related to the body of the document, either pointing to external sources or describing alternative explanations to something in the body. We will look at footnotes and endnotes another time. | + | Cette fois-ci, dans notre tour des nombreuses fonctionnalités de TeX/LaTeX, je vais explorer les en-têtes et les pieds de page. Il est important que vous sachiez clairement ce que ces deux mots signifient. Les gens confondent souvent les en-têtes avec les titres et les pieds de page avec les notes de bas de page. |
- | Headers and footers are published outside the ordinary margins of the page. For example, in LibreOffice I set top and bottom margins of my documents to 2.5cm. If I use a header and/or footer, it will appear within that 2.5cm of space either at the top or bottom of the page. A piece of paper that is standard North American letter size is 27.94cm on its long dimension and 21.59cm on its short dimension. If I print in Portrait mode my text will appear in the 22.94cm in the middle of each page, with 2.5cm reserved both at the top and the bottom of each sheet. If I print in Landscape mode the same 2.5cm is reserved top and bottom so the text will appear in the central 16.59cm. | + | Les en-têtes sont de petits bouts de texte qui apparaissent en haut, à la tête, de chaque |
- | That is in LibreOffice. What about in Tex/Latex documents? The space allocated to headers and footers in Latex documents is determined when the document type is set. Each document type has specific formatting which includes margins, font size, and many other settings. Those settings can be modified using various packages as we have seen before in this series. Those settings can also be modified by editing the settings directly in the default packages for articles, books, etc. Until you get a lot of experience with Latex, it is best to use one or more of the existing packages to get your documents to look how you want them. Remember many journals and other publications have developed their own "style sheets" | + | Les notes de bas de page sont de petits bouts de texte qui apparaissent en bas de chaque page. |
+ | |||
+ | Les en-têtes sont souvent une forme abrégée du titre de l' | ||
+ | |||
+ | Les en-têtes et les pieds de page contiennent des informations qui sont généralement indépendantes du corps et du texte du document. Par exemple, dans un magazine, comme Full Circle Magazine, le titre du magazine et la date de publication sont les mêmes, quel que soit le sujet de l' | ||
+ | |||
+ | |||
+ | **Headings are short bits of text that are almost always set in larger sized type than the rest of the document. The text of a heading should be related to the body text that follows it. Footnotes used to be used for bibliographic references. That practice has been replaced in many publications by the use of endnotes or in-text citations. (Millions of students around the world are thankful for this change.) Footnotes are directly related to the body of the document, either pointing to external sources or describing alternative explanations to something in the body. We will look at footnotes and endnotes another time. | ||
+ | |||
+ | Headers and footers are published outside the ordinary margins of the page. For example, in LibreOffice I set top and bottom margins of my documents to 2.5cm. If I use a header and/or footer, it will appear within that 2.5cm of space either at the top or bottom of the page. A piece of paper that is standard North American letter size is 27.94cm on its long dimension and 21.59cm on its short dimension. If I print in Portrait mode my text will appear in the 22.94cm in the middle of each page, with 2.5cm reserved both at the top and the bottom of each sheet. If I print in Landscape mode the same 2.5cm is reserved top and bottom so the text will appear in the central 16.59cm.** | ||
+ | |||
+ | Les en-têtes sont de courts morceaux de texte qui sont presque toujours présentés en caractères plus grands que le reste du document. Le texte d'un en-tête doit être lié au corps du texte qui le suit. Les notes de bas de page étaient autrefois utilisées pour les références bibliographiques. Cette pratique a été remplacée dans de nombreuses publications par l' | ||
+ | |||
+ | Les en-têtes et les pieds de page sont publiés en dehors des marges ordinaires de la page. Par exemple, dans LibreOffice, | ||
+ | |||
+ | |||
+ | **That is in LibreOffice. What about in Tex/Latex documents? The space allocated to headers and footers in Latex documents is determined when the document type is set. Each document type has specific formatting which includes margins, font size, and many other settings. Those settings can be modified using various packages as we have seen before in this series. Those settings can also be modified by editing the settings directly in the default packages for articles, books, etc. Until you get a lot of experience with Latex, it is best to use one or more of the existing packages to get your documents to look how you want them. Remember many journals and other publications have developed their own "style sheets" | ||
Before we start looking at the possibilities of headers and footers, there are two additions to be made to a document’s preamble. fancyhdr must be included and the instruction pagestyle{fancy} must also be present. So the preamble should look something like this: | Before we start looking at the possibilities of headers and footers, there are two additions to be made to a document’s preamble. fancyhdr must be included and the instruction pagestyle{fancy} must also be present. So the preamble should look something like this: | ||
+ | |||
+ | \documentclass[letterpaper, | ||
+ | |||
+ | %preamble | ||
+ | |||
+ | \title{FCM 187 - Headers and Footers} | ||
+ | |||
+ | \date{2022 November} | ||
+ | |||
+ | \usepackage{graphicx, | ||
+ | |||
+ | \pagestyle{fancy}** | ||
+ | |||
+ | C'est le cas dans LibreOffice. Qu'en est-il dans les documents TeX/LaTeX ? L' | ||
+ | |||
+ | Avant de commencer à examiner les possibilités des en-têtes et des pieds de page, il y a deux ajouts à faire au préambule d'un document. fancyhdr doit être inclus et l' | ||
\documentclass[letterpaper, | \documentclass[letterpaper, | ||
Ligne 29: | Ligne 61: | ||
\pagestyle{fancy} | \pagestyle{fancy} | ||
- | Important Warning: During my testing for this article I discovered that the instructions in the documentation did not always give the results described in the documentation. Test various options before using this package in your documents, particularly your organization’s documents. | + | |
+ | **Important Warning: During my testing for this article I discovered that the instructions in the documentation did not always give the results described in the documentation. Test various options before using this package in your documents, particularly your organization’s documents. | ||
As usual with Latex/Tex, we use a command starting with a backslash: fancyhead or fancyfoot or fancyhf followed by some options. The full syntax is: | As usual with Latex/Tex, we use a command starting with a backslash: fancyhead or fancyfoot or fancyhf followed by some options. The full syntax is: | ||
Ligne 41: | Ligne 74: | ||
[positions] as you probably guess, refers to the location of the header or footer. The {header} area is for the text of the header or footer. Headers and footers can be aligned left, centre or right, and can appear on even pages or odd pages. Therefore the [places] option area will have three letters: E(ven) or O(dd), L(eft), C(centre), R(ight) and H(eader) or F(ooter). A missing letter means all possibilities are accepted, except fancyhead is H by default and fancyfoot is F by default. To have a header centred on even pages, the simplest code would be \fancyhead[EC]. To have a footer on the left on all pages is simply \fancyfoot[L]. | [positions] as you probably guess, refers to the location of the header or footer. The {header} area is for the text of the header or footer. Headers and footers can be aligned left, centre or right, and can appear on even pages or odd pages. Therefore the [places] option area will have three letters: E(ven) or O(dd), L(eft), C(centre), R(ight) and H(eader) or F(ooter). A missing letter means all possibilities are accepted, except fancyhead is H by default and fancyfoot is F by default. To have a header centred on even pages, the simplest code would be \fancyhead[EC]. To have a footer on the left on all pages is simply \fancyfoot[L]. | ||
- | Upper or lower case letters can be used. The order of the letters does not seem to be significant. | + | Upper or lower case letters can be used. The order of the letters does not seem to be significant.** |
- | I discovered adding commas between the position options changes the locations of headers and footers. For example \fancyhead[OR]{FCM 187} puts FCM 187 as header on the right side of every page (except page 1). \fancyhead[O, | + | Avertissement important : Lors de mes tests pour cet article, j'ai découvert que les instructions de la documentation ne donnaient pas toujours les résultats décrits dans la documentation. Testez diverses options avant d' |
+ | |||
+ | Comme d' | ||
+ | |||
+ | \fancyhead[positions]{header} | ||
+ | |||
+ | \fancyfoot[positions]{footer} | ||
+ | |||
+ | \fancyhf[positions]{output} | ||
+ | |||
+ | Comme vous l'avez probablement deviné, [positions] fait référence à l' | ||
+ | |||
+ | Les lettres majuscules ou minuscules peuvent être utilisées. L' | ||
+ | |||
+ | |||
+ | **I discovered adding commas between the position options changes the locations of headers and footers. For example \fancyhead[OR]{FCM 187} puts FCM 187 as header on the right side of every page (except page 1). \fancyhead[O, | ||
On the other hand [lo] puts a header on the left side of odd numbered pages which is what the manual says. [l,o] puts the same header in all three positions. | On the other hand [lo] puts a header on the left side of odd numbered pages which is what the manual says. [l,o] puts the same header in all three positions. | ||
Ligne 49: | Ligne 97: | ||
All of this testing was done with the \documentclass{article}. When I switched to \documentclass{book}, | All of this testing was done with the \documentclass{article}. When I switched to \documentclass{book}, | ||
- | There is a 39-page manual that comes with the fancyheader macro set. I suggest you read it carefully and experiment if you wish to explore other possibilities. | + | There is a 39-page manual that comes with the fancyheader macro set. I suggest you read it carefully and experiment if you wish to explore other possibilities.** |
- | There are many other commands available that can be used for various options with headers and footers. \fancyheadoffset, | + | J'ai découvert que l' |
+ | |||
+ | En revanche, [lo] place un en-tête sur le côté gauche des pages impaires, ce qui correspond à ce que dit le manuel. Enfin, [l,o] place le même en-tête dans les trois positions. | ||
+ | |||
+ | Tous ces tests ont été effectués avec la classe \documentclass{article}. Lorsque je suis passé à \documentclass{book}, | ||
+ | |||
+ | Un manuel de 39 pages est fourni avec le jeu de macros fancyheader. Je vous suggère de le lire attentivement et de faire des tests si vous souhaitez explorer d' | ||
+ | |||
+ | |||
+ | **There are many other commands available that can be used for various options with headers and footers. \fancyheadoffset, | ||
There is a default headrulewidth built into the style sheet for books and articles (0.4pt). The headrulewidth and footrulewidth have to be reset using the command | There is a default headrulewidth built into the style sheet for books and articles (0.4pt). The headrulewidth and footrulewidth have to be reset using the command | ||
Ligne 61: | Ligne 118: | ||
| | ||
- | using whatever width (thickness) is desirable. | + | using whatever width (thickness) is desirable.** |
+ | |||
+ | De nombreuses autres commandes sont disponibles et peuvent être utilisées pour diverses options avec les en-têtes et les pieds de page. \fancyheadoffset, | ||
+ | |||
+ | Une largeur d' | ||
+ | |||
+ | \renewcommand{\headrulewidth}{2pt} | ||
+ | |||
+ | ou | ||
+ | |||
+ | | ||
+ | |||
+ | en utilisant la largeur (l' | ||
+ | |||
+ | **There are other options to eliminate headers and footers, to have separate headers and footers for different sections, for pages that are purposefully left blank or that contain only a table or graphic. There are other options as well. If you are interested, read the documentation that comes with fancyhdr. | ||
+ | |||
+ | Again I say – experiment with the choices, do not assume the documentation explains or describes every case. This is a very useful tool and will let you make headers and footers the way you want them, if you learn how to use it.** | ||
- | There are other options | + | D' |
- | Again I say – experiment with the choices, do not assume the documentation | + | Encore une fois, je le dis, faites des essais avec différents choix, ne supposez pas que la documentation |
issue187/latex.1669534899.txt.gz · Dernière modification : 2022/11/27 08:41 de auntiee