Statalist


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

st: fix for (gr)log2html


From   "N. Askitas" <[email protected]>
To   [email protected]
Subject   st: fix for (gr)log2html
Date   Sun, 11 Jan 2009 13:23:55 +0100

I recently needed an integrated quick pdf report of stata analysis  
together with
graphs to communicate to my coauthor and came across grlog2html. I did  
the necessary
code archeology handpicking the code from here
http://www.stata.com/statalist/archive/2006-05/msg00656.html
and after one or two successful runs it died on me with the unbalanced  
quotes error.

I am writing because of this post below although do2htm maybe solving  
the problem
(haven't tried it yet). Nonetheless...

http://www.stata.com/statalist/archive/2008-11/msg00723.html

I fixed the problem for me so I am writing to share this with you. The  
code is below.
I added the fix right before the  comment line "// catch continuation  
lines". What it does is
it substitutes any of ` { and "  with theit html codes. I suppose this  
avoids the insufficient
stata code in log2html or grlog2html which comes somewhere afterwards  
and is responsible
for the errors. My ideas was if it is going to become html anyway we  
might as well html-ize
the "difficult" chars early on....

// fix
       local line: ///
    subinstr local line "`" "&#96;", all
       local line: ///
    subinstr local line "{" "&#123;", all
       local line: ///
    subinstr local line `"""' "&#34;", all
// fix
       // catch continuation lines

  Nikos


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index