Please, before reading this page, be sure to know what StrapDown.js is
Check out index.html if you don't know yet how cool StrapDown.js is !
StrapDown2PDF is a super cool Bash script designed to print a StrapDown-powered web-page to a PDF document.
To be more precise, StrapDown.js allows you to write pretty HTML pages with the Markdown syntax (more details here index.html).
And StrapDown2PDF can be used (on your laptop, from the command line) to transform the document from HTML (writen with Markdown) to PDF (with one intermediate phasis as a LaTeX file).
This page as a PDF is a pretty good example of an automatically compiled PDF file.
Warning: this script is still experimental: the compilation is never perfect.
It is advisable to use the -keep
option, change a little bit the LaTeX file and then compile again.
You just have to use this command, in a terminal:
bash $ strapdown2pdf MyWebPage.html # This will produce "MyWebPage.pdf"
strapdown2pdf even supports multi arguments. For instance, the following command will print to PDF every StrapDown.js-flavored HTML file in the current directory:
bash $ echo "Calling 'strapdown2pdf *.html' will produce a PDF for every .html document in the current directory." $ strapdown2pdf *.html
strapdown2pdf comes with a basic help included ! Just ask with option -h
(as always):
```bash $ strapdown2pdf -h strapdown2pdf -help | [options]
Print a StrapDown-powered web-page to a PDF document, using lunamark and autotex.
Help: -h to print this help message (and quit). -v to print just the version of strapdown2pdf (and quit).
Options: -i|-interactive run PDFLaTeX with the interactive (errorstopmode) mode (default is batchmode). -q|-quiet run strapdown2pdf in quiet mode (no output at all, everything is redirected to /tmp/strapdown2pdf.log). -m|-htm run strapdown2pdf to produce a simple HTML file (which do not use StrapDown.js), written to a .htm file. For important document, producing a .htm autonomous file is a good idea. -d|-discrete run strapdown2pdf is discrete mode, without adding any creditentials in the produced document. -s[0-9][0-9]% change the default scale used by autotex (default is 85%, '-70%', '-75%' or '-80%' are good also) New! -[0-9][0-9]pt change the default police size used by autotex (default is 11pt, '-10pt' or '-12pt' are good also) New! -k|-keep keep the intermediate .tex file. New! -s|-sign sign the produce PDF document with GnuPG (thanks to PDFCompress).
strapdown2pdf v0.8 : Copyrights: (c) Lilian Besson 2011-2014. Released under the term of the GPL v3 Licence (more details on http://perso.crans.org/besson/LICENSE.html). In particular, strapdown2pdf is provided WITHOUT ANY WARANTY. ```
strapdown2pdf now comes with these options:
-interactive
(shortcut is -i
) to run PDFLaTeX with the interactive (errorstopmode) mode (default is batchmode),-quiet
(shortcut is -q
) to run strapdown2pdf in quiet mode (no output at all, everything is redirected to /tmp/strapdown2pdf.log
),-htm
(shortcut is -m
) to produce a simple HTML file (which do not use StrapDown.js, see this example strapdown2pdf.htm), written to a .htm file. For important document, producing a .htm autonomous file is a good idea,-discrete
(shortcut is -d
) to run strapdown2pdf is discrete mode, without adding any creditentials in the produced document,-s[0-9][0-9]*%
(e.g. -79%
) to change the default scale used by autotex (default is 85%, '-70%', '-75%' or '-80%' are good also),-[0-9][0-9]*pt
(e.g. -10pt
) to change the default police size used by autotex (default is 11pt, '-10pt' or '-12pt' are good also),-keep
(shortcut is -k
) to keep the intermediate .tex
file,-sign
(shortcut is -s
) to sign the produce PDF document with GnuPG (thanks to PDFCompress option --sign
).These external scripts are not really mandatory, you could do without it by modifying a couple of lines of the script's code:
These two examples (3 and 4) show how to include MathJax in a StrapDown-flavored HTML page to simply embed some LaTeX equations.
Apparently, now strapdown2pdf have a better support for any (not too complicated) $\LaTeX{}$ code embedded in the Markdown source. Any feedback is welcome, and I will continue to improve this feature.
These are from September, October and November 2014.
Make a version "on the browser" ? Something like, if index.html uses StrapDown.js, then index.html?pdf can be the same HTML page, but using javascript (like texlive.js) to autoproduce a PDF version of the page in the background, asking to download it when it is done.
An example is there. It is so cool I want to use it :)
I added a Squirt button to the two StrapDown.js theme, and therefore I guess it could be possible to do the same for a "Compile to PDF with TeXLive" button !
This project is released under the GPLv3 license, for more details, take a look at the LICENSE file in the source.
Basically, that allow you to use all or part of the project for you own business.