This is a follow up from siunitx uses math mode for symbols - workaround needed when using different fonts for math and text.

The problem has been solved thanks to David, however there is a problem remaining with tables that are generated by esttab for Stata. Esttab enters asterisks by a newly defined \sym command, i.e. \sym{*}. This is not necessary since I have redefined \sym to plain text, but esttab does not offer an option to omit the \sym command.

The problem is that siunitx does not recognise \sym as an input-symbol and the result are overfull hboxes, as the MWE below illustrates. My question is how to specify \sym{*}, \sym{**} and \sym{***} as input symbols for siunitx as I would like to avoid hacking the esttab plugin (btw, the problem is not pdfLaTeX or XeLaTeX specific).


% For Tables created by estout
\newcommand{\sym}[1]{#1} % for symbols in Table
\sisetup{ detect-mode, 
          group-digits            = false ,
          input-signs             = ,
          input-symbols           = ()[]-+* , % specifying \sym here does not work
          input-open-uncertainty  = ,
          input-close-uncertainty = ,
          table-align-text-post   = false 

  \mathcode\expandafter`\string#1"8000 }


    l @{\extracolsep\fill} *{2}{S[table-format=4.6]} @{}}
\multicolumn{1}{@{}l}{\emph{Age}}  \\[0.5ex]
18--24 &   [-1360.228]*  &  -1371.941\sym{*}  \\
       &       (6.915)\sym{**} &    (-7.953)**      \\

enter image description here

2 Answers 2

\newcommand{\sym}[1]{\rlap{$#1$}} % for symbols in Table

works for that example, as the symbols are always at the right edge of the column otherwise I'd need to look at the weekend to see what siuintx does with its symbol list.

  • That is certainly much better than before. So your solution only works when the \sym is the last element of a column? That would not be a problem as the significance values are always after a number. But is there a reason why you put the symbol into math mode (because thanks to your solution it is converted to text later).
    – Jörg
    Commented Mar 9, 2012 at 16:11
  • maths mode, not really, just habit:-) \rlap makes its content have zero width and stick out on the right so \rlap{a}b makes the a overprint the b, but at the right hand edge it just sticks into the column space Commented Mar 9, 2012 at 16:21

If you have issues with stars overlapping with the next column as I did, rewrite David's line of code to read

\newcommand{\sym}[1]{{#1}} % for symbols in Table

and it'll put the stars in the superscript and pushing the next column on the right over to make space.

  • This doesn't answer the question at hand.
    – Werner
    Commented Apr 24, 2016 at 5:33

You must log in to answer this question.

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