# Tag Info

164

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 ...

114

The AMS Short Math Guide recommends the \boldsymbol and \pmb commands (and suggests that you use the bm package for the former to get a more powerful version than provided by amsmath).

82

Your question requires a two-part answer. \sc and \bf (and \it) are deprecated because, as you have noticed, they override each other. Use either \textit{...} \textbf{...} \textsc{...} or {\itshape ...} {\bfseries ...} {\scshape ...} instead. However, not all fonts contain italic and/or bold small caps (when they even contain small caps). (Also, ...

64

The \bm command from package bm has both advantages and drawbacks over the \boldsymbol command from package amsbsy (loaded by amsmath). The first advantage of \bm is that it keeps the italic correction, so that something like \bm{T}_1^2 will look better than \boldsymbol{T}_1^2 (if you want to compare the two in a document, you must be careful that bm ...

60

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 ...

40

Taking apan's comment and turning it into an example: \documentclass{article} \usepackage{array} \newcolumntype{$}{>{\global\let\currentrowstyle\relax}} \newcolumntype{^}{>{\currentrowstyle}} \newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}% #1\ignorespaces } \begin{document} \begin{tabular}{$l^c^r} \rowstyle{\bfseries} a & a & a \\ b ...

37

In my experience, there is no single best way. Therefore Table 327 on page 113 of the Comprehensive LaTeX Symbol List comes in really handy.

36

I guess you are using Adobe Reader? If you use transparency in your illustrations, it seems that Adobe Reader renders text incorrectly (something like the wrong gamma correction in anti-aliasing perhaps), which makes the text look a bit too bold. It should look OK if you use other PDF readers, and it should also look OK when printed from Adobe Reader. A ...

34

There's a really cheesy way of saving keystrokes that is no longer than Todd's answer but just as comprehensive as Yiannis's: \documentclass{article} \def\*#1{\mathbf{#1}} \def\ab{ab} \begin{document} $\*v, \*w, \*\ab, \*\Gamma$. \end{document} Explanation: a control sequence whose name is a non-letter doesn't require either spaces or braces after it ...

33

You can patch the name:last, name:first-last and name:last-first macros defined in biblatex.def. These are used by all of the default name formatting directives and take four arguments: {<last name>}{<first name>}{<name prefix>}{<name affix>} or {<last name>}{<first name (initials)>}{<name prefix>}{<name ...

31

This doesn't exactly answer your question (how to use bbold with AMS's black board bold characters). I believe that would require some TeX incantations. A cheaper work around is to use either the package bbm or the package doublestroke. The former defines the \mathbbm command and the latter uses the \mathds command, so they don't conflict with the AMS ...

31

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 ...

28

The caption package provides a lot of functionality and I would recommend to use it. Depending on your LaTeX distribution there a different ways to get the package. You get the files here, but installing is not trivial. You might want to search 'tex.sx' for 'install package' and pick you system. You get Figure x.x bold with ...

28

Assuming you do want fixed line ends: \documentclass{article} \newcommand\dob[1]{\textbf{#1}} \newenvironment{boldfirst}{\obeylines\everypar{\dob}}{} \begin{document} \begin{boldfirst} Lorem ipsum dolor sit amet, consectetur adipisci elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ...

26

For the sake of completeness, when using unicode-math, \mathbf works for both Greek and Latin letters. Compile with xelatex or lualatex. \documentclass{article} \usepackage{unicode-math} \setmathfont{xits-math.otf} \begin{document} $$AaBb∇αβγ$$ \par $$\mathbf{AaBb∇αβγ}$$ \end{document}

26

For a job like this I usually define a convenience macro: \def\<#1>{\textbf{#1}} Now you can say \<ORS> without much overhead and still don't need to define macros for all the terms that are special. In the context of a book you might want to think about how this macro can be also used to create an index. (This is a little trickier and might ...

24

I had the same question about a year ago. I came up with the following solution, which seems a bit cleaner that Juan's "hack": \DeclareSymbolFont{bbold}{U}{bbold}{m}{n} \DeclareSymbolFontAlphabet{\mathbbold}{bbold} Then one can use $\mathbbold{1}$ (and I store this, without the dollar signs, in the macro \ind since I use it as an indicator function).

23

As Martin mentioned in the comment you need a font which provides such a combination. In the following example you can see that the font courier has this combination implemented instead of Computer Modern. \documentclass{article} \usepackage{listings} \begin{document} % Default Computer Modern font (no bold implemented) \renewcommand{\ttdefault}{cmtt} ...

22

Another possibility is \boldmath, though I would prefer \boldsymbol of amsmath as well. \unboldmath switches back to the normal math font.

22

Here's a more complicated version that tries to preserve kerning between the first two letters, as shown in the last two lines. As in Thruston's answer, accented first characters must be enclosed in braces. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{environ,expl3} \ExplSyntaxOn % with the help of \NewEnviron, boldfirst absorbs the % ...

21

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


18

You can use both commands together and define something like \usepackage{bm} \newcommand{\vect}[1]{\boldsymbol{\mathbf{#1}}} which should work for most cases.

18

Using the bm package. The \mathbf command can be used only for non-italic symbols, instead the amsmath package defines the \boldsymbol command that can be used whit every literal symbol or math operator. The bm package redefines the \boldsymbol command providing the \bm command and is indipendent from amsmath. So you can use: \documentclass{article} ...

18

It depends on what you want the verbatim to support. If you simply want to put some normal text in "verbatim" (typewriter) font, then use \texttt. If you want to allow special characters such as _, &, or ^ to be displayed as is, then \listinline (which xport mentions) may be enough, and allows to customize the font somewhat. However, # or % will still ...

18

Fonts are identified by five attributes: encoding family series (weight) shape size For the first four attributes, LaTeX maintains "default" definitions, contained in \encodingdefault \familydefault \seriesdefault \shapedefault but also other commands Family defaults: \rmdefault, \sfdefault, \ttdefault Series defaults: \mddefault, \bfdefault Shape ...

17

It looks like you are trying to change the sections font to sans serif and usual bold letters. If you want it to be in sans serif through out the document, then you can do it with sectsty package. \documentclass{article} \usepackage{sectsty} \allsectionsfont{\bfseries\sffamily} % <---- omitting \bfseries still gives bold font \begin{document} ...

17


16

Here's an idea using expl3: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{expl3,xparse} % turn expl3 space on: :' and _' are letters now and spaces % are ignored. To insert a space use `~'. \ExplSyntaxOn % declare a new sequence variable: \seq_new:N \l_pouya_boldfirst_seq % the internal command: \cs_new:Npn \pouya_boldfirst:n #1 { ...

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