I am using \usepackage[osf]{mathpazo} for oldstyle figures and the dcolumn package to align the contents of tables at their decimal point. The problem is that dcolumn automatically sets the aligned content in math mode which sometimes results in a strange mixture of oldstyle numbers and lining numbers.

Is there an option to set digits in math mode to oldstyle by default?

Edit: (I hope editing the post is the right way in the local Netiquette to enhance my question).

@Mico I think the siunitx package is the way to go since it allows escaping math mode in tables completely and allows using a different math font in the document. But trying to use siunitx with my tables results in the phenomenon that there is white space for digits in parentheses, when the entry has fewer digits than previous entries (most of my tables are created by the esttab plugin for Stata, by the way). The following MWE illustrates the problem:



%SFor Tables created by estout
    \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} %for symbols in Table


%   table-format=4.3,   % how is this supposed to work when we have entry with a different amount of digits?
    }   }
\emph{Age}          &                     &                     \\
\hspace{0.1cm} 18-24&   [-1360.228]\sym{*}  &   -1371.941\sym{*}  \\
                    &   (6.915)         &   (-7.953)         \\
\hspace{0.1cm} 25-34&    -219.216         &    -240.271         \\
                    &   (514.894)         &   (515.348)         \\
\hspace{0.1cm} 35-44&    -310.715         &    -311.438         \\
                    &   (485.780)         &   (486.013)         \\
\hspace{0.1cm} 55+  &      -5.135         &      [2.656]         \\
                    &   (53.267)         &   (533.875)         \\

  • It is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. Commented Feb 28, 2012 at 22:31
  • 2
    Maybe the mathastext package (not tested).
    – ienissei
    Commented Feb 28, 2012 at 22:39
  • @mico, I am aware of that, but as I tried to make clear before I need to change the font in tables where some columns are set in mathmode (and hence not OSF) by the dcolumn package, and that interferes with the style of label columns where digits are in OSF. I can upload a MEW tomorrow to clarify exactly what I mean.
    – Jörg
    Commented Feb 28, 2012 at 23:09
  • @ienissei, the mathastext works perfectly! Thank you for suggesting that.
    – Jörg
    Commented Feb 28, 2012 at 23:10

3 Answers 3


I don't know how you might achieve your objective using the functionality of the dcolumn package. Fortunately, it's fairly straightforward to do if you're willing to use the siunitx package and its S column type.

In the example below, I've taken your code and made a few changes that instruct siunitx how to deal with symbols such as parentheses and brackets. Basically, the code tells siunitx not to do anything "special" with these symbols. Note that I've moved most instructions related to the appearance of material in S columns to the preamble. The only instruction provided as an option to the two S columns is table-format=4.4, as this is likely something that will change from table to table. Doing this is, of course, mainly a stylistic or taste issue.

% For Tables created by estout
\newcommand{\sym}[1]{\ensuremath{^{#1}}} % for symbols in Table
\sisetup{ detect-mode, 
          group-digits            = false ,
          input-signs             = ,
          input-symbols           = ()[]-+ ,
          input-open-uncertainty  = ,
          input-close-uncertainty = ,
          table-align-text-post   = false 
    l @{\extracolsep\fill} *{2}{S[table-format=4.4]} @{}}
\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)        \\

enter image description here

  • I have edited my original question above to show a problem with parentheses when using siunitx
    – Jörg
    Commented Feb 29, 2012 at 12:08
  • @Jörg -- thanks for posting a detailed MWE. I've changed my answer to incorporate your tabular material, taking the liberty of simplifying the code a bit here and there.
    – Mico
    Commented Feb 29, 2012 at 13:31
  • Just a quick follow up question: what is (typographically) the benefit of putting "+" into math mode? In my 'real' document I am using eulervm as math font, so that would mix palatino with euler. Is that the correct approach?
    – Jörg
    Commented Feb 29, 2012 at 15:10
  • OK, in this case you may just want to write 55+, without putting the + symbol in math mode. I guess I've been using LaTeX for so long that I, entirely automatically, put all math-related symbols in math mode. This used to be important way back in the days when not all math-related symbols (in particular, > and <) could be guaranteed to be displayed properly outside of math mode. Old habits die hard!
    – Mico
    Commented Feb 29, 2012 at 15:18
  • I just realised that input-symbols are always printed in math mode, hence, because I am using a different math font, ()[]-+are printed in euler and the digits are printed in palatino, which does not look very nice. Is there a way to use palatino for symbols, or redefine the mathfont for S columns completely?
    – Jörg
    Commented Feb 29, 2012 at 15:55

You may consider to switch to another mathversion:



\multicolumn{3}{c}{normal tabular}\\
  1.23 & 2.66  & 0.21 \\
123.45 & 567.8 & 987.32

\multicolumn{3}{c}{oldstyle tabular}\\
  1.23 & 2.66  & 0.21 \\
123.45 & 567.8 & 987.32

Non-numbers may be displayed wrong. That's why I had to use \textrm{.}
Another possibility is to use the package rccol, which is very similiar to dcolumn. This package prints in the aktive font. So you get oldstyle-figures numbers when setting your tabular in text-mode and lining figures in math-mode. No switching to another mathversion is needed.


As mentioned in my earlier comment, you can use the mathastext package. It will allow you to typeset basic math with the same font and options as text; however, it will affect all math throughout your document (so I would only recommend it for a mainly non-technical paper that contains some occasional, short math expressions).

Have a look at the documentation file to find the options that are right for you, and play around with it a bit.

You must log in to answer this question.

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