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:paragraphes:parametres_non_appliques_au_paragraphe [2018/06/03 14:26] – joseph.wright | 2_composition:texte:paragraphes:parametres_non_appliques_au_paragraphe [2021/01/31 16:26] (Version actuelle) – Correction d'une coquille de texte. yannick.tanguy | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | --- | + | ====== Pourquoi mon paramètre de paragraphe est-il ignoré? ====== |
| - | title: Why does it ignore paragraph parameters? | + | |
| - | category: usage | + | |
| - | permalink: / | + | |
| - | --- | + | |
| - | When TeX is laying out text, it doesn't work from word to word, or | + | Lorsque < |
| - | from line to line; the smallest complete unit it formats is the | + | |
| - | paragraph. The paragraph is laid down in a buffer, as it appears, and | + | |
| - | isn't touched further until the end-paragraph marker is processed. | + | |
| - | It's at this point that the paragraph parameters have effect; and it's | + | |
| - | because of this sequence that one often makes mistakes that lead to | + | |
| - | the paragraph parameters not doing what one would have hoped (or | + | |
| - | expected). | + | |
| - | Consider the following sequence of LaTeX: | + | Considérez l' |
| - | <!-- {% raw %} --> | + | |
| - | ```latex | + | |
| - | {\raggedright % declaration for ragged text | + | |
| - | Here's text to be ranged left in our output, | + | |
| - | but it's the only such paragraph, so we now | + | |
| - | end the group.} | + | |
| - | Here's more that needn' | + | <WRAP column 60ex> |
| - | ``` | + | <code latex> |
| - | < | + | {\raggedleft |
| - | TeX will open a group, and impose the ragged-setting parameters within | + | Voici le texte à justifier à droite mais, |
| - | that group; it will then save a couple of sentences of text and | + | s' |
| - | close the group (thus restoring the previous value of the | + | effet, nous pouvons terminer le groupe.} |
| - | parameters that `\raggedright` set). Then TeX encounters a blank | + | |
| - | line, which it knows to treat as a `\par` token, so it typesets the | + | |
| - | two sentences; but because the enclosing group has now been closed, | + | |
| - | the parameter settings have been lost, and the paragraph will be | + | |
| - | typeset normally. | + | |
| - | The solution is simple: close the paragraph inside the group, so that | + | Et voici la suite qui n'a plus besoin d' |
| - | the setting parameters remain in place. An appropriate way of doing | + | justification à droite et qui redevient un texte |
| - | that is to replace the last three lines above with: | + | justifié classique pour \LaTeX. |
| - | <!-- {% raw %} --> | + | </code> |
| - | ```latex | + | </WRAP> |
| - | end the group.\par} | + | |
| - | Here's more that needn' | + | |
| - | ``` | + | |
| - | <!-- {% endraw %} --> | + | |
| - | In this way, the paragraph is completed while `\raggedright`s | + | |
| - | parameters are still in force within the enclosing group. | + | |
| - | Another alternative is to define an environment that does the | + | <WRAP column 60ex> |
| - | appropriate job for you. For the above example, LaTeX already | + | < |
| - | defines an appropriate one: | + | \documentclass{article} |
| - | ```latex | + | \usepackage[width=9cm]{geometry} |
| - | \begin{flushleft} | + | \pagestyle{empty} |
| - | Here's text to be ranged left... | + | \begin{document} |
| - | \end{flushleft} | + | {\raggedleft % Justification à droite |
| - | ``` | + | Voici le texte à justifier à droite mais, |
| + | s' | ||
| + | effet, nous pouvons terminer le groupe.} | ||
| - | In fact, there are a number of parameters for which TeX only | + | Et voici la suite qui n'a plus besoin d' |
| - | maintains one value per paragraph. A tiresome one is the set of upper | + | justification à droite et qui redevient un texte |
| - | case/lower case translations, | + | justifié classique pour \LaTeX. |
| - | hyphenation of mutilingual texts. | + | \end{document} |
| - | confusion is [`\baselineskip`](FAQ-baselinepar). | + | </latexdoc> |
| + | </ | ||
| + | <WRAP clear /> | ||
| + | < | ||
| + | |||
| + | La solution est ici simple : fermez le paragraphe à l' | ||
| + | |||
| + | <WRAP column 60ex> | ||
| + | <code latex> | ||
| + | {\raggedleft % Justification à droite | ||
| + | Voici le texte à justifier à droite mais, | ||
| + | s' | ||
| + | effet, nous pouvons terminer le groupe.\par} | ||
| + | Et voici la suite qui n'a plus besoin d' | ||
| + | justification à droite et qui redevient un texte | ||
| + | justifié classique pour \LaTeX. | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <WRAP column 60ex> | ||
| + | < | ||
| + | \documentclass{article} | ||
| + | \usepackage[width=9cm]{geometry} | ||
| + | \pagestyle{empty} | ||
| + | \begin{document} | ||
| + | {\raggedleft % Justification à droite | ||
| + | Voici le texte à justifier à droite mais, | ||
| + | s' | ||
| + | effet, nous pouvons terminer le groupe.\par} | ||
| + | Et voici la suite qui n'a plus besoin d' | ||
| + | justification à droite et qui redevient un texte | ||
| + | justifié classique pour \LaTeX. | ||
| + | \end{document} | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP clear /> | ||
| + | |||
| + | De cette façon, le paragraphe est complété alors que les paramètres de '' | ||
| + | |||
| + | Une autre alternative consiste à utiliser un environnement qui fait le travail approprié pour vous. Pour l' | ||
| + | |||
| + | <WRAP column 60ex> | ||
| + | <code latex> | ||
| + | \begin{flushright} | ||
| + | Voici le texte à justifier à droite mais, | ||
| + | s' | ||
| + | effet, nous pouvons terminer le groupe. | ||
| + | \end{flushright} | ||
| + | |||
| + | Et voici la suite qui n'a plus besoin d' | ||
| + | justification à droite et qui redevient un texte | ||
| + | justifié classique pour \LaTeX. | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <WRAP column 60ex> | ||
| + | < | ||
| + | \documentclass{article} | ||
| + | \usepackage[width=9cm]{geometry} | ||
| + | \pagestyle{empty} | ||
| + | \begin{document} | ||
| + | \begin{flushright} | ||
| + | Voici le texte à justifier à droite mais, | ||
| + | s' | ||
| + | effet, nous pouvons terminer le groupe. | ||
| + | \end{flushright} | ||
| + | |||
| + | Et voici la suite qui n'a plus besoin d' | ||
| + | justification à droite et qui redevient un texte | ||
| + | justifié classique pour \LaTeX. | ||
| + | \end{document} | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP clear /> | ||
| + | |||
| + | Vous pourrez noter que l' | ||
| + | |||
| + | Plus généralement, | ||
| + | |||
| + | ----- | ||
| + | |||
| + | //Source:// [[faquk> | ||
| + | |||
| + | {{htmlmetatags> | ||
| + | metatag-og: | ||
| + | metatag-og: | ||
| + | }} | ||

