Live data from Hacker News

Laying Out a Print Book with CSS

iangmcdowell.com

11–20 of 121 posts

Re: Laying Out a Print Book with CSS

#11
post #6

If the objective was not spend on design software, why not use latex?

Because conTeXt exists and is really much better at that sort of thing, having full native support for things like color, figures that GO WHERE YOU PUT (glares at latex floats). It can all kinda of fancy sidebars, infoboxes, all that InDesigny sort of stuff.

You can tell it was built from the ground up for books, and not scholarly publications. In that respect it’s actually closer to plain TeX.

It doesn’t try to be overly semantic because books are complex beasts, and there really is no useful-but-wrong simple model that doesn’t handicap you.

Like, not all books have chapters. Some have hundred of very short chapters, with multiple on a single page.

It’s also much more “batteries included”.

Basically; trying to do a book in LaTeX you end up fighting the defaults, and for some there are NO good reliable overrides.

Take a look at the manual (http://www.pragma-ade.nl/general/manuals/ma-cb-en.pdf) page 83 (numbered) 87 in the pdf. Imagine trying To the that in LaTeX.

Re: Laying Out a Print Book with CSS

#12
post #6

If the objective was not spend on design software, why not use latex?

Wouldn't surprise me if it was easier for the author to hack this together in CSS since he already knows it quite well compared to learning LaTeX. I love LaTeX, but the learning curve is more like a cliff.

Re: Laying Out a Print Book with CSS

#13
post #4

Interesting read, I find asciidoctor pdf and its theming guide extremely good to obtain nice results for books and articles, customizing it with CSS, fonts and more

Asciidoctor PDF works as long as you are ok with what you could call the general "template" it uses. You can modify details within that, but if you want to change it, other approaches are required. Last time I had to deal with it I went with DocBook5 and then used a conversion to LaTeX to "break out". I agree with the asciidoctor guys about not offering more flexibility with that "template"; they have other things to focus on and it works well for cases where no specific layout is required.

Re: Laying Out a Print Book with CSS

#14
post #6

If the objective was not spend on design software, why not use latex?

I just scrolled through the page. I think https://iangmcdowell.com/blog/book_breaks.png says it all, quite openly. For anyone who delved a bit deeper into the topic, this is horrible to look at.

Seems like I have to add some explaining words here ...

Book layout is a very complicated topic. If you look at that image and step away a bit it leaves a chaotic visual impression. Reason behind that is that if you want a visually pleasing look, all the paragraphs have to have a similar "density". That is defined by how long the words are, the spacing in the words (kerning, ligatures, font), and the spacing between the words. Latter is all across the board, even changes within the same paragraph! LaTeX has all that typesetting knowledge included, and it will actively hyphenate words to accomplish its goal. I see exactly one word being hyphenated there.

Another thing that stuck out immediately was the font selection for the all uppercase paragraph. Some fonts are just not made to be used that way and this is one of them. These curvy uppercase letters are nice to start words, but used together it is ... ugh.

Last is that leftover sentence at the top of the right side. It "validates" the separator image, so this is somewhat of a pro/contra mixed bag situation.

Professionals could probably say even more about all this, I just used LaTeX for a couple years more often and these are things I learned (to see) on the way.

Re: Laying Out a Print Book with CSS

#16
Why not Scribus?

It's FOSS, mature, and actively used for book layouts by others. It comes up in searches for "free InDesign alternative" and "foss book layout" (it's mentioned in every search result that I viewed [not many]).

I mean, perhaps it didn't fit the story that showed the blog post to be used to trail the book, but I'd have thought it would be mentioned.

Re: Laying Out a Print Book with CSS

#18
post #2

I'm pleased to see it come this far. I still need footnotes, table of contents, and indexing, but maybe someday.

Weasyprint does support all of these things actually, including footnotes. A table of contents would use references to CSS counters, and if you generate the input-HTML for weasyprint from pandoc, then pandoc can actually generate those for you. The only nontrivial thing on your list would be an index, assuming you would want to autogenerate it the way latex does, but even that seems kind of doable with a little bit of custom hacking. Pandoc can also do bibliographies through citeproc/csl. So pandoc+weasyprint is absolutely a practicable tech stack these days for science publishing, assuming you don't need latex-math and are not targeting any of those publishing outlets that give you a word template and latex style and force you to use it.

Re: Laying Out a Print Book with CSS

#19
This article completely misses the point. Proper typesetting is about achieving a consistent appearance starting from ligatures and kerning, then word spacing and hyphenation, up to entire paragraphs and pages. Each character has to be typeset considering what character came before, how many words are in the same line and other lines in the same paragraph. The choice of font is also questionable, but not the main issue except for capitalized sections.

This example from the article says it all: https://iangmcdowell.com/blog/book_breaks.png

I understand that LaTeX is convoluted and other software is expensive, but when offering an alternative, there should at least be a comparison based on the quality of typesetting.

Re: Laying Out a Print Book with CSS

#20

Why not Scribus? It's FOSS, mature, and actively used for book layouts by others. It comes up in searches for "free InDesign alternative" and "foss book layout" (it's mentioned in every search result that I viewed [not many]). I mean, perhaps it didn't fit the story that showed the blog post to be used to trail the book, but I'd have thought it would be mentioned.

Do you have experience with it yourself? I haven't tried it for several years, but it was not at all usable last time I did.

For a project like this, I think it's a good choice to go with something more declarative over a WYSIWYG tool. Latex would have been a very good choice, but only if you already happen to know it or have an interest in learning.

Post reply on HN