Ask HN: How did you author and typeset your technical book?
I'm curious how you typeset your technical book, by which I mean book containing any or all of diagrams, code snippets, tables, or pictures alongside the prose.
A recent post here described a process using Markdown, InDesign, and some custom build scripts:
http://journal.stuffwithstuff.com/2021/07/29/640-pages-in-15-months/
In particular, it introduced some interesting workflows around scripting InDesign that I'd not heard of.
I'm guessing that the typesetting for each book is as unique the book itself! What tools have you found success with? Markdown? AsciiDoc? Microsoft Word? LaTeX? Something else entirely?
(
10 comments
| 12 points
| on HN
)
I'd probably try templates [1] already available if I needed printable version.
[0] https://learnbyexample.github.io/customizing-pandoc/
[1] https://github.com/Wandmalfarbe/pandoc-latex-template
It's easy to render PDF and EPUB, and Asciidoc syntax is not much of a jump from Markdown either. The biggest challenge is learning the correct name of the typesetting feature that you need, so you know what to look for in the Asciidoctor reference. :-)
So my process was as follows:
1. 1 "parent" Asciidoc manuscript, with individual chapters written in separate files and included with "include::"
2. Write sample code, marking each code block with Asciidoctor fencing, and then reference each code block from the manuscript. Asciidoctor will then include the code and add syntax highlighting etc. I also try to write the example code inside unit tests, so it can be tested every time the book is built.
3. Wrap the process in some sort of build tool. I chose Maven (there's an Asciidoctor plugin for Maven). The process builds the book PDF/EPUB, tests the book sample code, and builds any associated artifacts (like an example .zip file).
Now I'm writing a new short book, and this time I'm trying out Pandoc->PDF (via LaTeX). The learning curve is pretty steep, and the LaTeX errors are a bit WTF, but the eisvogel template (as also recommended by asicsp in this thread) is a great way to have something presentable very quickly.
We generated the book through Leanpub, so we relied on their typesetting choices entirely.
In terms of the writing process we (three co-authors) used "feature" branches on GitHub and pull requests for each chapter, i.e., once a chapter was considered done, the other two authors reviewed and edited the result.
Didn't have a publisher to deal with
Wasted 3months of my time with Apress who really wanted to publish my python book through them and then backed out after 3 months saying "OMG your book is similar to some of our books"
Ans their choice of formatting was strictly Word and they'd even given a word file template and I actually had liked that template!!
On another unrelated note, the pay they were going to give me was low. My Go book earned me much more than they were going to pay me upfront+royalty over 5yrs within 5yrs.
It's a hard problem.
You have to remember that (by the numbers) the author is a small part of the production process. The reviewers, copy editors, and editors all need to use tooling that they're comfortable with. You're going to have to offer them a powerful incentive to be the special case.
If you want to make your CV (resumé) look spiffy then working with an established publishers is a good idea. Otherwise I think self-publishing is a much better idea; you can proceed at your own pace, you'll reap any financial advantage yourself, and you can use whatever tooling you like. Just be aware that it likely still won't be very remunerative. Oh, and get a good copy editor - after a while it's hard to see mistakes in text you've read many times.
Edit: Also, I thought their Word template was reasonably good, but I would have loved a plaintext format and source control to make it easier to review and compare changes. So I totally get where you're coming from.
Edit 2: And to answer the original poster's question - I think if I was going to self-publish then I would go with a Markdown/Pandoc/LaTeX solution like the one in this Stack Overflow thread: https://tex.stackexchange.com/a/246871