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:flottants:pourquoi_faire_flotter_ses_figures_et_tableaux [2018/05/25 09:01] – joseph.wright | 3_composition:flottants:pourquoi_faire_flotter_ses_figures_et_tableaux [2021/06/13 21:21] (Version actuelle) – Correction de coquilles. jejust | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | --- | + | ====== Comment gérer proprement les flottants dans LaTeX? ====== |
- | section: Things are Going Wrong& | + | |
- | subsection: Making things stay where you want them | + | |
- | permalink: / | + | |
- | date: 2014-06-10 | + | |
- | --- | + | |
- | # Moving | + | Les tables |
+ | Il s'agit là d'un principe parfaitement ordinaire dans une conception de document : tout logiciel de composition positionnera | ||
+ | les figures et les tableaux là où ils enfreindront le moins possible de règles typographiques. Même si vous utilisez | ||
+ | le spécificateur de placement « '' | ||
+ | si ces règles ne sont pas respectées. Ces règles elles-mêmes sont assez simples et sont listées à la page 198, section C.9 | ||
+ | du manuel < | ||
+ | peuvent entraîner l' | ||
+ | « [[2_programmation: | ||
- | Tables and figures have a tendency to surprise, by _floating_ | + | Ce qui suit est une simple |
- | away from where they were specified to appear. | + | |
- | perfectly ordinary document design; any professional typesetting | + | |
- | package will float figures and tables to where they' | + | |
- | violating the certain typographic rules. | + | |
- | placement specifier& | + | |
- | will not be | + | |
- | printed '' | + | |
- | are pretty | + | |
- | LaTeX manual. | + | |
- | floating items to pile up to the extent that you get an error message | + | |
- | saying '' | + | |
- | What follows is a simple checklist of things to do to solve these | + | |
- | problems (the checklist talks throughout about figures, but applies | + | |
- | equally well to tables, or to '' | + | |
- | [`float`](https:// | + | |
- | | + | |
- | - Do your figures need to float at all? If not, look at the | + | ===== Éviter les flottants |
- | recommendations for '' | + | |
- | - Are the placement parameters on your figures right? | + | La question « [[3_composition:flottants: |
- | | + | |
- | reasonably change it (for example, to add an `h`). | + | ===== Utiliser les bons spécificateurs de placement |
- | Whatever you do, _don' | + | |
- | omit the `p`: doing so could cause LaTeX to believe that if you | + | La séquence de spécificateurs par défaut, « '' |
- | can't have your figure _here_, you don't want it | + | |
- | _anywhere_. | + | ===== Changer les paramètres de gestion des flottants ===== |
- | this way& | + | |
- | - LaTeX' | + | Les paramètres de < |
- | | + | |
- | notoriously rather conservative. | + | |
- | your figure, you may need to loosen its demands. | + | |
- | ones are the ratio of text to float on a given page, but it's | + | |
- | sensible to have a fixed set that changes the whole lot, to meet | + | |
- | every eventuality.) | + | |
- | ```latex | + | |
- | \renewcommand{\topfraction}{.85} | + | |
- | \renewcommand{\bottomfraction}{.7} | + | |
- | \renewcommand{\textfraction}{.15} | + | |
- | \renewcommand{\floatpagefraction}{.66} | + | |
- | \renewcommand{\dbltopfraction}{.66} | + | |
- | \renewcommand{\dblfloatpagefraction}{.66} | + | |
- | \setcounter{topnumber}{9} | + | |
- | \setcounter{bottomnumber}{9} | + | |
- | \setcounter{totalnumber}{20} | + | |
- | \setcounter{dbltopnumber}{9} | + | |
- | ``` | + | |
- | The meanings of these | + | |
- | parameters are described on pages& | + | |
- | LaTeX manual. | + | |
- | - Are there places in your document where you could '' | + | |
- | put a `\clearpage` command? | + | |
- | cleared after a `\clearpage`. | + | |
- | command in the standard [`book`](https: | + | |
- | implicitly executes `\clearpage`, so your floats can't wander past | + | |
- | the end of a chapter.) | + | |
- | - Try the [`placeins`](https: | + | |
- | `\FloatBarrier` command beyond which floats may not pass. A | + | |
- | | + | |
- | | + | |
- | you choose. | + | |
- | - If you are bothered by floats appearing at the top of the page | + | |
- | (before they are specified in your text), try the [`flafter`](https://ctan.org/pkg/latex-base) | + | |
- | package, which avoids this problem by insisting that floats should | + | |
- | always appear after their definition. | + | |
- | - Have a look at the LaTeX2e [`afterpage`](https:// | + | |
- | Its documentation gives as an example the idea | + | |
- | of putting `\clearpage` _after_ the current | + | |
- | will clear the backlog, but not cause an ugly gap in your text), but | + | |
- | also admits that the package is somewhat fragile. | + | |
- | resort if the other possibilities below don't help. | + | |
- | - If you would actually _like_ great blocks of floats at the | + | |
- | end of each of your chapters, try the `\extrafloats` command, | + | |
- | or in older LaTeX releases, the [`morefloats`](https:// | + | |
- | this allows you to increase the number of floating inserts that LaTeX | + | |
- | can handle at one time (from its original value of 18 or, now, 52, in | + | |
- | LaTeX2e). | + | |
| | ||
+ | <code latex> | ||
+ | \renewcommand{\topfraction}{.85} | ||
+ | \renewcommand{\bottomfraction}{.7} | ||
+ | \renewcommand{\textfraction}{.15} | ||
+ | \renewcommand{\floatpagefraction}{.66} | ||
+ | \renewcommand{\dbltopfraction}{.66} | ||
+ | \renewcommand{\dblfloatpagefraction}{.66} | ||
+ | \setcounter{topnumber}{9} | ||
+ | \setcounter{bottomnumber}{9} | ||
+ | \setcounter{totalnumber}{20} | ||
+ | \setcounter{dbltopnumber}{9} | ||
+ | </ | ||
+ | |||
+ | La signification de ces paramètres est donnée en pages 199 à 200, section C.9 du manuel < | ||
+ | |||
+ | ===== Utiliser la commande “\clearpage” ===== | ||
+ | |||
+ | Votre document dispose d' | ||
+ | |||
+ | ===== Utiliser l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | ===== Utiliser l' | ||
+ | |||
+ | Si vous êtes gêné par les flottants apparaissant en haut de la page (avant qu'ils ne soient spécifiés dans votre texte), essayez l' | ||
+ | |||
+ | ===== Utiliser l' | ||
+ | |||
+ | La documentation de l' | ||
+ | |||
+ | ===== Utiliser l' | ||
+ | |||
+ | Si vous souhaitez réellement avoir de larges blocs de flottants à la fin de chacun de vos chapitres, essayez la commande '' | ||
+ | |||
+ | Dans le cas particulier où vous utiliseriez l' | ||
+ | |||
+ | <code latex> | ||
+ | \usepackage{etex} | ||
+ | \reserveinserts{18} | ||
+ | \usepackage{morefloats} | ||
+ | </ | ||
+ | |||
+ | ===== Utiliser l' | ||
+ | |||
+ | Si vous souhaitez avoir tous vos flottants en fin de document (par exemple pour soumettre une version provisoire d'un article), ne comptez pas sur les mécanismes usuels de < | ||
- | Caveat: if you are using [`etex`](https: | + | ----- |
- | registers available on old releases, you need to '' | + | //Source:// [[faquk> |
- | | + | |
- | ```latex | + | |
- | \usepackage{etex} | + | |
- | \reserveinserts{18} | + | |
- | \usepackage{morefloats} | + | |
- | ``` | + | |
- | - If you actually _wanted_ all your figures | + | |
- | end (_e.g_., for submitting a draft copy of a paper), don' | + | |
- | rely on LaTeX's mechanism: get the [`endfloat`](https:// | + | |
- | the job for you. | + | |
+ | {{htmlmetatags> | ||
+ | metatag-og: | ||
+ | metatag-og: | ||
+ | }} | ||