Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: log2html smcl formatting TOC


From   Jakob Petersen <jpeterb@essex.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: log2html smcl formatting TOC
Date   Thu, 11 Aug 2011 12:38:21 +0100

Thanks a lot for the advice - the ideal solution would in many cases be to 1) capture the required data using commands such as -file- or -postfile-; and then 2) either design the final output based on these data; or 3) export the results into e.g. RTF or Latex formats.

-log2html- could in this example be used as a quick if limited work-around;

*****************************************************************************
qui {
cap log close
log using sysdirvars,replace
sysuse dir
local allfiles "`r(files)'"
foreach f of local allfiles {
sysuse "`f'", clear
ge file=upper((subinstr("`f'"),".dta","",1))
n di as text _newline file
n descsave, list(name varlab, clean noobs)
}
log close
}
log2html sysdirvars, replace title(Variables in Example Files) input(FFFFFF)
*****************************************************************************

Jakob

On 10/08/2011 19:57, Nick Cox wrote:
I don't think this is the point Jacob is raising. Such commands will
still appear in the log.

But Billy is pointing in a key direction.

Rather than fixing the log, or more generally the output,
retrospectively, write a program to produce the output you want (and
nothing else).

It is difficult to work out the trade-off, but I wonder how many spend
time wrestling with the intricacies of the highly flexible
output-management tools when they could have more quickly written a
script to produce precisely the output they need in the form they need
it. The choice between learning how to use others' programs and
learning how to write your own is probably difficult for us all.

Nick

On Wed, Aug 10, 2011 at 7:11 PM, Billy Schwartz<wkschwartz@gmail.com>  wrote:
Simply to hide input text, quite -quietly- blocks. If you want
headings inside a quietly block, use -noisily display- and put in some
info about what command is running.


On Wed, Aug 10, 2011 at 10:41 AM, Jakob Petersen<jpeterb@essex.ac.uk>  wrote:
I would like to produce summary statistics for a batch of files.
I am using log and log2html to format the results and have a couple of questions;

****************************************************************
cap log close
log using sysdirvars,replace

sysuse dir
local allfiles "`r(files)'"
foreach f of local allfiles {
sysuse "`f'", clear
di _newline "{title:`f'}"
di "{title:Variable list}"
descsave, list(name varlab, clean noobs)
}

log close
log2html sysdirvars, replace title(Variables in Example Files)
****************************************************************

1. Is it possible to suppress [input] from being printed in the log file (other than by changing the colour to white)?
2. Is it possible to format the headers in this example such that they could be used when creating a table of contents in a word processor (heading 1, heading 2, etc.)?

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



--
Kind regards,
Jakob


/*
Jakob Petersen
Institute for Social and Economic Research (ISER)
University of Essex, Colchester, Essex CO4 3SQ, UK
T: +44 (01206) 873683
E: jpeterb@essex.ac.uk
www.iser.essex.ac.uk
*/

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index