# Re: st: RE: Stata graphs to Latex with Graph2tex command

 From Suzy To statalist@hsphsun2.harvard.edu Subject Re: st: RE: Stata graphs to Latex with Graph2tex command Date Wed, 03 May 2006 17:01:54 -0400

Yes, you are correct. I just typed "pwd" to find out where the file was (this is the graph2tex command suggested), moved it into the correct directory and it works fine. The graph2tex command is simple and great for LaTeX newbies. Will table output by Stata also work ? If so, how explicitly is it done? I do have a a word to tex converter (Word2teX), if that helps steer a recommendation.
Thanks Maarten!

Maarten Buis wrote:

Suzy:
I am not familiar with the -graph2tex- command, what I usually do is
export the graph to an eps file with the -graph export- command, and
in my LaTeX file use LaTeX commands like the one you have showed. I have never experienced problems with those. One thing I could imagine
is that -graph2tex- saves in the current directory (type -cd- to find
out were that is) and you try to call it from a LaTeX file located in
another directory. If you include a graphic in LaTeX without specifying
a path it assumes that it is in the same directory.
HTH,
Maarten

----- Suzy wrote:
I am now trying to convert and insert a simple Stata graph using the graph2tex command. This is my Stata code below. I copied and pasted the tex code output provided by Stata into my text editor (teXnicCenter). The graph was not there. I tried adding the .eps to Stata1 to see if that would work, but it did not.
scatter Yvar Xvar, sort

. graph2tex, epsfile(Stata1)
% exported graph to Stata1.eps

\begin{figure}[h]
\begin{centering}
\includegraphics[height=3in]{Stata1}
\end{centering}
\end{figure}

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology Vrije Universiteit Amsterdam Boelelaan 1081 1081 HV Amsterdam The Netherlands

Buitenveldertselaan 3 (Metropolitan), room Z214
+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/