Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printing help files

    Is there a better way of turning .sthlp files (self-written) into .pdf files than something like the following (assumes unix-y environment):

    HTML Code:
    foreach topic in topic1 topic2 topic3 {
        help `topic'
        translate @Viewer `topic'.ps,  translator(Viewer2ps) replace header(off) logo(off) pagesize(A4)
        !ps2pdf `topic'.ps
        !rm `topic'.ps
      }
    This works well enough, but it's only valid in GUI Stata, whereas this is something I'd like to automate (which requires to work in console/batch Stata).

    Brendan

  • #2
    Assuming topic1.sthlp, topic2.sthlp, and topic3.sthlp are in the current directory (prepend the appropriate directory to the filename in the <b>translate</b> command otherwise), you should be able to code something like

    Code:
    foreach topic in topic1 topic2 topic3 {
        translate `topic'.sthlp `topic'.ps, translator(smcl2ps) replace header(off) logo(off) pagesize(A4)
        !ps2pdf `topic'.ps
        !rm `topic'.ps
    }

    Comment


    • #3
      Thanks, that works nicely. I had tried translator(smcl2ps) at some intermediate stage, but I must have been doing something else wrong.

      Now I have 22 help-files in PDF format, and tomorrow when I realise they are all full of mistakes I can correct and reproduce them without breaking a sweat!

      Brendan

      Comment

      Working...
      X