Currently I think the best solution is a headless browser, I use chromium+puppet, plus polyfills like paged.js. Now I can finally have most of the CSS paged media features, including page references.
Then there is the topic of word hyphenation. Chrome technically supports it through CSS, but in practice that is harder to achieve, afaik due to problems with distributing the dictionaries. There are again polyfills. I also think there should be a way to train a neural net on existing hyphenations to hyphenate virtually anything else in a sensible fashion, including fantasy words.
Without hyphenation, text justification doesn't work properly. It's also a good way to save space in tabular layouts, even if just for display on-screen.
I don't really know any other solution, so I cannot really compare. But I would assume that for any other solution, you also would have to learn how to handle it, and not sure if that is really simpler and less effort than LaTeX.
Subjectively I'd much rather generate reports/bills/etc through HTML than LaTex, though it is undoubtedly possible.
Repository: https://github.com/mbutterick/quad
Documentation: https://docs.racket-lang.org/quad/
Org-mode can be thought of as a wrapper around LaTeX. Content in Orgmode is way more human readable than writing entirely in LaTeX. It is great for prototyping, enabling you to get results quick and fast and also plays well with version control. The produced document can also contain Table of contents, cross-references etc. There is also the possibility to generate an intermediate LaTeX file where you can fine tune the typography and layout. To make the most of it though, you will need to learn a bit of LaTeX.
Definitely worth a try if someone is looking for something simpler than totally committing to LaTeX, but like me would rather avoid HTML + CSS pain points.
Also CSS has gotten a whole lot better.
[0]: https://pandoc.org/
What applications are most common these days in the publishing industry? Adobe Indesign? Quarkxpress?
In particular, what I dislike about all other static generators is they come with their own templating language, which is usually limited, stupid and broken in various ways. I just want to mix Python and Markdown, but have the code replaced with its output, to make it easy to build more complicated structures.
Maybe I'll just write something myself...
> “I wrote the initial version of Pollen in Python. I devised a simplified markup-notation language for the source files. This language was compiled into XML-ish data structures using ply (Python lex/yacc). These structures were parsed into trees using LXML. The trees were combined with templates made in Chameleon. These templates were rendered and previewed with the Bottle web server.
> “Did it work? Sort of. Source code went in; web pages came out. But it was also complicated and fragile. Moreover, though the automation was there, there wasn’t yet enough abstraction at the source layer. I started thinking about how I could add a source preprocessor.”
[1] https://docs.racket-lang.org/pollen/Backstory.html#%28part._...
It's a pretty neat system and worth learning before you head off to invent your own wheel.
In general, you'll want javascript-assisted solutions working in the browser, and then some pre-processing in Python, depending on your needs.
While I write my blog in markdown it's super nice to be able to mix real code with in your markup language. For example if you want to create a special layout for a specific page or if you want a table with subtly different properties than the rest, it's easy.
It's also very powerful to extend the markup itself. I added support for Tufte style sidenotes[2] which I use extensively throughout the book. This is the markup for the sidenotes:
Lisp is a pretty nice◊sn{cult} language.
◊ndef["cult"]{
Some may say it's the language to rule them all.
}
The way it uses X-expressions to represent text is really intuitive and easy to work with. I do think there's merit to do this in lisp instead of say Python, because the modeling maps so well to lisp.[1]: https://whycryptocurrencies.com/
[2]: https://www.jonashietala.se/blog/2019/03/04/pollen_sidenotes...
Your book looks lovely, very much in the style of practicaltypography.com. Perhaps I'll follow along, despite being, as you put it, a "cryptocurrency skeptic".
I'm not sure if fixing this would look better than leaving it as it is (I'm not a typographer), but the "jumping" of the main body during the transitions to (and from) the rare pages that don't have side-notes, feels slightly jarring.
I didn't realize it before, but flipping through them I think you're right. I'll make sure to adjust them for consistency.
Edit: Practical typography is obviously a big inspiration. I also use two of his fonts (Century Supra and Concourse).
I do like the idea of having the ability to manipulate an AST of the book’s contents. Sometimes it’s difficult to do free-form text manipulation in Latex, which means solving the problem in other ways.
In that respect, would something like asciidoc work better as a common source file?
Pollen supports LaTeX as a backend, so that's a way to consider.
Repeating syntax and formatting books is hard, but authors struggle the most with writers block, creating stories, sourcing content for nonfiction, etc. Once much of this hard work is done, a lot of the good ones will partially hand off formatting to an editor/publisher. Of course they'll work closely with them, but whether that work is done in MS Word vs a Programming language is the secondary.
The majority of these docs are clearly aimed at programmers who are interested in MB's though process and why the data model is clean, as opposed to what life of an average author (or best-selling author) looks like, and how the tools will help them write better books.
Wishing the best for this project. Perhaps a version of it could be sold to publishers?
And I wouldn't bet on unquestioning support from developer authors/editors either.
To be harsh, this is one of those projects where someone who doesn't understand how key parts of an industry work has decided that their "I made a command-line content build system in $interesting_language!" solution is superior to absolutely everything that already exists - based solely on their own opinion.
Professional peer review would not be kind about this.
Both have tons of extensions for including all sorts of media and content you need, including musical charts, maps, formulas, plots, tables etc., and can be extended to include virtually everything you want.
The route from Sphinx/Jupyter to pdf/prints leads either via LaTex or via a headless browser. The latter option seems to have more potential though. HTML+JS now can render anything. Including rendering math formulas, 3D graphics, still shots from videos.
How well does it handle page numbers and an associated table of contents?
CSS grids and Flexbox are very useful.
Also, due to javascript it is really easy to incorporate custom layout logic. There are even several ways to use Knuth-Plass text justification.
Also there are libraries to perform linear constraint resolution, google for cassowary, kiwi or gss(constraint css).
From pollen to practical typography to his fonts and back to racket lessons. While I don't know the timeline of publishing, it seems each fit as a part of his path towards a goal, and he did the reader a service by publishing the meta-work. I see his racket lessons and pollen as the side result of goal to write his books, and so then became works themselves.
More generally though, although you can make printed books with Pollen, they are not a core part of Pollen's value proposition. Pollen was created specifically so that books published on the web could be done well. The very first sentence of the documentation says "Pollen is a publishing system that helps authors make functional and beautiful digital books."
Xe(La)TeX has been around for a while[0] and allows for Unicode.
[0] 2004 for Mac, and 2007 cross-platform.