# Tag Info

176

Marc van Dongen gave a great answer. I'll throw in another reason: \it and \bf do not play well together. That is, they do not nest as one would intuitively expect: Whereas \textit and \textbf do play well together: This is nice. However, you may notice that it still fails to handle nested style adjustments to small caps, since the Computer Modern ...

104

Those are very different commands even if the output happens to look the same. If you want to emphasize a word or some text, use \emph. Don't just make the text italic or bold. If needed, you may change the behaviour of \emph whenever you wish in the preamble and the whole document will be adjusted accordingly. If you want to get italic text, use \textit. ...

69

In general the command (\textbf/\textit) approach is more useful if the text is followed by more text on the same line and isn't followed by a small punctuation symbol. If the text is in a paragraph on its own or is followed by a small punctuation symbol, it doesn't matter really. In that case the declarations (\bf/\bfseries and \it/\itshape) are equivalent ...

51

The \emph macro is designed to be semantic mark up. So while convention it makes text italic, this is not always the case. For example, the beamer class makes \emph text red as this works better in presentations than using italic. On the other hand, \textit makes text italic, with no variation. Thus it is intended for making text italic when that is exactly ...

46

When both attributes differ, slanted is an oblique version of the roman font; the shape is basically the same but "sloped". Italics, on the other hand, have different letter shapes. The following example shows the difference: \documentclass{article} \begin{document} \Huge Some text \textit{Some text} \textsl{Some text} \end{document} Notice that ...

41

Using "all italics" is unfortunately an often committed sin. You should italicize only variables. Everything else should be upright. For example: function names (sin, cos, log, ln etc...) dimensionless numbers (Re, Pr, Ra...) exact infinitesimal increments (dx, dy et... in BOTH integrals and differentials) descriptive text all descriptive variable indices ...

35

