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 | ||
composition:texte:pages:modifier_les_marges_en_cours_de_document [2018/06/03 14:21] – samcarter | 3_composition:texte:pages:modifier_les_marges_en_cours_de_document [2022/10/04 13:11] (Version actuelle) – Italique inutile supprimé dbitouze | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | --- | + | ====== Comment modifier des marges en cours de document? ====== |
- | title: Changing margins "on the fly" | + | |
- | category: formatting | + | |
- | tags: layout | + | |
- | permalink: / | + | |
- | date: 2014-06-10 | + | |
- | --- | + | |
- | One of the surprises | + | L'une des surprises |
- | change the width or height of the text within the document, | + | vous ne pouvez pas changer la largeur ou la longueur de la zone du texte dans le document, |
- | modifying the text size parameters; TeX can't change the text width | + | même en modifiant directement les paramètres de taille du texte. |
- | on the fly, and LaTeX only ever looks at text height when starting | + | < |
- | a new page. | + | et < |
+ | de la construction d'une nouvelle | ||
+ | La règle est donc que les paramètres ne doivent être modifiés | ||
+ | que dans le préambule du document, c' | ||
+ | avant toute composition. | ||
+ | Voici comment contourner cette règle. | ||
- | So the simple rule is that the parameters should only be | + | ===== Modification de la largeur de la page ===== |
- | changed in the preamble of the document, i.e., before the | + | |
- | `\begin{document}` statement (so before any typesetting has | + | |
- | happened. | + | |
- | To adjust text width within a document | + | ==== Avec des commandes de base ==== |
- | <!-- {% raw %} --> | + | |
- | ```latex | + | Pour ajuster la largeur du texte en cours de document, la méthode suivante passe par un environnement |
+ | |||
+ | < | ||
\newenvironment{changemargin}[2]{% | \newenvironment{changemargin}[2]{% | ||
\begin{list}{}{% | \begin{list}{}{% | ||
Ligne 31: | Ligne 29: | ||
}% | }% | ||
\item[]}{\end{list}} | \item[]}{\end{list}} | ||
- | ``` | + | </code> |
- | <!-- {% endraw %} --> | + | |
- | The environment takes two arguments, and will indent the left and | + | |
- | right margins, respectively, | + | |
- | values will cause the margins to be narrowed, so | + | |
- | `\begin{changemargin}{-1cm}{-1cm}` narrows the left and right | + | |
- | margins by 1 centimetre. | + | |
- | Given that TeX can't do this, how does it work?& | + | L'environnement prend deux arguments et indente les marges gauche et droite des valeurs de ces paramètres. Les valeurs négatives réduiront les marges et l'exemple suivant rétrécit les marges gauche et droite de 1 centimètre |
- | environment (which is a close relation of the LaTeX | + | |
- | `quote` environment) _doesn't_ change the text width | + | |
- | as far as TeX is concerned: it merely moves text around inside the | + | |
- | width that TeX believes in. | + | |
- | The [`changepage`](https:// | + | <code latex> |
- | the above; it includes provision for changing the shifts applied to | + | \begin{changemargin}{-1cm}{-1cm} |
- | your text according to whether you're on an odd (_recto_) or an | + | ... |
- | even (_verso_) page of a two-sided document. | + | \end{changemargin} |
- | [`Changepage`](https:// | + | </code> |
- | class. | + | |
- | The (earlier) package [`chngpage`](https: | + | Cette solution marche car l' |
- | but it uses rather different syntax. | + | |
- | matches that of the [`memoir`](https: | + | |
- | any new work. | + | |
- | Changing the vertical dimensions of a page is more clumsy still: the | + | ==== Avec l' |
- | LaTeX command `\enlargethispage` adjusts the size of the current | + | |
- | page by the size of its argument. | + | L' |
- | ```latex | + | |
+ | ==== Avec l' | ||
+ | |||
+ | :!: L’extension [[ctanpkg> | ||
+ | |||
+ | L' | ||
+ | |||
+ | ===== Modification de la longueur de la page ===== | ||
+ | |||
+ | ==== Avec des commandes de base ==== | ||
+ | |||
+ | Changer les dimensions verticales d'une page est assez simple : la commande < | ||
+ | |||
+ | < | ||
\enlargethispage{\baselineskip} | \enlargethispage{\baselineskip} | ||
- | ``` | + | </ |
- | to make the page one line longer, or | + | |
- | ```latex | + | Et voici l' |
+ | |||
+ | < | ||
\enlargethispage{-\baselineskip} | \enlargethispage{-\baselineskip} | ||
- | ``` | + | </ |
- | to make the page one line shorter. | + | |
- | simplified by the [`addlines`](https://ctan.org/pkg/addlines) package: its `\addlines` | + | ==== Avec l' |
- | command takes as argument the _number_ of lines to add to the | + | |
- | page (rather than a length): the package | + | Le processus est (dans une certaine mesure) simplifié par l' |
- | useful analysis of when the command may (or may not) be expected to | + | |
- | work. | + | ----- |
+ | //Source:// [[faquk> | ||
+ | {{htmlmetatags> | ||
+ | metatag-og: | ||
+ | metatag-og: | ||
+ | }} | ||