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: sjlog with variable names containing underscores

From   Maarten buis <>
Subject   Re: st: sjlog with variable names containing underscores
Date   Sun, 14 Nov 2010 17:12:30 +0000 (GMT)

--- On Sun, 14/11/10, Venablewrote:
> I really like the sjlog command for creating
> latex-compatible log files.
> However, I am having a small problem:
> I frequently use underscore characters in variable names,
> and LaTeX interprets underscore as "start doing math and
> begin a subscript."

You can replace all these occurances of _ in Stata using
the -filefilter- command, like so:

*--------------------- begin example -------------------
cd c:\temp
use, clear
clonevar race_clone = race
sjlog using desc_hsb2, replace
sjlog close, replace

filefilter desc_hsb2.log.tex desc_hsb2_.log.tex, ///
    from("_") to("\BS_") replace
*---------------------- end example ---------------------

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

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