Announcement

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

  • Printing SMCL files

    Hi,

    I have written commands and comments in a do-file that are long. And, fortunately, when I print out the do-file the lines are automatically broken into multiple lines (without using /// half way through a long line). However, when I log the commands and the results (using SMCL format) the same does not happen and many lines are out of border.

    Is there any way to address this (aside from using ///)?

    Thanks,
    Navid

  • #2
    log2html (SSC) has a linesize() option that may help.

    Comment


    • #3
      I had much frustration with the same issue when I began my work with Stata. I eventually abandoned SMCL logs for text logs for various reasons, so what I write below may not be remembered correctly. And I should mention that I use Stata 13.1 for Macintosh.

      My experience with Stata's printing of SMCL (as opposed to do-files) was that Stata wraps the printed lines at exactly the same place they are wrapped in the window in which you are viewing them when you issue the print command. So however you are viewing and printing the logs, if you reduce the width of the window in which they are displayed prior to printing appropriately (and if you're in the Viewer, refresh after making the change), the lines will be wrapped at a shorter length. The good news is that when you're adjusting the width of the window, Stata displays the number of columns and lines in the window as you're making the change, so once you find something that works, you can reproduce it later.

      There is a bit more information in help log, along with the following discussion.
      set linesize specifies the maximum width, in characters, of Stata output. Most commands in Stata do not respect linesize, because it is not important for most commands. Most users never need to set linesize, because it will automatically be reset if you resize your Results window. This is also why there is no permanently option allowed with set linesize. set linesize is for use with commands such as list and display and is typically used by programmers who wish the output of those commands to be wider or narrower than the current width of the Results window.

      Comment


      • #4
        In essence, SMCL (known to be a recursive acronym for "SMCL makes cooler logs") is written for Stata's internal consumption.

        Naturally, it is reasonable also to want to use logs, or parts of them, outside Stata.

        As posted earlier, some of us built on an undocumented handle in Stata to provide an HTML translator. We stopped when we got bored, I guess; also Bill Rising now works for StataCorp.

        But when students accidentally create SMCL logs, they have acted very happy when HTML translations were imported into MS Word. I don't use Word unless I have to, but that is a different story.

        Comment


        • #5
          FWIW, when I want to share my logs (which I almost always make in .smcl) with people who don't have Stata, I usually translate them to pdf. That can be done with the -translate- command. In fact, if I know ahead of time that I'm going to be sending results out this way, I put the -translate- command into the do-file right after the -log close- command. The line breaks seem to work out reasonably well.

          Comment


          • #6
            Thanks;

            This forum is really cool.

            Comment

            Working...
            X