Skip to content

Convert article locally

Jakob Kogler edited this page Jun 1, 2018 · 3 revisions

The following commands allow converting a .md article into a PDF or an HTML page locally.

This has two major advantages over test.php:

  • Easier workflow if you prefer working in an editor instead of writing online in the webform.
  • New images will be included and displayed, which is not possible with test.php.

Disadvantages:

  • Some Tex formulas that work with this method will not work on the e-maxx-eng website and vica versa. So be careful and test on test.php before making a commit.

Requirements:

  • pandoc (sudo apt install pandoc)

You need to be in the src directory of the repo.

To PDF:

sed -e 's@&imgroot&@../img@g;s@\\\\@\\@g;s@\(```cpp\)\s\S\+@\1@g;s@\\_@_@g' graph/mst_kruskal.md | pandoc -s -o converted.pdf

To HTML:

sed -e 's@&imgroot&@../img@g;s@\\\\@\\@g;s@\(```cpp\)\s\S\+@\1@g;s@\\_@_@g' graph/mst_kruskal.md | pandoc -s --mathjax -o converted.html

Clone this wiki locally