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/12/03 23:53] – jejust | 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: | ||
- | ====== | + | ====== |
+ | Lorsque < | ||
- | When TeX is laying out text, it doesn't work from word to word, or | + | Considérez l'extrait suivant |
- | from line to line; the smallest complete unit it formats is the | + | |
- | paragraph. | + | |
- | 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: | + | |
+ | <WRAP column 60ex> | ||
<code latex> | <code latex> | ||
- | {\raggedright | + | {\raggedleft |
- | Here's text to be ranged left in our output, | + | Voici le texte à justifier à droite mais, |
- | but it's the only such paragraph, so we now | + | s'agissant du seul paragraphe concerné par cet |
- | end the group.} | + | effet, nous pouvons terminer le groupe.} |
- | Here's more that needn't be ragged... | + | Et voici la suite qui n'a plus besoin d'être en |
+ | justification à droite et qui redevient un texte | ||
+ | justifié classique pour \LaTeX. | ||
</ | </ | ||
+ | </ | ||
- | TeX will open a group, and impose the ragged-setting parameters within | + | <WRAP column 60ex> |
- | that group; it will then save a couple of sentences of text and | + | < |
- | close the group (thus restoring the previous value of the | + | \documentclass{article} |
- | parameters that '' | + | \usepackage[width=9cm]{geometry} |
- | line, which it knows to treat as a ''\par'' | + | \pagestyle{empty} |
- | two sentences; but because the enclosing group has now been closed, | + | \begin{document} |
- | the parameter settings have been lost, and the paragraph will be | + | {\raggedleft % Justification à droite |
- | typeset normally. | + | Voici le texte à justifier à droite mais, |
+ | s'agissant du seul paragraphe concerné | ||
+ | effet, nous pouvons terminer le groupe.} | ||
- | 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. |
+ | \end{document} | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP clear /> | ||
+ | < | ||
+ | La solution est ici simple : fermez le paragraphe à l' | ||
+ | |||
+ | <WRAP column 60ex> | ||
<code latex> | <code latex> | ||
- | end the group.\par} | + | {\raggedleft % Justification à droite |
- | Here's more that needn't be ragged... | + | Voici le texte à justifier à droite mais, |
+ | s' | ||
+ | effet, nous pouvons terminer le groupe.\par} | ||
+ | Et voici la suite qui n'a plus besoin d'être en | ||
+ | justification à droite et qui redevient un texte | ||
+ | justifié classique pour \LaTeX. | ||
</ | </ | ||
+ | </ | ||
- | In this way, the paragraph is completed while ''\raggedright'' | + | <WRAP column 60ex> |
- | parameters are still in force within the enclosing group. | + | < |
+ | \documentclass{article} | ||
+ | \usepackage[width=9cm]{geometry} | ||
+ | \pagestyle{empty} | ||
+ | \begin{document} | ||
+ | {\raggedleft % Justification à droite | ||
+ | Voici le texte à justifier à droite mais, | ||
+ | s'agissant du seul paragraphe concerné par cet | ||
+ | effet, nous pouvons terminer le groupe.\par} | ||
+ | Et voici la suite qui n'a plus besoin d'être en | ||
+ | justification à droite et qui redevient un texte | ||
+ | justifié classique pour \LaTeX. | ||
+ | \end{document} | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP clear /> | ||
- | Another alternative is to define an environment that does the | + | De cette façon, le paragraphe est complété alors que les paramètres de '' |
- | appropriate job for you. For the above example, LaTeX already | + | |
- | defines an appropriate one: | + | |
+ | Une autre alternative consiste à utiliser un environnement qui fait le travail approprié pour vous. Pour l' | ||
+ | |||
+ | <WRAP column 60ex> | ||
<code latex> | <code latex> | ||
- | \begin{flushleft} | + | \begin{flushright} |
- | Here's text to be ranged left... | + | Voici le texte à justifier à droite mais, |
- | \end{flushleft} | + | 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 /> | ||
- | In fact, there are a number of parameters for which TeX only | + | Vous pourrez noter que l'espacement à la suite de cet environnement est différent de celui souhaité au début. |
- | maintains one value per paragraph. | + | |
- | case/lower case translations, | + | |
- | hyphenation of mutilingual texts. | + | |
- | confusion is [[FAQ-baselinepar|'' | + | |
+ | Plus généralement, | ||
----- | ----- | ||
Ligne 66: | Ligne 117: | ||
//Source:// [[faquk> | //Source:// [[faquk> | ||
- | {{htmlmetatags> | + | {{htmlmetatags> |
- | metatag-og: | + | metatag-og: |
metatag-og: | metatag-og: | ||
}} | }} | ||