Live data from Hacker News

Brian Kernighan on the Typesetting of “The Go Programming Language” Book

rkrishnan.org

61–70 of 76 posts

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#61
post #57

HTML with CSS with lend itself to generate PDFs. Are there open alternatives to Prince XML? Browsers don't support all page-layout related CSS2/3 attributes, like a page break.

wkhtmltopdf has some extensions for forcing a page break etc.

I used it for generating some documents from a groundup rebuild of bootstrap meant purely for printing (meant we could just use a lot of the web templates with minor changes) and it worked pretty well for our uses.

PrinceXML however is in a class of its own (as you'd expect for $3.8k per server)

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#62
post #52
post #15

As a typesetting aficionado, I have tried most of the suggestions here (Prince, Troff, Lout, Docbook XML, Asciidoc, LaTeX, ConTeXt, .. except GUI typesetting tools.) TeX appears bad from a distance, mostly from hearsay, until you have to write an actual technical book of certain expected high production standards and you realize TeX gives you the best shot at doing so. There is a learning curve. It is an investment o…

Of recent attempts at dethroning LaTeX, there's also SILE, which actually reuses some LaTeX internals. For some examples of the output (hard to find, the author seems not great at marketing), see e.g.: https://github.com/simoncozens/sile/blob/master/examples/ara... https://github.com/simoncozens/sile/blob/master/examples/art... https://github.com/simoncozens/sile/blob/master/examples/fra... https://github.com/simonco…

It doesn't do math though.

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#63

Life: The other thing is that although one starts with grand ideas of being clean and orderly, by the end the process is somewhat of a mess, with a complicated makefile to keep it running.

Yes! I loved that even Brian Kernighan can make a mess when trying to get something done :-) There is hope for us all!

Another way of looking at it is that, if even Kernighan can make a mess when trying to get something done, there's no hope for anyone.

Your take on it is more uplifting

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#64
post #7

Recently I've been playing with Prince [1] and I've found it to be very powerful with excellent support for paged media. Given that HTML, CSS, Javascript, SVG is used to build the document, it's also familiar to most people already. There doesn't seem to be any open source competitor to Prince though. [1]: http://www.princexml.com/

PrinceXML is excellent, we used it for many years for typesetting programs for conferences, etc. After a while, though, I picked up enough LaTeX to be competent at generating LaTeX from our applications (just as we would generate HTML or any other markup) and that's what I use for report generation now. While there are more templates to maintain, the quality of the results is absolutely worth the effort.

On a tangent, a very nice "win" with the (pdf)LaTeX approach is that it's fairly easy to collate other PDF documents into a larger one, with a custom table of contents, consistent running headers and footers, index of authors, etc., and intersperse them with other content from our database. (This was done by splitting the child documents into pages with pdftk, then inserting them as "PDF graphics" into the generated LaTeX document -- and as long as the original PDFs were searchable, they remained searchable in the final output.) In one of our paper-intensive processes (a proposal approval workflow), this approach cut down tremendously on manual labour that was being done to prepare proposal dossiers, and the resulting collation was much easier for the reviewers to work with (e.g., everyone could turn to page "K-34" in the dossier, and be certain they were looking at the same page of the same document).

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#65
post #34

Ironically this page typesets Prof. Kernighan's email in a tag so mobile users could enjoy scrolling left and right 100 times to read it.

Same here, to help future mobile readers: Hi, Ramakrishnan -- Thanks for the kind words on the typography. The core formatting is just troff (groff, really) with the -ms macro package. We tried Latex briefly but neither Alan or I care for its output, and I personally find it impossible to control. Troff is the devil I know -- it's ugly and irregular in many ways but it will put characters where you want them. The inp…

Thank you!

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#66
post #60
post #39

Earlier quoted context omitted.

It also means your documents are locked to a proprietary standard that isn't that widely used (compared to say MS Word) and as such, may not be totally recoverable 10,20 or 30 years from now. You want to keep that in mind when you choose which typesetting system to use - for the record, I keep a digital diary that I intend should still exist 50 years from now. I use only markdown, and the occasional entry that mentio…

>It also means your documents are locked to a proprietary standard that isn't that widely used (compared to say MS Word) HTML and CSS?

I assume there is some additional special sauce that enables you to do things that are not possible in a browser, which means you still won't get the exact formatting, index, etc correct.

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#67
post #15

As a typesetting aficionado, I have tried most of the suggestions here (Prince, Troff, Lout, Docbook XML, Asciidoc, LaTeX, ConTeXt, .. except GUI typesetting tools.) TeX appears bad from a distance, mostly from hearsay, until you have to write an actual technical book of certain expected high production standards and you realize TeX gives you the best shot at doing so. There is a learning curve. It is an investment o…

I liked TeX for typesetting my thesis, but I feel like, looking back, it would be nearly impossible to convert my document to a reflowable format. Not sure what can be done about that if you want nice typesetting in a fixed size environment, though. I'm curious to what extent the dual-format problem has been addressed.

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#68

For anyone missing the lede here: the book is typeset in troff. This is astonishing because troff is 40+ years old and AFAIK hasn't gotten significant development in ~10 years. If it ain't broke don't fix it. http://www.troff.org/history.html

I wrote to Kernighan a few years ago, when "D is for Digital" came out, to ask him, in effect, if troff had been made obsolete by TeX. At the time I had begun using it, and wondered if it was worth investing my time to learn. He answered that he still preferred to use groff, having tried alternatives. Since then I have used groff exclusively for writing documentation and papers. It never runs out of gas, and always p…

What platform do you write on? Linux? Mac? I'm genuinely curious.

I have been looking for substitutes to Latex ever since writing my dissertation in Latex and having to debug/tweak an already horrendous Latex .sty file. I basically decided that I would either write technical documents in Tex or not at all after that. For me, Latex is great, until it isn't, and then it's Jinga-on-a-unicycle frustration.

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#69
post #27

Earlier quoted context omitted.

Sadly I have to work in Windows at times. Context seems to not be the most supported Windows platform. (The link to the Windows simplified package is 404) There is a New Installer http://wiki.contextgarden.net/Windows_Installation_new which does not contain a working binary. The only way to find anything for windows leads to a tar file. I still think there is a better way to do typesetting in 2016 but all I have seen…

For LaTeX on Windows I enjoy http://miktex.org/ .

Well ConTex is in addition to MikTex

Re: Brian Kernighan on the Typesetting of “The Go Programming Language” Book

#70

Life: The other thing is that although one starts with grand ideas of being clean and orderly, by the end the process is somewhat of a mess, with a complicated makefile to keep it running.

Yes! I loved that even Brian Kernighan can make a mess when trying to get something done :-) There is hope for us all!

It's a lesson that things don't have to be perfect to be able to ship.
Post reply on HN