# siunitx does not work with overline

When I am typing a laboratory for physics, I tried using \overline inside SI from the siunitx package, like so:

\begin{align}
\begin{split}
s &= \frac{d}{t}\\
&= \frac{\SI{1.15}{m}}{\SI{1.43}{s}}\\
&= \SI{0.\overline{804195}}{m/s}
\end{split}
\end{align}


But it seems that it does not work when you have \overline inside SI, does anyone know how to fix this?

-

## migrated from stackoverflow.comFeb 8 '13 at 10:05

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Feb 8 '13 at 15:09

You can also set the number parsing off temporarily.

\documentclass{article}
\usepackage{amsmath,siunitx}

\begin{document}
\begin{align}
\begin{split}
s &= \frac{d}{t}\\
&= \frac{\SI{1.15}{m}}{\SI{1.43}{s}}\\
&= \SI[parse-numbers=false]{0.\overline{804195}}{m/s}
\end{split}
\end{align}
\end{document}


-

This does sort-of defeat the purpose of using siunitx, but it's possible with some box manipulation:

\documentclass{article}
\usepackage{siunitx,amsmath}% http://ctan.org/pkg/{siunitx,amsmath}
\begin{document}
\begin{align*}
s &= \frac{d}{t} \\
&= \frac{\SI{1.15}{m}}{\SI{1.43}{s}} \\
&= \rlap{$\phantom{0.}\overline{\phantom{804\,195}}$}\SI{0.804195}{m/s}
\end{align*}
\end{document}


I've pre-set an invisible 0.804\,195 with a visible \overline (only over the necessary part) using a right overlap (a zero-width, left-aligned box). After this, \SI sets things as usual, this time "underneath" the \overline so it looks appropriate.

-