Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédente | |||
composition:texte:symboles:pourquoi_ne_pas_utiliser_bf_et_it [2018/12/03 23:59] – jejust | composition:texte:symboles:pourquoi_ne_pas_utiliser_bf_et_it [2021/01/08 23:05] (Version actuelle) – Suppression de la page désormais déplacée. yannick.tanguy | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== What's wrong with `\bf`, `\it`, etc.? ====== | ||
- | |||
- | |||
- | The font-selection commands of LaTeX 2.09 were '' | ||
- | '' | ||
- | commands, so you used them as: | ||
- | |||
- | <code latex> | ||
- | {\bf Fred} was {\it here\/}. | ||
- | </ | ||
- | with the font change enclosed in a group, so as to limit its effect; | ||
- | note the italic correction command '' | ||
- | end of a section in italics. | ||
- | |||
- | At the release of LaTeX2e in summer 1994, these simple commands were | ||
- | deprecated, but recognising that their use is deeply embedded in the | ||
- | brains of LaTeX users, the commands themselves remain in LaTeX, | ||
- | //with their LaTeX 2.09 semantics// | ||
- | the reason they were deprecated: each ''// | ||
- | any other font settings, keeping only the size. So, for example, | ||
- | |||
- | <code latex> | ||
- | {\bf\it Here we are again\/} | ||
- | </ | ||
- | ignores '' | ||
- | italic correction has a real effect), whereas | ||
- | |||
- | <code latex> | ||
- | {\it\bf happy as can be\/} | ||
- | </ | ||
- | ignores '' | ||
- | italic correction has nothing to do). The same holds if you mix | ||
- | LaTeX2e font selections with the old style commands: | ||
- | |||
- | <code latex> | ||
- | \textbf{\tt all good friends} | ||
- | </ | ||
- | ignores the '' | ||
- | typewriter text at medium weight. | ||
- | |||
- | So why are these commands deprecated? --- it is because of confusions | ||
- | such as that in the last example. | ||
- | commands are discussed in the rest of this answer. | ||
- | |||
- | LaTeX2e' | ||
- | text-block commands. | ||
- | '' | ||
- | '' | ||
- | '' | ||
- | requires a family, a shape and a series (as well as a size, of | ||
- | course). | ||
- | |||
- | <code latex> | ||
- | {\bfseries\ttfamily and jolly good company!} | ||
- | </ | ||
- | produces bold typewriter text (but note the lack of a | ||
- | [[FAQ-bold-extras|bold typewriter font]] | ||
- | in the default Computer Modern fonts), or | ||
- | |||
- | <code latex> | ||
- | {\slshape\sffamily Never mind the weather\/} | ||
- | </ | ||
- | (note the italic correction needed on slanted fonts, too). | ||
- | |||
- | LaTeX2e' | ||
- | modal commands, and form a '' | ||
- | them. Thus '' | ||
- | '' | ||
- | becomes '' | ||
- | |||
- | <code latex> | ||
- | \textit{\textbf{Never mind the rain}} | ||
- | </ | ||
- | to produce bold italic text (note that the block commands supply | ||
- | italic corrections where necessary), and they be nested with the | ||
- | LaTeX2e modal commands, too: | ||
- | |||
- | <code latex> | ||
- | \texttt{\bfseries So long as we're together} | ||
- | </ | ||
- | for bold typewriter, or | ||
- | |||
- | <code latex> | ||
- | {\slshape \textbf{Whoops! | ||
- | </ | ||
- | for a bold slanted instance of the current family (note the italic | ||
- | correction applied at the end of the modal command group, again). | ||
- | |||
- | The new commands (as noted above) override commands of the same type. | ||
- | In almost all cases, this merely excludes ludicrous ideas such as | ||
- | " | ||
- | couple of immediate oddities, though. | ||
- | between '' | ||
- | claim that an italic small-caps font is typographically unsound, such | ||
- | fonts do exist. | ||
- | use of the instances in the [[FAQ-ECfonts|EC fonts]], and | ||
- | similar techniques could be brought to bear on many other font sets. | ||
- | The second is the conflict between '' | ||
- | Knuth actually offers an upright-italic font which LaTeX uses for | ||
- | the " | ||
- | sufficiently weird that, while there' | ||
- | default LaTeX commands exist; to use the shape, the (eccentric) user | ||
- | needs LaTeX' | ||
- | |||
- | <code latex> | ||
- | {\fontshape{ui}\selectfont Tra la la, di dee} | ||
- | </ | ||
- | |||
- | |||
- | ----- | ||
- | |||
- | //Source:// [[faquk> | ||
- | |||
- | {{htmlmetatags> | ||
- | metatag-og: | ||
- | metatag-og: | ||
- | }} | ||