haghish / markdoc

A literate programming package for Stata which develops dynamic documents, slides, and help files in various formats
http://haghish.com/markdoc
87 stars 30 forks source link

Text formatting in markdown to pdf documents #8

Closed roblem closed 8 years ago

roblem commented 8 years ago

Fantastic package. Having formatting problems when going from stata markdown to pdf using a command like this

markdoc example, export(pdf) replace install title("Basics of Stata Markdown")

gives this pdf output

There seems to b a lack of formatting- particularly with the lack of fixed width fonts in stata output like the summary table. Do I need to specify a template?

Disclaimer: I had to install a fully statically linked version of wkhtmltopdf (due to missing system libraries) inside the Weaver ado folder since I don't have admin rights on the computer I was running this code on. Perhaps this is the source of the problem. I'll have access to another machine that I can admin in a day or two [still problems, see below].

For reference's sake, the same output, but going to docx using this command:

markdoc example, export(docx) replace install title("Basics of Stata Markdown")

gives this docx output

Formatting is great.

roblem commented 8 years ago

On Fedora 23 (Linux) creating pdf's broken:

. 
. markdoc example, export(pdf) replace title("Basics of Stata Markdown")

The switch --footer-center, is not support using unpatched qt, and will be ignored.The swi
> tch --footer-font-size, is not support using unpatched qt, and will be ignored.Unknown l
> ong argument --no-stop-slow-scripts

Name:
  wkhtmltopdf 0.9.9

Synopsis:
  wkhtmltopdf [OPTIONS]... <input file> [More input files] <output file>

Description:
  Converts one or more HTML pages into a PDF document, *not* using wkhtmltopdf
  patched qt.

General Options:
      --collate                       Collate when printing multiple copies
      --copies <number>               Number of copies to print into the pdf              
>                         file (default 1)
      --extended-help                 Display more extensive help, detailing              
>                         less common command switches
  -h, --help                          Display help
  -O, --orientation <orientation>     Set orientation to Landscape or Portrait
  -s, --page-size <size>              Set paper size to: A4, Letter, etc.
      --password <password>           HTTP Authentication password
  -p, --proxy <proxy>                 Use a proxy
  -q, --quiet                         Be less verbose
      --username <username>           HTTP Authentication username
  -V, --version                       Output version information an exit
Reduced Functionality:
  This version of wkhtmltopdf has been compiled against a version of QT without
  the wkhtmltopdf patches. Therefore some features are missing, if you need
  these features please use the static version.

  Currently the list of features only supported with patch QT includes:

 * Printing more then one HTML document into a PDF file.
 * Running without an X11 server.
 * Adding a document outline to the PDF file.
 * Adding headers and footers to the PDF file.
 * Generating a table of contents.
 * Adding links in the generated PDF file.
 * Printing using the screen media-type.
 * Disabling the smart shrink feature of webkit.

Contact:
  If you experience bugs or want to request new features please visit 
  <http://code.google.com/p/wkhtmltopdf/issues/list>, if you have any problems
  or comments please feel free to contact me: see 
  <http://www.madalgo.au.dk/~jakobt/#about>

linking wkhtmltopdf in ~/ado/plus/Weaver/wkhtmltopdf to system version yields results as in previous comment in this thread (it works but formatting less than optimal).

roblem commented 8 years ago

Going to mark this as closed, since markdown to pdf works with correct formatting on another Fedora 23 machine.

haghish commented 8 years ago

cool. The automatic installation can cause trouble in different Linux OS. But it can be handy more often than not. But glad you got it to work