Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: smcl question


From   "Joseph Coveney" <[email protected]>
To   "Statalist" <[email protected]>
Subject   Re: st: smcl question
Date   Sun, 11 May 2008 17:08:02 +0900

Jeph Herrin wrote:

I'm trying to understand why the followin SMCL produces
not one but TWO page breaks, when the postscript translator
is applied:

 {smcl}
 {com}{sf}{ul off}{smcl}
 {com}{sf}{ul off}{newpage}
 {smcl}
 {com}{sf}{ul off}{smcl}


All I'm doing is writing the {newpage}, but apparently
opening and closing the log file produces the other tags.

--------------------------------------------------------------------------------

Jeff, how are you producing the log file?

With any of the three types of -display- (nothing, -_asis- and -in smcl-) in
either of the two do-files below (logged from a called program or logged
directly from the do-file), the PostScript file produced from the SMCL
directives above only has at most a single page break, i.e., has one or two
pages in total when read by GSview (Version 4.8 on Windows XP Pro, SP3).

Joseph Coveney

Log created from within a called program:

clear *
set more off
program define printem
   version 10
   syntax , LOGfile(string) [type(string) REPLACE]
   capture log close
   quietly log using "`logfile'.smcl", smcl `replace'
   display `type' "{smcl}"
   display `type' "{com}{sf}{ul off}{smcl}"
   display `type' "{com}{sf}{ul off}{newpage}"
   display `type' "{smcl}"
   display `type' "{com}{sf}{ul off}{smcl}"
   quietly log close
end
foreach type in nothing _asis "in smcl" {
   printem , log("`type'") ///
     type(`=cond("`type'" == "nothing", "", "`type'")')
   translate "`type'.smcl" "`type'.ps"
}
exit

Log created directly in a do-file:
clear *
set more off
*
capture log close
quietly log using nothing.smcl, smcl replace
display "{smcl}"
display "{com}{sf}{ul off}{smcl}"
display "{com}{sf}{ul off}{newpage}"
display "{smcl}"
display "{com}{sf}{ul off}{smcl}"
quietly log close
translate nothing.smcl nothing.ps, replace
*
quietly log using _asis.smcl, smcl replace
display _asis "{smcl}"
display _asis "{com}{sf}{ul off}{smcl}"
display _asis "{com}{sf}{ul off}{newpage}"
display _asis "{smcl}"
display _asis "{com}{sf}{ul off}{smcl}"
quietly log close
translate _asis.smcl _asis.ps, replace
*
quietly log using "in smcl.smcl", smcl replace
display in smcl "{smcl}"
display in smcl "{com}{sf}{ul off}{smcl}"
display in smcl "{com}{sf}{ul off}{newpage}"
display in smcl "{smcl}"
display in smcl "{com}{sf}{ul off}{smcl}"
quietly log close
translate "in smcl.smcl" "in smcl.ps", replace
exit


*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index