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:symboles:changer_la_casse [2018/05/24 17:07] – joseph.wright | 2_composition:texte:symboles:changer_la_casse [2021/01/03 19:46] (Version actuelle) – Renommage des sections de base: correction des liens internes. yannick.tanguy | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | --- | + | ====== Comment convertir des majuscules en minuscules et inversement? |
- | section: Common misunderstandings | + | |
- | permalink: / | + | |
- | date: 2014-06-10 | + | |
- | --- | + | |
- | # Case-changing oddities | + | ===== Avec les commandes \uppercase et \lowercase ===== |
- | TeX provides two primitive commands `\uppercase` and | + | < |
- | `\lowercase` to change the case of text; they're not much used, but | + | * '' |
- | are capable creating confusion. | + | * '' |
- | The two commands do not expand the text that is their parameter& | + | Elles ne sont pas très utilisées car sources de confusion : |
- | the result of `\uppercase{abc}` is `ABC`, but | + | * elles ne développent pas les commandes du texte donné en paramètre. Ainsi, le résultat de '' |
- | `\uppercase{`\abc`}` is always `\abc`, whatever the | + | * elles appliquent un simple tableau d' |
- | meaning of `\abc`. The commands are simply interpreting a table of | + | * et elles ne traitent pas très bien les caractères non américains, |
- | equivalences between upper- and lowercase characters. | + | |
- | They have (for example) no mathematical sense, and | + | |
- | ```latex | + | |
- | \uppercase{About $y=f(x)$} | + | |
- | ``` | + | |
- | will produce | + | |
- | ```latex | + | |
- | ABOUT $Y=F(X)$ | + | |
- | ``` | + | |
- | which is probably not what is wanted. | + | |
- | In addition, `\uppercase` and `\lowercase` do not deal very well | + | ===== Avec les commandes |
- | with non-American characters, for example | + | |
- | `\uppercase{`\ae`}` is the same as `\ae`. | + | |
- | LaTeX provides commands `\MakeUppercase` and `\MakeLowercase` | + | < |
- | which fixes the latter problem. These commands are used in the | + | |
- | standard | + | |
- | and sections. | + | |
- | Unfortunately `\MakeUppercase` and `\MakeLowercase` do not solve | + | Malheureusement, |
- | the other problems with `\uppercase`, so for example a section | + | |
- | title containing `\begin{tabular}` & | + | |
- | `\end{tabular}` will produce a running head containing | + | |
- | `\begin{TABULAR}`. The simplest solution to this problem is | + | |
- | using a user-defined command, for example: | + | |
- | ```latex | + | |
- | \newcommand{\mytable}{\begin{tabular}... | + | |
- | | + | |
- | \section{A section title \protect\mytable{} | + | |
- | with a table} | + | |
- | ``` | + | |
- | Note that `\mytable` has to be protected, otherwise it will be | + | |
- | expanded and made upper case; you can achieve the same result by | + | |
- | declaring it with `\DeclareRobustCommand`, | + | |
- | `\protect` won't be necessary. | + | |
- | David Carlisle' | + | <code latex> |
- | addresses many of these problems in a transparent way. It defines | + | \newcommand{\matable}{% |
- | commands `\MakeTextUppercase` and `\MakeTextLowercase` which do | + | \begin{tabular} |
- | upper- or lowercase, with the fancier features of the LaTeX | + | |
- | standard `\Make*`-commands but without the problems | + | \end{tabular}% |
- | mentioned above. | + | } |
- | `\usepackage[overload]{textcase}`, and it will redefine the LaTeX | + | \section{Un titre avec un tableau \protect\matable{}} |
- | commands (_not_ the TeX primitive commands `\uppercase` and | + | </ |
- | `\lowercase`), | + | |
- | broken page headings. | + | |
+ | Notez que la commande '' | ||
+ | |||
+ | ===== Avec l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | ----- | ||
+ | |||
+ | //Source:// [[faquk> | ||
+ | |||
+ | {{htmlmetatags> | ||
+ | metatag-og: | ||
+ | metatag-og: | ||
+ | }} | ||