\itshape is a switch: Not italic {\itshape Italic} Not italic \textit takes an argument: Not italic \textit{Italic} Not italic Many people seem to like \itshape{...}, which is wrong (but doesn't give an error since the braces are interpreted as grouping delimiters here). \itshape doesn't automatically insert italic correction, whereas \textit does, so ...

34

First of all you should not use the obsolete \bf or \it macros from LaTeX2.0. They do not use the new font selection scheme (NFSS) of LaTeX2e. So \bf will do bold and bold only, but will not mix with an italic setting, which makes bold-italic impossible. Use the new \bfseries macro instead. There is not much practical difference between ...

30

amsthm has three separate predefined styles: \theoremstyle{plain} is the default. it sets the text in italic and adds extra space above and below the \newtheorems listed below it in the input. it is recommended for theorems, corollaries, lemmas, propositions, conjectures, criteria, and (possibly; depends on the subject area) algorithms. ...

29

A LaTeX3 solution. I chose to simply do what you said, replacing every ( by \textup{(}, every ) with \textup{)}, and similarly for brackets, prior to passing the result to the old version of \emph for typesetting. At the end of the day, xparse allows us to easily define \emph to do what you asked for, and \emph* to do the old version of \emph. ...

27

I would agree not messing with catcodes (although doing so just within an \emph command itself probably wouldn't have too many issues.) But here's a relatively simple solution with a slightly more transparent semantics than Yiannis's solution: \documentclass{article} \newcommand{\bemph}[1]{{\upshape#1}} % define how emphasised brackets should look ...

26

On a case-by-case basis, it is possible to typeset text within math mode using \textrm{...} or \mathrm{...}, the latter being used predominantly for typesetting units or symbols and not pure text (since it gobbles spaces that are not escaped). \mbox{...} is another alternative to \textrm{...}, since it resets its contents to text mode by default. Here are ...

24

\itshape is a declaration. It affects the following text. That's why it's often used for larger amounts of text or within a group. In contrast, \textit affects only its argument. \textit provides italic correction, \itshape does not. This means, that immediately after an italic text made by \textit there's a little more space before the following text, ...

22

Quoting Bringhurst's “Elements of Typographic Style” section 3.5.2 Don't clutter the foreground: When boldface is used to emphasize words, it is usually best to leave the punctuation in the background, which is to say, in the basic text font. It is the words, not the punctuation, that merit emphasis in a sequence such as the following: ... on the ...

22

There is no difference in the font choice or italic correction applied and for common variants like bold and italic, it's probable that the fonts are preloaded so it makes no difference at all, however in principle \textit{\textbf{text}} first loads the italic font (and will generate warnings and substitutions if this font is not available) and only then ...

19

The results are not always perfect, but mathastext is what you're looking for, when you want to set globally the math font to upright (or to use another completely different font, check the documentation): \documentclass{article} \usepackage[LGRgreek]{mathastext} \begin{document} Here is a formula: $x=\exp(\log x)$ Here is another: $\sin^2 t+\cos^2 t = 1$ ...

18

Use a combination of lmodern and slantsc to obtain slanted small caps: \documentclass{article} \usepackage{lmodern}% http://ctan.org/pkg/lmodern \usepackage{slantsc}% http://ctan.org/pkg/slantsc \begin{document} \renewcommand{\arraystretch}{1.5} \begin{tabular}{ll} \verb!\textsc{Hello world}! & \textsc{Hello world} \\ % Regular Small Caps ...

18

This could be related to a bug with negative protrusion values that I reported a year ago and which is obviously still open. Which luatex version are you using?

18

With version 2.5 of the microtype package, available on CTAN since 13 March 2013, the simple answer to my question is "use microtype". Thanks, Herbert and Joseph, for telling me that this can be done with the microtype package. I did know that microtype can do margin kerning, but I had always thought that this is only about punctuation. In reality, one ...

17

microtype has an optional argument that you can allow to shift the characters more to the right, e.g. [factor=1300] \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lmodern,picture} \usepackage{microtype} \textwidth=3.85cm \begin{document} \itshape\noindent\makebox(0,0){\put(\textwidth,-2cm){\line(0,-1){80}}}% This is a small text. If jam is ...

17

For the case of units, you should use the siunitx package. \documentclass{article} \usepackage{siunitx} \begin{document} The average time of this event is \SI{50}{\micro\second}. \end{document} I guess I should mention the upgreek package. The average time of this event is 50~$\upmu$s. but this doesn't look as good.

16

\text is not the right command to use, as its argument will be typeset in the current font, which may be italics. \usepackage{amsmath} % for extended version of \textup \newcommand*{\Boltzmann}{k_\textup{B}} $\vec{F}_\textup{in}+\vec{F}_\textup{out}=\vec{0}$ What subscripts are to be set in upright font and what in italics is well explained by Boffin. (I ...

16

OK, I produced an absolutely crazy "solution" myself. This is mostly to make clearer what the problems are; I wouldn't suggest using the (very long) code below. This "solution" only provides italic correction for single letters A to Z and a to z, and it works by making $active. (I could also have used $$and$$, but I don't like those.) Moreover, everything ... 16 It depends on the math font, but the bm package can handle most of them. The usage is then$\bm{y}\$

15


14

In both \mktextquote and \mkblockquote, add \iflanguage{english}{\itshape}{} at the appropriate position. (\iflanguage is a babel conditional.) \documentclass[fontsize=11pt]{book} \usepackage[frenchb]{babel} \usepackage{csquotes} \renewcommand{\mktextquote}[6]{% #1% \iflanguage{english}{\itshape}{}% ADDED #2#4#3#6#5% } ...

14

There are two relevant differences between the first two commands. \textit puts its argument in italics, whereas \emph can be told which form of typographic emphasis to use: italics (the default), slanted roman (cf. the TeXbook!), bold, bold italics, underline (shudder), small caps, etc. \emph can handle cases of "nested emphasis". For instance, the ...

14

No, it was a standard convention. See, e.g., http://www.ams.org/journals/tran/1936-040-03/S0002-9947-1936-1501880-4/S0002-9947-1936-1501880-4.pdf (year 1936).

14

This is fixed in the mathtools package (see section 4.1 of the package documentation). Here is an example. Note that math must be typed using $$and$$: \documentclass{article} \usepackage{amsmath,mathtools} \begin{document} Bad: \mathtoolsset{mathic=false} \textit{If $$U$$ or $$V$$ \dots.} \par Good: \mathtoolsset{mathic=true} \textit{If ...

14

This has nothing to do with the documentclass, but with font selection. \it selects non-bold italics, and \bf selects non-italic bold. You should use \textbf{\textit{vs}} instead. See also this question.

Only top voted, non community-wiki answers of a minimum length are eligible