Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using estout (esttab actually) to produce a table in Latex from Stata. I'm using the dcolumn package to align the decimal places in my table.

I want to override the alignment for a single row; to be specific the number of observations row. Is there a way of doing this? Or, equivalents, if there a way to prefix each element in a row with "\multicolumn{1}{c}{" and suffix with "}", which would override the dcolumn alignment?


\caption{My Table}
Var A               &        8.68&        8.51&        8.92\\
                    &        2.42&        2.51&        2.26\\
Var B               &        2.14&        1.98&        2.37\\
                    &        1.33&        1.29&        1.35\\
Observations        &       38040&       22054&       15986\\


share|improve this question

migrated from Aug 1 '11 at 4:58

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

Someone should move this to TeX - LaTeX, you'll get quicker and better answers there. – Stéphane Gimenez Jul 30 '11 at 14:06

2 Answers 2

The excellent siunitx package would make things a bit easier.


    \caption{My Table}
                   & {Mean/s.d.} & {Mean/s.d.} &{Mean/s.d.} \\ \midrule
      Var A        & 8.68        & 8.51        & 8.92       \\
                   & 2.42        & 2.51        & 2.26       \\ \addlinespace
      Var B        & 2.14        & 1.98        & 2.37       \\
                   & 1.33        & 1.29        & 1.35       \\ \midrule 
      Observations & {38040}     & {22054}     & {15986}    \\ \bottomrule

The additional grouping with curly braces lets the concerned cell content appear as simple text and not as a number to be parsed. Details for customization in the package manual.

share|improve this answer

Have you tried playing with the layout suboption of stats? It looks like it accepts the text entry, so you might want to try something like

estout ... , stats(N , layout("\multicolumn{1}{c}{@}"))

Hm. If I try it as

    sysuse auto, clear
    reg mpg wei for
    estout , stats(N , layout("\multicolumn{1}{c}{@}"))

it seems to produce the formatting in the variables column, as well. Ah well.

share|improve this answer
The stats(.) option does work, but requires a slight modification: stats(N,layout("\multicolumn{1}{c}{@} label("Observations")) - this overrides the multicolumn wrapper around the variable name. Thanks StasK! – user870029 Aug 3 '11 at 17:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.