Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Table Export of suffix / index

From   "Roger B. Newson" <>
Subject   Re: st: Table Export of suffix / index
Date   Thu, 10 Jan 2013 14:34:31 +0000

Max might possibly like to investigate the production of LaTeX tables using the resultsset route, using the SSC packages -sdecode- and -listtab-. The -sdecode- package allows the addition of prefixes and suffixes when decoding a labelled variable to a string variable. And these prefixes and suffixes may use LaTeX code (or plain TeX or HTML). See Newson (2012).

I would be surprised if there was not a workaround using -sutex- and/or -estout-, though.

Best wishes



Newson RB. From resultssets to resultstables in Stata. The Stata Journal 2012; 12(2): 191–213. Purchase from
or download pre-publication draft from

Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

On 10/01/2013 14:18, Nick Cox wrote:
You have to use Stata to write LaTeX code, which is then interpreted
externally. Stata does not interpret LaTeX mark-up internally. Note in
particular that the $ sign is used in Stata in global macro references
(when it is not taken literally as a dollar sign). So using $ $ or $$
$$ to indicate math[s] would be difficult at best in Stata.

By the way, $CO_2$ in LaTeX gives you italic "CO", which is not
standard for chemical notation.


On Thu, Jan 10, 2013 at 2:07 PM, Meulemann  Max <> wrote:
Im using Stata 12. I d like to directly export variables label names like CO_2 or x^2 so that Latex will display them properly when I tell tabout, sutex or estout to use labels.

I tried several version like

label var x "$CO_2$"
label var x "\[CO_2\]

but I either just get a $ or $\backslash$

Is there a way to label the variable properly that latex understands it.
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index