← Back to team overview

zim-wiki team mailing list archive

Re: Zim dokuwiki syntax, pandoc converting latex and pdf with line number!

 

Hi Sylvian,

Any improvements for the latex template are welcome, don't use it actively
myself, so won't improve without feedback from users with more latex
experience.

I guess you also had seen that zim has markdown export format that should
be compatible with pandoc ? I would imagine running that one if you want to
use the pandoc build chain.

Regards,

Jaap




On Sun, May 4, 2014 at 5:44 PM, Sylvain Viart <launchpad@xxxxxxxxxxxx>wrote:

>  Hi,
>
> Do you know the amazing pandoc? A multi text format converter.
>
> http://johnmacfarlane.net/pandoc/
>
> But it doesn't support dokuwiki yet…
> Zim's manual said: "Most of this syntax is inspired by the dokuwiki syntax"
>
> I'm playing to auto build a PDF passing a filter with Latex's magic
> inside. (numbering lines!) :-D
>
> I first tested pandoc directly on the .txt.
>
> simple PDF export (does require heavy package install under xubuntu ~
> 350MB or more)
> sudo apt-get install texlive-fonts-recommended pandoc texlive-latex-extra
>
> $ sed '1,7 d' 01.chapter.txt | pandoc -S -o out.pdf
>
> Works great even with special characters « » − …
>
> The .tex export from zim in Article template doesn't compile with such
> char.
>
> zim --export --output=o.tex --format=latex --template=Article
> ~/Notebook/Novel ":Novel:01.chapter 1"
>
> My first tests used almost no zim formating. This is for novel writing.
>
> I tested my formater against zim documentation.
>
> This formater use a modified .tex output and a \usepackage{eledmac} (many
> more MB of deb packages required to make it work) which counts line number
> in the generated pdf!
>
> Really cool…
>
>
> the part of the code which adds the latex macro for numbering lines looks
> like:
>
>     # remove Zim's header, convert speaker part too
>     sed -e '1,4 d' "$source_page" -e '/^— / a\\n' \
>         | pandoc -s -o "${basepage}.tex"
>     # edit inplace -i
>     sed -i -e '/^\\usepackage{fixltx2e}/ a\\\usepackage{eledmac}' \
>         -e '/^\\begin{document}/
> a\\\begingroup\n\\beginnumbering\n\\autopar '\
>         -e '/^\\end{document}/ i\\\endnumbering\n\\endgroup' \
>         "${basepage}.tex"
>
>     latex "${basepage}.tex"
>     dvipdf "${basepage}.dvi"
>
>
> See this generated pdf for an example. As you can see the format is broken.
>
> 30 days link: http://dl.free.fr/fniKVY1ou
>
> So, I've a question. Which Latex converter should I use?
>
> Hacking the Zim's export template? or filter the txt file to some more
> pandoc friendly syntax?
>
> Regards,
> Sylvain.
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~zim-wiki
> Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~zim-wiki
> More help   : https://help.launchpad.net/ListHelp
>
>

References