This is a follow up question from Using old style fonts of palatino (mathpazo) in math mode. The original problem has been solved using siunitx instead of dcolumn. However, the problem is that I am using mathpazo with osf as my main body font and eulervm as my math font. With siunitx used to decimal align tables this results in []() symbols being drawn in the math font, but the digits being drawn in the text font, as the following MWE example illustrates.
Is it possible to draw the symbols in the normal text font or redefine the mathfont for S columns completely?
\documentclass{scrartcl}
\usepackage{booktabs}
\usepackage[osf]{mathpazo}
\usepackage[euler-digits]{eulervm}
% For Tables created by estout
\newcommand{\sym}[1]{\ensuremath{^{#1}}} % for symbols in Table
\usepackage{siunitx}
\sisetup{ detect-mode,
group-digits = false ,
input-signs = ,
input-symbols = ()[]-+ ,
input-open-uncertainty = ,
input-close-uncertainty = ,
table-align-text-post = false
}
\begin{document}
\begin{tabular*}{\textwidth}{
l @{\extracolsep\fill} *{2}{S[table-format=4.4]} @{}}
\toprule
\multicolumn{1}{@{}l}{\emph{Age}} \\[0.5ex]
18--24 & [-1360.228]\sym{*} & -1371.941\sym{*} \\
& (6.915) & (-7.953) \\
25--34 & -219.216 & -240.271 \\
& (514.894) & (515.348) \\
35--44 & -310.715 & -311.438 \\
& (485.780) & (486.013) \\
55$+$ & -5.135 & [2.656] \\
& (53.267) & (533.875) \\
\bottomrule
\end{tabular*}
\end{document}
Edit: Thanks to David the problem has been solved including a fix for amsmath and extending to XeTeX. On a side note, the command for * generated by estoutshould now be simply plain text:
\newcommand{\sym}1{#1} % for symbols in Table
\newcommand{\sym}[1]{\rlap{$#1$}} % Thanks to David Carlise again.
\textsymbolsbut it depends if your text font has a minus sign, you wouldn't want a hyphen. I suppose if you are using xetex than making it use U+2212 (unicode MINUS SIGN) directly would probably work. – David Carlisle Mar 02 '12 at 11:05\sym{*}siunitx does not recognise them as symbol, even when I add*to the input-symbols list. The results are enormous amounts of overfull hboxes. Is there are way to include\symto input-symbols? (I can create a follow up question with a new MWE if that is required). – Jörg Mar 09 '12 at 14:55amsmathfix given in this answer solves another problem I just had. When using the package together with theelsarticledocumentclass, I would get the exact same "Bad mathchar" error (even though Elsevier claimed that their class would work fine withamsmath). So thanks! – mhelvens Dec 29 '12 at 17:24