Announcement

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

  • GR's STATA markdown (Markstat): problems with margins on html output

    I am using @German Rodriguez STATA markdown and I think it is wonderful. I recently am having a problem setting the margins on the html output.
    Using the first example here: https://data.princeton.edu/stata/markdown/documentation, when I run markstat, my html output has very wide left and right margins.

    Attach is an image of the html output. I am also attaching the stmd file (saved as a .do to enable me to upload the file) where I do add the following to the top
    geometry: left=20mm
    geomerty: right=20mm

    I am using STATA 16.1 on a Mac OS 10.15.7

    There is no problem when I output to Word - margins are "normal".

    Question: Is there a way to adjust the margins? My goal is to have much smaller left and right margins.

    Thank you.

    Attached Files

  • #2
    As an update, I think I am closer to being able to modify the margins on the html output. German Rodriguez has a very helpful guide on how `markstat` works. My best guess is that you need to modify the "markstat.css" file in order to change the margins of the html output. I'm not sure what to change yet, but if anyone has suggestions, that would be great. The objective is to modify the margins so that that left_margin = 1 inch and right_margin = 1 inch. I'd like to use up a lot of the white space in the html output.

    Comment


    • #3
      Ok - update. To change the margins on the html output.
      1. Find the location of "markstat.css" - this will be under the ado folder. Use `sysdir` to find the path to the ado folder. It should be in the same folder as `markstat`
      2. Open "markstat.css"
      3. Edit
      `body, table {font-family: Helvetica, Arial, Sans-serif; font-size: 14px} `
      by inserting "max-width:90em" to the expression so that it looks like
      ` to be body, table {font-family: Helvetica, Arial, Sans-serif; font-size: 14px; max-width:90em}`
      4. Save the file. When you run `markstat` you should now have an html output with smaller margins.

      Comment


      • #4
        Hi Erick Gong I am sorry I did not see your question earlier, but happy that you found a solution to your liking. Let me just add that you could also make a copy of markstat.css in your working directory with your desired changes. This way you could use project-specific custom styles.

        Comment

        Working...
        X