41

Using \AA for angstrom is not working for me. When I write 1 \AA all I get is 2 (r)A in the output. I have tried putting the curly brackets around it {\AA} but still no success. I do not know why. I have even tried changing the fonts I am using. Any help will be appreciated.

0

4 Answers 4

47

\AA is a text command which essentially becomes \r{A}; \r is the command producing the "ring accent" and is invalid in math mode. Here's a way:

\newcommand{\angstrom}{\mbox{\normalfont\AA}}

If the unit must be used also in subscripts or superscripts,

\usepackage{amsmath} % or simply amstext
\newcommand{\angstrom}{\text{\normalfont\AA}}

Following daleif suggestion, a more compact version would be

\usepackage{amsmath} % or simply amstext
\newcommand{\angstrom}{\textup{\AA}}

(amsmath is necessary, otherwise \textup doesn't change sizes in subscripts).

However, the best practice when dealing with units is to use siunitx as suggested by quinmars. The macros \si and \SI made available by it provide the correct spacing.

0
47

I'd suggest to use the siunitx package. If you want a quantity, use:

The lattice constant $a = \SI{2.0}{\angstrom}$ is ...

if you only need the unit, use:

Atomic distances are measured in \si{\angstrom}.
3
  • 8
    And you can get the real ångström character with the lmodern package and \sisetup{text-angstrom={Å},math-angstrom={\text{Å}}} with UTF-8 input. Commented Jul 28, 2011 at 9:11
  • 6
    Version 3 of the siunitx package (released on 2021-05-18) has removed \angstrom. It can be re-added manually with \DeclareSIUnit{\angstrom}{\textup{\AA}} in the preamble (using the suggestion from @egreg's answer).
    – luuk
    Commented May 20, 2021 at 9:44
  • 2
    Oh, that's unfortunate. I think Angstrom is an often used and important unit.
    – quinmars
    Commented Sep 26, 2021 at 23:27
6

@egreg answer is correct but in the community is hard to convince others (reluctant-TeX) collaborators to use \mbox{\normalfont\AA} or \text{\normalfont\AA} to write Angstrom units. At best one can hope that they use \mathrm{\AA} (so Angstrom doesn't appear as italic in math formulas). They are just too used to write \AA.

What I suggest is this:

\usepackage{amsmath}
\let\oldAA\AA
\renewcommand{\AA}{\text{\normalfont\oldAA}}
1
  • thanks, this worked wonderfully!
    – dermen
    Commented Oct 13, 2023 at 0:12
1

What caused this problem for me is that I redefined the \r command. That is, I had a

\renewcommand{\r}

in my preamble. If this is the case, change the name of the command you called \r to something else.

You must log in to answer this question.

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