How to combine breqn and dcolumn package?

is there a way to use both breqn and dcolumn packages? I constantly get an error message ('Missing } inserted'). Or is there any other package that breaks up equations and sets the equation number in the center of the two lines? Thanks!

• You could try siunitx in place of dcolumn. – Guho Oct 15 '15 at 20:37
• A minimal working example (MWE) is needed. – egreg Oct 15 '15 at 20:38
• To clarify, you would have to use the S column instead of the D column type, in addition to substituting \usepackage{siunitx} for \usepackage{dcolumn}. An example – Guho Oct 15 '15 at 20:41
• Thanks, Guho. I saw your answer to my previous question after asking this one.... – Christian Oct 15 '15 at 20:46

1 Answer

The problem is the use of . as the typeset separator, other separators like \cdot work OK, if you need a . the easiest is to hide it in an \mbox

\documentclass{article}
\usepackage{breqn}
\usepackage{dcolumn}
\setlength\textwidth{6cm}
\begin{document}

\begin{dmath}
1+2+3+4=5=a+b+c
=z
\end{dmath}

\begin{tabular}{lD.{\cdot}{3.2}}
aaa&123.4\\
a&1.23\\
aa&11.22
\end{tabular}

\begin{tabular}{lD.{\mbox{.}}{3.2}}
aaa&123.4\\
a&1.23\\
aa&11.22
\end{tabular}

\end{document}

• Would you anticipate any issues with using that approach in general (i.e., always placing the new separator into an \mbox)? Obviously you would need to switch back to math mode therein if need be (i.e., for your \cdot example it would be D.{\mbox{$\cdot$}}{3.2}). – Guho Oct 15 '15 at 22:27
• @Guho no if you switch back to math at that point you defeat the trick, I just used mbox to get a text . as breqn has stolen the math . and putting it back is harder and in most setups it is exactly the same character anyway. – David Carlisle Oct 15 '15 at 22:32
• Nice. That's a fairly easy workaround. Thanks. – Christian Oct 15 '15 at 23:05