SVG is part of the standard, but not well supported by all epub reading systems. Some displays will fail, some will display as small non-scalable images. Apple's iBooks reader is one of the better ones in that regard.
Writing a Book with Pandoc, Make, and Vim
11–20 of 61 posts
Re: Writing a Book with Pandoc, Make, and Vim
#12Can you refer to figures and have the name rendered? For instance, a piece of text referring to a figure and the figure’s label will both get rendered to “Figure 2.8” regardless of paragraph edits and figures inserted or delete before it?
Re: Writing a Book with Pandoc, Make, and Vim
#13Can you refer to figures and have the name rendered? For instance, a piece of text referring to a figure and the figure’s label will both get rendered to “Figure 2.8” regardless of paragraph edits and figures inserted or delete before it?
I prefer to use the Asciidoctor toolchain, but it's compatible with Acsiidoc.
Re: Writing a Book with Pandoc, Make, and Vim
#14The commercial cloud based solutions (Gitlab, Confluence, et al) are pretty good, but you have to keep paying or your documentation disappears. Self hosted Wiki or documentation solutions were also out, due to the pain of migrating content in and out.
We ended up with a very simple solution of Markdown + CSS + Pandoc + make. Pandoc takes the CSS and MD files as input, and outputs HTML. The MD files are in the API repository, deployment has been setup so that the latest documentation is deployed automatically with each API update.
Re: Writing a Book with Pandoc, Make, and Vim
#15 $ pandoc --filter pandoc-citeproc --csl ieee.csl --bibliography=paper.bib --smart --normalize -f markdown+multiline_tables+inline_notes -t html5 -V margin-top:0.5in -V margin-bottom:0.5in -V margin-left:0.5in -V margin-right:0.5in -o output.html input.md
$ python3 -c "from weasyprint import HTML; HTML('output.html').write_pdf('output.pdf', presentational_hints=True)"
For LaTeX-style math equations I added mathjax-pandoc-filter² as filter to the pandoc args: --filter ~/node_modules/.bin/mathjax-pandoc-filter -Mmathjax.centerDisplayMath -Mmathjax.noInlineSVG
¹ https://weasyprint.org/
² https://github.com/lierdakil/mathjax-pandoc-filterRe: Writing a Book with Pandoc, Make, and Vim
#16Pandoc is great. make and vim are great too, but as you can see these tools will produce PDF files, HTML files, text files, markdown files and a lot jargon that the readers simply aren’t interested in. I mean normal readers here and not tech folks holed up inside a terminal with a homebrew theme.
Re: Writing a Book with Pandoc, Make, and Vim
#17I was building a new API recently, and was looking for a good documentation solution. The commercial cloud based solutions (Gitlab, Confluence, et al) are pretty good, but you have to keep paying or your documentation disappears. Self hosted Wiki or documentation solutions were also out, due to the pain of migrating content in and out. We ended up with a very simple solution of Markdown + CSS + Pandoc + make. Pandoc…
Re: Writing a Book with Pandoc, Make, and Vim
#18It's even possible to replace (Xe)LaTeX with weasy¹, a Python HTML-to-PDF converter. It supports two-colums via CSS, automatic CSS hypens, CSS page counters and embedding SVGs. I just needed an HTML header with CSS in the markdown file. $ pandoc --filter pandoc-citeproc --csl ieee.csl --bibliography=paper.bib --smart --normalize -f markdown+multiline_tables+inline_notes -t html5 -V margin-top:0.5in -V margin-bottom:0…
But it doesn’t replace LaTeX, as it doesn’t produce the same results. A glance at the sample documents reveals the ugly typography resulting from the word-processing layout strategy employed in web browsers. This is confirmed in the documentation. So this could be useful if you have an existing set of HTML pages that you need to convert to PDFs, but, if you’re starting a project where you want to produce both HTML and PDF, this should not be part of the solution.
Re: Writing a Book with Pandoc, Make, and Vim
#19It's even possible to replace (Xe)LaTeX with weasy¹, a Python HTML-to-PDF converter. It supports two-colums via CSS, automatic CSS hypens, CSS page counters and embedding SVGs. I just needed an HTML header with CSS in the markdown file. $ pandoc --filter pandoc-citeproc --csl ieee.csl --bibliography=paper.bib --smart --normalize -f markdown+multiline_tables+inline_notes -t html5 -V margin-top:0.5in -V margin-bottom:0…
pandoc --pdf-engine=weasyprint -t html …Re: Writing a Book with Pandoc, Make, and Vim
#20Here's how I generate PDF with pandoc+xelatex [1] I use gvim as my editor and have mapped a key (which then executes a shell script) to generate the book.
[0] https://cmichel.io/how-to-create-beautiful-epub-programming-...
[1] https://learnbyexample.github.io/tutorial/ebook-generation/c...