Brian Kernighan on the Typesetting of “The Go Programming Language” Book
rkrishnan.org
rkrishnan.org
GNU troff is looking for a maintainer. If you’re interested, please take a look at this general information about GNU packages and being a GNU maintainer, and then email maintainers@gnu.org with a bit about your background and particular interest in this package. Thanks.
Please note that maintaining this package requires assigning copyright to the FSF, and ensuring that any future contributors also execute papers, since that is what past authors and contributors have done.
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 of your time, but it pays off.
Also, it is not like LaTeX et al are standing still in time. There are companies and teams working on improving the ecosystem everyday. I personally like ConTeXt unless I'm doing a predefined template exists (for conferences etc.,) where it makes sense to just use their LaTeX guidelines.
I still think there is a better way to do typesetting in 2016 but all I have seen are a bunch of smaller projects without much support.
Personally I would love a markup language redefined with built in PDF-X support and a simple infrastructure. Context is Ruby, Tex, and ConText. I find LaTex to work well (for the most part) but it is not very flexible but I found the MikText Package Manager as a big step forward.
This suggests that:
So it still requires Ruby and you can do Lua code.
with the new "Bash for windows", it will hopefully get easier in future.
ConTeXt is excellent if you care about design -- visual, layout, use of non-traditional typeface families, non-traditional print medium, create magazines, glossies, etc.,.
Writing a new style, class etc., for LaTeX feels like it's for "experts only". On the other hand, extending and creating new styles etc., for ConTeXt is much more natural part of creating the document.
ConTeXt is also highly programmable and extensible using Lua, XML(think machine generated catalogue).
With Metapost (graphics language), you can create highly sophistical vector diagrams. I have found pgf/tikz to be highly opinionated and it take much more upfront learning compared to metapost.
ConTeXt is also more intuitive, IMHO.
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/simoncozens/sile/blob/master/examples/par...
https://github.com/simoncozens/sile/blob/master/examples/jap...
https://github.com/simoncozens/sile/blob/master/examples/tes...
For a deeper dive, see the author's presentation at FOSDEM 2015 - I found it really amusing - from the starting line of: "I wrote a typesetting system - by mistake."
Indeed -- XeTeX (and XeLaTeX) support Unicode and OpenType fonts natively (including system installed fonts). It's a pleasure to use.
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 input was in XML, with a tag set of about 25 items for headings, paragraphs, index terms, program insertion, simple tables, and the like. A Go program converted this either into HTML for rapid viewing on the screen and potentially for an e-book version, or into troff for printing. Using XML was a mild nuisance when writing but the error checking was very helpful.
We wrote a variety of small Go programs and scripts to fix things up, including one that rewrites troff output to do vertical justification so all pages are the same height. There is also some fiddling with the generated postscript to put on printer's marks.
The fonts are Alan's choice, the result of a lot of work on his part to find them and get the right sizes and appearances. The handful of Asian characters were tough to get right; troff doesn't do wide Unicode characters properly, and there are a few places where we rewrote text to hide that fact.
The drawings are all Alan's work, using Google's drawing program. We toyed briefly with using pic but it wasn't really up to the job, and it would not have worked with HTML without a lot of work. We avoided mathematics beyond superscripts, and the tables are pretty limited; eqn and tbl would have been ok but again would not have dealt with HTML.
We should probably write a more organized description of what we did and make the tools available, though I think most readers are less interested in the process than you (and I) are. 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.
Thanks again for writing.
Brian
This would be my issue with using it. This is partly why I stay with LaTeX for our book as I can convert it to other formats if I really need to. I find LaTeX gives me more control over presentation & type-setting than web-based stuff as well.
In a past life I was a print designer relying on Adobe software for everything, and it is tremendously liberating to be able to leave that world of vendor-lock-in behind (InDesign has a nasty habit of making each new version's files incompatible with previous ones). So compared to where I'm coming from, Prince (even as proprietary software) is a big step forward because it allows me to work in open formats.
[1]: http://www.getty.edu/publications/romanmosaics
[2][PDF, 8MB]: http://www.getty.edu/publications/romanmosaics/assets/downlo...
HTML and CSS?
Wikipedia lists some of what Prince does that others don't:
https://en.wikipedia.org/wiki/Comparison_of_layout_engines_(...
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).
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.…
Your take on it is more uplifting
For example, our book is 308,000 words and 32 chapters. By the time it's done it'll probably be ~310-325k plus index. LaTeX means I can change one line in the header and have the build completely re-typeset the book according to those parameters programmatically, and it does a _very_ good job.
Re: index - how do you generate an index with Apple Pages? And I don't mean concordance, I mean a proper index. With LaTeX it's...programmatic. We provide the metadata in the form of `\index{blah}`, it generates the index for us.
It's extremely hard to find anything that's competitive on all these fronts and which is also open source. LaTeX is pretty much it, everything else is focused only on basic formatting & presentation and hasn't even gotten to a proper typesetting algorithm.
https://programmingforresearch.wordpress.com/2012/03/23/word...
Though people have been trying to solve this in Word and templates but those still fail at technical books still IMHO.
A book like this could have been handled fairly easily in FrameMaker, but sadly Adobe has decided to position in it to be only for large enterprise shops running Windows. They're probably (rightfully) afraid it would cannabalize InDesign sales if they made it more accessible.
(Still, though -- XML?)
I may have misunderstood -- he was actually typing in XML tags as he wrote the book, right?
Now, not so much.
dog>cat*3
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 produces attractive output. It offers a complete suite -- math, tables, pictures, graphs -- all in one package. It's fast, adaptable, and easy to learn. It has the highest ratio of text to markup of any typesetting system, including TeX and Markdown. It is the single most overlooked and under appreciated project on the planet.
Whether it's had "significant" development in the past 10 years depends on what that means. Current groff produces PDF format directly, without a Postscript intermediary. The PDF macros support links and TOC generation. I think that all took place in the last few years.
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.
You can always go back to the basics and use simple TeX for your documents if you think groff/troff is simpler.
However, I'd encourage you to give ConteXt http://wiki.contextgarden.net/ a try because it is the spiritual successor to TeX (one tool for all the typesetting) instead of having to depend on "third party" stuff like LaTeX, most of which very few of us (outside the original sty author) understand.
That sounds weird, why would they want that, wouldn't that make the pages pretty irregular internally? Like varying line heights..?
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)