3 ms·
I wrote KeenWrite, a free and open-source cross-platform tool, to create Markdown-based books. KeenWrite calls out to ConTeXt to typeset the documents and uses
by thangalin 3y ago
I wrote KeenWrite, a free and open-source cross-platform tool, to create Markdown-based books. KeenWrite calls out to ConTeXt to typeset the documents and uses my KeenType fork for typesetting math while in preview mode. KeenWrite can generate PDF files from the command-line.
* https://github.com/DaveJarvis/keenwrite https://github.com/DaveJarvis/keenwrite
For example:
java -jar keenwrite.jar \
--all \
--r-dir=$PWD/bin \
--r-script=$PWD/bin/editor.R \
--image-dir=$PWD/images \
--variables=$PWD/variables.yaml \
--theme-dir=$HOME/dev/java/keenwrite/themes/boschet \
--metadata=title={{book.title}} \
--metadata=byline={{book.author.byline}} \
--metadata=keywords={{book.keywords}} \
--metadata=copyright={{book.copyright}} \
--metadata="reviewer=$1 $2, $3" \
--chapters="-14" \
--input="$PWD/chapter/01.Rmd" \
--output="${TEMP_NAME}"
That mouthful compiles the book that I'm writing. The book defines numerous variables that are referenced throughout the prose and defined in an external file. Variables can also be passed in as metadata, which tells ConTeXt various PDF properties to embed. The chapters argument allows selecting a subset of chapters to build (e.g., 1-3,5,9-15,22). Lastly, the theme directory points ConTeXt to the instructions to use when typesetting the document, which controls colours, fonts, layout, annotations, etc.
Some sample outputs:
* https://github.com/DaveJarvis/keenwrite-themes/tree/main/examples/the-mill-on-the-floss https://github.com/DaveJarvis/keenwrite-themes/tree/main/exa...