I'm trying to typeset the following
$Q_å=l_å \cdot m$
But LaTeX won't typeset these special or accented letters in my document! Is there a simple way to achieve this?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI'm trying to typeset the following
$Q_å=l_å \cdot m$
But LaTeX won't typeset these special or accented letters in my document! Is there a simple way to achieve this?
Names for accents change in math mode, so you should use \mathring a
as follows:
\documentclass{article}
\begin{document}
$Q_{\mathring a}=l_{\mathring a} \cdot m$
\end{document}
See the comprehensive list of symbols Table 164 for the other accent commands. Changing input encoding usually does not help for this situation.
ADDITION If your text italics and math italics agree, which is the case by default but may well change if a font package is loaded, then you can implement @daelif's suggestion as follows:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\begin{document}
$Q_{\textnormal{\itshape å}}=l_{\textnormal{\itshape å}} \cdot m$
\end{document}
I have used \textnormal
to negate any formatting from the surrounding text, inputenc
to enable input of å
directly, fontenc
to ensure a font with a good glyph, and mathtools
to ensure the size of the subscript is appropriate.
\usepackage[T1]{fontenc}
might be needed) Q_{\textit{\aa}}
, then it will be a correctly placed accent and not a composed symbol
If you're planning on using these accents in math-mode
you should use the \accents
package. For this specific example, you would use:
$Q_{\accentset{\circ}{a}}=l_{\accentset{\circ}{a}} \cdot m$
which would output:
The accents package is very useful and is well documented (see: CTAN - Accents Package)
You can use this:
\documentclass[varwidth]{standalone}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
Q_å=l_å \cdot m
\end{equation*}
\begin{equation*}
Q_{\mathring{a}}=l_{\mathring{a}} \cdot m
\end{equation*}
\end{document}
Result: