0

I used to use

{\rm \&}

for ampersands in the bibliography, but it is deprecated, and leads to an error with scrbook document class.

If I remove the "\rm" it looks like this:

enter image description here

But what I want is this

enter image description here

but actually better in italic.

2
  • 2
    \rm hasn't been defined by default in latex since 1993, use \textrm{\&} but the form you show is the usual italic form in most fonts. Commented Nov 11, 2019 at 15:47
  • 2
    This question also deals with ampersands in an italic environment: Ampersand symbol algorithm environment Commented Nov 11, 2019 at 15:54

1 Answer 1

1

The italic version of the ampersand in Computer Modern just looks like the first picture you posted. But you could use the slanted version of it:

\documentclass{article}
\begin{document}

\&               % or {\upshape \&}
{\itshape \&}
{\slshape \&}

\end{document}

enter image description here


Edit

If you want to change the appearance of & in the whole document to it’s non-italic version, you could make use of this answer. For example as follows:

\documentclass{article}

\makeatletter
\DeclareRobustCommand*{\&}{%
  \nfss@text{%
    \upshape\symbol{`\&}%
  }%
}
\makeatother

\begin{document}

\textit{one \& two}

\textbf{one \& two}

\texttt{one \& two}

\end{document}

This way, the & will always be non-italic, but bold face or changing to another font will still work. However, take care that this may lead to bad kerning (especially between the non-italic & and an italic letter that follows) and, of course, it prevents you from entering an italic &. Also, it is possible that this breaks due to incompatibilities in certain situations.

6
  • The slshape is working. However, \rm actually creates the 2nd symbol, which must be the default at that spot. Is there a way to override the default and make it not italic?
    – Christian
    Commented Nov 26, 2019 at 17:22
  • 1
    \textrm actually sets the font family to a roman (= serif) font, regardless of its shape (italic or not). You can use {\upshape \&} to achieve this effect. Do you want to override the default shape for the whole document at once? Commented Nov 26, 2019 at 19:04
  • Actually, overriding for the whole document would be even better! That way I would not have to mess with my bib files.
    – Christian
    Commented Nov 27, 2019 at 9:58
  • Overriding in the whole document does not work for me, it seems to mess up other stuff relation to caption tables. ! You can't use `\spacefactor' in vertical mode.
    – Christian
    Commented Nov 27, 2019 at 18:23
  • 1
    That’s what I feared would happen. Actually, it is probably a bad idea to override a character, because it can be used in several different ways and some of them may break. It is nearly impossible to tell in advance where it could break. So, it will be probably better if you avoid such overriding and just use “search and replace” to solve your problem. Commented Nov 27, 2019 at 18:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .