Bookmark and Share

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


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

Re: st: RE: RE: export graphs to pdfs with option to append pages?


From   "Roger B. Newson" <[email protected]>
To   [email protected]
Subject   Re: st: RE: RE: export graphs to pdfs with option to append pages?
Date   Fri, 24 Jan 2014 12:01:56 +0000

To add to this, you can substitute "Histo.tex" for "Histo.txt", and use the \input command in your main TeX file to import Histo.tex. And so save a bit of manual cutting and pasting.

Best wishes

Roger

Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology, Occupational Medicine
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
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

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

On 24/01/2014 10:37, MacLennan, Graeme wrote:
To add to David's comments, you can do this using Stata/latex combo easily.  Baby example providing a histogram per page (you can make this a sophisticated as you like)

*** begin ***

set more off
foreach q of varlist q* {
histogram `q'
graph export `q'h.pdf, replace
}

file open myfile using "Histo.txt", write replace
foreach q of varlist q* {
file write myfile "\begin{figure}[h!]"  _n ///
"\caption{""`q'""}"  _n ///
"\centering"  _n  ///
"\includegraphics{""`q'""h.pdf}" _n ///
"\end{figure}" _n  ///
"\clearpage"  _n
}
file close myfile
set more on

*** end ***

You then just need to \insert the Histo.txt file into your tex file, which of course can write and compile directly from Stata also.
HTH

Graeme MacLennan


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Radwin, David
Sent: 23 January 2014 22:37
To: [email protected]
Subject: st: RE: export graphs to pdfs with option to append pages?

I can't think of how to do this directly in Stata, but you could use another program to merge single-page PDFs.

Ghostscript, for example, is an open source program for various platforms, and I believe you could run it as a command line from a Stata -shell- (in Unix or Mac, at least).

http://www.ehow.com/how_6874571_merge-pdf-files-ghostscript.html
http://ghostscript.com/Ghostscript.html

David
--
David Radwin, Senior Research Associate
Education and Workforce Development
RTI International
2150 Shattuck Ave. Suite 800, Berkeley, CA 94704
Phone: 510-665-8274

www.rti.org/education


-----Original Message-----
From: [email protected] [mailto:owner-
[email protected]] On Behalf Of Sui Zhang
Sent: Wednesday, January 22, 2014 8:19 PM
To: [email protected]
Subject: st: export graphs to pdfs with option to append pages?

Dear All,

I need to generate a large amount of graphical reports routinely.
Right now, I need to combine pages in Acrobat after exporting graphs
to single- page pdfs. I wonder if there's an easier way to generate
multi-page pdfs directly in Stata.

Thank you so much



--
Sui Zhang

Research Data Analyst
Mental Health Services and Policy Program Feinberg School of Medicine
Northwestern University
Tel: 312-503-1130


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
The University of Aberdeen is a charity registered in Scotland, No SC013683.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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