3 ms·
My Typesetting Markdown series[1] describes crafting shell scripts to cobble together pandoc, knitr, math, ConTeXt, and YAML-based interpolated variables to pro
by thangalin 3y ago
My Typesetting Markdown series[1] describes crafting shell scripts to cobble together pandoc, knitr, math, ConTeXt, and YAML-based interpolated variables to produce PDF files.
For my sci-fi novel, my character sheet was inside of a spreadsheet. It dawned on me that the character sheet could be replaced with a YAML file and integrated with a Markdown editor. I developed KeenWrite[2] to replace the scripts while allowing me to use interpolated variables and R inside of the prose.
My novel has two separate timelines and I wanted to make sure that dates lined up correctly without having to do the date math manually. I implemented a number date functions in R[3] based around an "anchor" date. As long as all my other dates are relative (in days) to the anchor date, all the math checks out. Possessives and pronouns are also handled in R (meaning I can change a character's gender by changing a single variable, provided I haven't referenced any sex-specific body parts or characteristics).
Also, I wanted a nice-looking PDF file to send to alpha readers (still looking, see profile). For that, I crafted KeenWrite Themes[4] along with a video tutorial series showing how all the software components work together.
On the technical side, Markdown lacks a standard syntax for citations and cross-references. I've written about this at length.[6] If flexmark-java were to get support, then it would help resolve a long-standing issue with KeenWrite.[7]
[1]: https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdown-part-1/ https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdow...
[2]: https://keenwrite.com/ https://keenwrite.com/
[3]: https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/R/conversion.R?ref_type=heads#L52 https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/R/conver...
[4]: https://gitlab.com/DaveJarvis/keenwrite-themes/ https://gitlab.com/DaveJarvis/keenwrite-themes/
[5]: https://www.youtube.com/playlist?list=PLB-WIt1cZYLm1MMx2FBG9KWzPIoWZMKu_ https://www.youtube.com/playlist?list=PLB-WIt1cZYLm1MMx2FBG9...
[6]: https://talk.commonmark.org/t/cross-references-and-citations/4013 https://talk.commonmark.org/t/cross-references-and-citations...
[7]: https://gitlab.com/DaveJarvis/KeenWrite/-/issues/145 https://gitlab.com/DaveJarvis/KeenWrite/-/issues/145