Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

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] jejustcomposition: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 ''\rm'', ''\sf'', 
-''\tt'', ''\it'', ''\sl'', ''\em'' and ''\bf''; they were modal 
-commands, so you used them as: 
- 
-<code latex> 
-{\bf Fred} was {\it here\/}. 
-</code> 
-with the font change enclosed in a group, so as to limit its effect; 
-note the italic correction command ''\/'' that was necessary at the 
-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// Those semantics were part of 
-the reason they were deprecated: each ''//xx//'' overrides 
-any other font settings, keeping only the size.  So, for example, 
- 
-<code latex> 
-{\bf\it Here we are again\/} 
-</code> 
-ignores ''\bf'' and produces text in italic, medium weight (and the 
-italic correction has a real effect), whereas 
- 
-<code latex> 
-{\it\bf happy as can be\/} 
-</code> 
-ignores ''\it'' and produces upright text at bold weight (and the 
-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} 
-</code> 
-ignores the ''\textbf'' that encloses the text, and produces 
-typewriter text at medium weight. 
- 
-So why are these commands deprecated? --- it is because of confusions 
-such as that in the last example.  The alternative (LaTeX2e) 
-commands are discussed in the rest of this answer. 
- 
-LaTeX2e's font commands come in two forms: modal commands and 
-text-block commands.  The default set of modal commands offers weights 
-''\mdseries'' and ''\bfseries'', shapes ''\upshape'', 
-''\itshape'', ''\scshape'' and ''\slshape'', and families 
-''\rmfamily'', ''\sffamily'' and ''\ttfamily'' A font selection 
-requires a family, a shape and a series (as well as a size, of 
-course).  A few examples 
- 
-<code latex> 
-{\bfseries\ttfamily and jolly good company!} 
-</code> 
-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\/} 
-</code> 
-(note the italic correction needed on slanted fonts, too). 
- 
-LaTeX2e's text block commands take the first two letters of the 
-modal commands, and form a ''\text''//''xx''// command from 
-them.  Thus ''\bfseries'' becomes ''\textbf{text}'', 
-''\itshape'' becomes ''\textit{text}'', and ''\ttfamily'' 
-becomes ''\texttt{text}'' Block commands may be nested, as: 
- 
-<code latex> 
-\textit{\textbf{Never mind the rain}} 
-</code> 
-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} 
-</code> 
-for bold typewriter, or 
- 
-<code latex> 
-{\slshape \textbf{Whoops!  she goes again}\/} 
-</code> 
-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 
-"upright slanted" fonts, or "teletype roman" fonts.  There are a 
-couple of immediate oddities, though.  The first is the conflict 
-between ''\itshape'' (or ''\slshape'') and ''\scshape'': while many 
-claim that an italic small-caps font is typographically unsound, such 
-fonts do exist.  Daniel Taupin's [[ctanpkg>smallcap|smallcap]] package enables 
-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 ''\upshape'' and ''\itshape'': 
-Knuth actually offers an upright-italic font which LaTeX uses for 
-the "£" symbol in the default font set.  The combination is 
-sufficiently weird that, while there's a defined font shape, no 
-default LaTeX commands exist; to use the shape, the (eccentric) user 
-needs LaTeX's simplest font selection commands: 
- 
-<code latex> 
-{\fontshape{ui}\selectfont Tra la la, di dee} 
-</code> 
- 
- 
------ 
- 
-//Source:// [[faquk>FAQ-2letterfontcmd|What's wrong with `\bf`, `\it`, etc.?]] 
- 
-{{htmlmetatags>metatag-keywords=(LaTeX,usage) 
-metatag-og:title=(What's wrong with `\bf`, `\it`, etc.?) 
-metatag-og:site_name=(FAQ LaTeX francophone) 
-}} 
  
3_composition/texte/symboles/pourquoi_ne_pas_utiliser_bf_et_it.1543881583.txt.gz · Dernière modification : 2018/12/03 23:59 de jejust
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0