6 ms·
Here are a few Markdown documents I've typeset into PDF: * https://impacts.to/downloads/lowres/impacts.pdf https://impacts.to/downloads/lowres/impacts.pdf * h
by thangalin 3y ago
Here are a few Markdown documents I've typeset into PDF:
* https://impacts.to/downloads/lowres/impacts.pdf https://impacts.to/downloads/lowres/impacts.pdf
* https://pdfhost.io/v/4FeAGGasj_SepiSolar_Highlevel_Software_Design https://pdfhost.io/v/4FeAGGasj_SepiSolar_Highlevel_Software_...
* https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdown-part-8/jekyll-hyde.pdf https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdow...
My text editor, KeenWrite[1] (see tutorials[3] for details), converts from Markdown to XHTML. The XHTML is then typeset using the ConTeXt typesetting software to create a PDF. The PDF is stylized using a theme[2].
What Markdown is missing, in particular flexmark-java, is a standard CommonMark extension for cross-references and citations[4].
[1]: https://github.com/DaveJarvis/keenwrite https://github.com/DaveJarvis/keenwrite
[2]: https://github.com/DaveJarvis/keenwrite-themes/tree/main/examples/the-mill-on-the-floss https://github.com/DaveJarvis/keenwrite-themes/tree/main/exa...
[3]: https://www.youtube.com/playlist?list=PLB-WIt1cZYLm1MMx2FBG9KWzPIoWZMKu_ https://www.youtube.com/playlist?list=PLB-WIt1cZYLm1MMx2FBG9...
[4]: https://talk.commonmark.org/t/cross-references-and-citations/4013 https://talk.commonmark.org/t/cross-references-and-citations...
- the-printer 3y agoI'd be interested in KeenWrite if it supported MacOS. Your pandoc/ConTeXt guide is top notch. ConTeXt is very underrated.
- thangalin 3y agoIt's written in Java. People have run it on MacOS. I don't have a .dmg file, though. https://github.com/DaveJarvis/keenwrite#other https://github.com/DaveJarvis/keenwrite#other If that doesn't work for you, please open an issue and describe what you'd like for MacOS.
- the-printer 3y agoI stand corrected. Thank you!
- abdullahkhalids 3y agoThis is a great opportunity to extol the superior text layout capabilities of Latex. In your third pdf [1], look at page 2, para starting from "No doubt...". Compare to the same rendered in plain latex [2]. Two problems that jump immediately. * There are six word breaks in your pdf, zero in the latex version. (well, good-nature is a compound word in the original text). * Notice the "river" [3] of spaces that runs downs from "Enfield" I have no idea why other fixed layout engines don't adopt the superior text-layout algorithms of latex. [1] https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdown-part-8/jekyll-hyde.pdf https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdow... [2] https://i.imgur.com/Rs7ai0G.png https://i.imgur.com/Rs7ai0G.png [3] https://en.wikipedia.org/wiki/River_(typography) https://en.wikipedia.org/wiki/River_(typography)
- thangalin 3y ago> There are six word breaks in your pdf, zero in the latex version. (well, good-nature is a compound word in the original text). I use ConTeXt. ConTeXt uses the same Knuth-Plass algorithm for line breaks as LaTeX. I've allowed ConTeXt to hyphenate liberally. There is a setting to control hyphenation. See lesshyphenation, morehyphenation: https://wiki.contextgarden.net/Command/setupalign https://wiki.contextgarden.net/Command/setupalign > Notice the "river" [3] of spaces that runs downs from "Enfield" ConTeXt probably has tweaks for this as well. Keep in mind, I typeset Jekyll and Hyde in 2020 and am not a ConTeXt expert; ConTeXt has had countless improvements since then. > adopt the superior text-layout algorithms of latex Pretty sure ConTeXt is capable of producing the same quality of document as LaTeX. * https://wiki.contextgarden.net/Documentation https://wiki.contextgarden.net/Documentation * https://tex.stackexchange.com/questions/36/differences-between-luatex-context-and-xetex https://tex.stackexchange.com/questions/36/differences-betwe... * https://tug.org/levels.html https://tug.org/levels.html
- gorkish 3y agoKeenWrite looks cool and useful; thanks for the reference. It does appear that the real heavy lifting in this workflow is still all done by TeX, and that Markdown (with lots of extensions) is more or less a database of blobs to feed the template engine. I would suggest the question: Is what you have at the end really a Markdown document if it has no context without KeenWrite's extensions or templates? I think the article under discussion is a bit pedantic, but I'm pretty sure the author would say that what you end up with is a KeenWrite document.
- thangalin 3y ago> I'm pretty sure the author would say that what you end up with is a KeenWrite document. Documents written in KeenWrite can be typeset using tools that already exist: * https://pandoc.org/ https://pandoc.org/ * https://yihui.org/knitr/ https://yihui.org/knitr/ * https://github.com/jfisteus/html2xhtml https://github.com/jfisteus/html2xhtml I've kept compatibility with pandoc (CommonMark) and knitr a priority; I wrote KeenWrite to replace a shell script that was calling out to those software packages. My Typesetting Markdown blog posts dive into that script and programs: https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdown-part-1/ https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdow... Further, KeenWrite only supports plain TeX, which means that the typesetting system can be any software that is TeX-compatible: LaTeX, ConTeXt, LuaTeX, ExTeX, KaTeX, etc.
- gorkish 3y agoYes I was being a bit pedantic as well! :) Seriously though I do like the workflow you've put together with KeenWrite. I have a potential application where it might be a great fit to replace some markdown->pdf workflows I have built. In my case, I use a Front Matter header to pass structured data along with the markdown to generate templated HTML which can then be "typeset" with the extensions provided by HTMLDOC or wkhtmltopdf. Thanks again for posting and replying. Pleased to make your acquaintance.
- thangalin 3y ago> Thanks again for posting and replying. Pleased to make your acquaintance. Likewise! > I use a Front Matter header to pass structured data The impetus for developing that shell script (ergo KeenWrite) was using variables in documents. KeenWrite injects structured, interpolated YAML strings back into documents by replacing Moustache syntax (or `r# ...` syntax for R docs). This means that the same structured data can be reused for multiple documents, allowing for single sources of truth and a clean separation of content from presentation. Also, variables can be used in diagrams. As for Front Matter, data can be passed in from the command line[1]: -v metadata.yaml \ --metadata="title={{book.title}}" \ --metadata="author={{book.author}}" Under the hood, KeenWrite places the metadata inside the intermediate XHTML document as <meta> tags inside the <head>. These are parsed by ConTeXt using an XSLT-like syntax that converts them into TeX instructions[2]. Do post any questions you may have on the discussions forum[3]. [1]: https://github.com/DaveJarvis/keenwrite/blob/main/docs/cmd.md https://github.com/DaveJarvis/keenwrite/blob/main/docs/cmd.m... [2]: https://github.com/DaveJarvis/keenwrite-themes/blob/main/xhtml/xml-meta.tex https://github.com/DaveJarvis/keenwrite-themes/blob/main/xht... [3]: https://github.com/DaveJarvis/keenwrite/discussions/ https://github.com/DaveJarvis/keenwrite/discussions/