EPUB got specific structure/components, which includes metadata files, and isn't just `zip book.epub book.html book.css *.jpg`. Of course can set-up from start to have expected structure, write xhtml files as expected, write metadata files manually, and create epub with just `zip book.epub -r *` but is more convenient via script/app.
I typeset some university work in troff in 1994. The professor I submitted it to was impressed but questioned my sanity in front of half of the class. Not wrong to do so.
Might still have the source code to that work somewhere. And it probably still parses.
Can't remember why I did it but on reflection it might simply have been that LaTeX was not going to fit on my extremely space-constrained Linux machine but troff was already there.
ETA: this sentence made me chuckle. "It's much easier to read without the inline comments:" Oh yes, much ;-)
I think it’s fascinating to see all the different ways that techfolk who write fiction set up their writing pipelines. Some people go with a bare-bones coding editor like Vim; others use “pro” tools Scrivener. And then there’s the typesetting pipeline. Using troff is pretty out there.
When I started writing fiction, here’s what I came up with. I write in Google Docs because it’s lightweight, works everywhere, and can easily export to Markdown format. From there, I manage the Markdown source in Git and Emacs. For typesetting—I cannot abide crappy word-processor output—I used to use Pandoc to generate LaTeX markup and run LuaLaTeX to produce PDFs. But that took several seconds. Now, I use Typst to go straight from Markdown to PDF files. It’s pretty much instant.
If you want to see what the output looks like, here’s the first chapter of my current project:
(Notice: This is a typesetting sample, not a writing sample. It’s my W40k-adjacent fanfic, so you have been warned.)
It’s set in 12pt Erewhon, which is an enhanced version of Andrey V. Panov’s Heuristica font family, which extends Robert Slimbach’s Utopia font family. Slimbach is a sublime type designer—he created Minion—and Utopia is one of his early works that is especially spirited.
Agreed, it seems writers that also code have all kinds of different workflows. I end up using (x)html and doing print stylesheets and rendering pdf for print using weasyprint (works really well, and they have sample stylesheets on their website that are a good starting point).
Indeed. One irresistible temptation for coders who go into writing is to bikeshed their pipeline. I know I have spent many hours tweaking my writing pipeline when I should have been writing. I mean, why just write when you can create a Containerfile to build a hermetically sealed image that houses your typesetting system and a dozen carefully chosen fonts, and then you can write scripts managed by a Makefile to launch containers from the image and inject into them your source text and extract from them the typeset PDFs? I mean, surely all of that is essential work on the critical path to getting your writing done. Right?
I remember a quote by Pandoc creator slash professor of philosophy John MacFarlane: "I would like to think that the time I’ve spent developing tools to make writing more efficient has been repaid by the time I’ve saved using these tools, but I’m pretty sure it hasn’t."
One writer recently wrote his own program for the job, but at least he eventually finished some books: https://hughhowey.com/neo/
Me, I just write in Emacs, set up a makefile, and export to PDF with Pandoc. But I admire the work to make a comfortable yet undistracting writing environment.
troff is no longer fashionable, and it's not what you want for top-quality typesetting, but I don't think of it as "out there". My non-technical mother was using an HDOS program called TEXT.ABS, which is similar to a limited nroff, to format the articles she wrote in the 01980s. It wasn't as easy to use as something like MacWrite, but it was a lot easier than a typewriter. The text editor she used was called PIE.ABS, and from my point of view, the usability distance from a typewriter to PIE was bigger than from PIE to MacWrite.
She didn't have much choice of fonts on the pre-Graftrax Epson MX-80 she used. I think it was Pica or Elite.
Typesetting is certainly very satisfying, but it's not essential to writing.
I still use a custom markup language I made for myself [0] because I don't find Markdown flexible enough, Latex's syntax is disgusting, and neither is particularly consistent.
Huh. I wrote into vim and made a bunch of .md files, and then just had Claude assemble them into an epub to make my book for Kindle. How did you decide on that size of page for the PDF?
That PDF is for proofreading and review, so I just used U.S. Letter size to make it easy to print on my home printer. For actual publication, I would use the page size for, say, a trade paperback.
For epubs, right now I'm using Pandoc: https://pandoc.org/epub.html. But, again, that's just now for the writing and proofing stages. For final output, I'll consider my options. (I may still go with Pandoc, but right now I'm using it because I was already using it for typesetting and so it was a low-friction choice.)
One thing I have noticed about S-tier writers is that most of them have an established routine and stick to it. Why risk breaking something that works? With an established routine, you settle into it, and muscle memory puts you into writing mode. Start mucking with the routine, and that is how you get writer’s block.
Quick search shows George R R Martin wrote 3 to 4 million published words. ASOIAF is ~1.8 million. That's enough to focus on in my opinion.
Honestly, the amount of writing doesn't even seem that useful of a metric. Stephen king only wrote ~3x more than George, and about 6x more than someone like Nabakov (1.5 to 2 million words across two languages). The real takeaway IMO is to just write regardless of the technology you use
While he only did it, to my knowledge, for one book: Stephen King is the only major writer I have heard of to write a full novel with pen and paper (the novel in question was _Dreamcatcher_), which is really interesting to me.
A quick search immediately expands your knowledge (and unfortunately makes Stephen King much less interesting in this regard): Steinbeck went through 300 pencils to write East of Eden. Nabakov wrote all of his novels entirely on index cards. Even JK Rowling apparently wrote the vast majority of harry potter by hand on unlined paper.
And while not a novelist, Tarantino famously writes his screenplays all by hand as well.
Sorry to break it to you, but there are many, many novelists who prefer to write longhand!
Some notable examples I remember include J. R. R. Tolkien, Patrick O'Brian (who wrote all 21 books in the Aubrey-Maturin series by hand, and claimed at one point to write with "ink and quill"), Nabokov, Joyce Carol Oates, Ursula LeGuin, and Truman Capote.
Neal Stephenson has written many novels in longhand, including all of the Baroque Cycle. The picture below shows the pile of paper of the MS, and the three published hardbound books below it.
At my dayjob, our legacy customer communication generation (for letters and such) has a runoff syntax. It's z/os, so not groff, but something of that lineage. People are still working with those documents to this day, generating millions of them a year. They all look at me funny when I identify it as runoff, everybody else thinks it's something custom in-house.
>Building a world with its own set of rules and history and what not turns out to be very fascinating. ... The length of the stories make proof-reading ridiculously hard.
Sometimes I wonder if writing more short stories would be like playing 9x9 Go games for new authors. It won't exercise the big structural challenges, and it comes with its own challenges, but it does practice a lot of this in a much more digestable size.
As far as world building goes, I think GRRM/Rothfuss/Sanderson style "world building through epic scales of structures and systems kept consistent" is overrated and maybe even Considered Harmful if you look at what it's done to my first two examples. By contrast, Borges does more world building with the ontological tricks in his <20 page short stories than it feels like Rothfuss ever did, in much the same way Tolkien did it with similar tricks. For example, treating himself as a mere translator and even doing some philologist tricks like telling you he's simplifying some names into English (Sam's real name? "Banazîr"), and withholding more information rather than dumping it on you, means that his stories feel like recovered translated works from a world just as real as ours and that's why people still devour The Silmarillion just to get more of a look into it.
Borges would do similar in his short stories, even embracing a little bit of inaccuracies in the (fictional) narrator's account of some events, then hitting you with a surprise endnote at the end of the story with scholia about the provenance of the story given that narrator's mistakes.
Wolfe was famous for it too. Embrace some of the challenge of getting the details right and if you frame it right, it makes it more human and more "real".
When shorts were a dominant part of the fiction market, writers were a lot tighter, in both their shorts and their longer works. Also it got them a lot of practice in finishing a story, which is something Rothfuss is yet to do.
Might be worth mentioning that Tim O'Reilly himself co-wrote a book about typesetting with troff. Unix Text Processing by Dale Dougherty and Tim O'Reilly, Hayden Books, 1987. This text was subsequently provided free under the Open Books Project.
Larry Kollar has provided a recreated source code repository at
That's right. From the colophon of 1989's Nutshell Handbook on Using C on the UNIX System:
> The text of this book is set in Times Roman; headings are Helvetica; examples are Courier. Text was prepared using the troff text formatter and the devps PostScript filter. Figures are produced with a Macintosh. Printing is done on an Apple LaserWriter.
I think 9front (Plan 9 fork) dev, cartoonist and fiction writer Stanley Lieber also formats a good part of his stuff with troff, e.g: https://massivefictions.com/2024/06/24/0/
"This book was typeset (troff -ms|lp -dstdout|ps2pdf) in URW Garamond No.
8 by the author, using an MNT Reform laptop running the 9front operating system."
I was glad to see this page about groff, which is much underrated as a publishing system. The perl script for replacing some markdown markup with chosen groff macros is very interesting. I was however wondering about why the OA chose to write their own macro set rather than simply using the mom macros? Was it simply the need for German markup (and I take the point that languages other than English is an issue)?
Nils Holm (https://www.t3x.org/) also publishes ebooks using groff, but he does not (so far as I am aware) publish his markup or macros.
As to the writing: I'm still working on the sentences, so 45 pages is a distant goal.
Back in the day I was part of a 'commission' to produce a 5-yearbook for our student club. It being the digital age and we studying at the premier (and only...) agricultural university in the Netherlands I went and had a look at the possibilities to use university facilities to typeset the book. Those facilities ended up being a PDP-10 running TOPS-20 'cause the VAXen were too important for such work. After some experiments with TECO and RUNOFF I was convinced I'd never get the other members of the commission to work this way. Since my own C-64 was just that, my own machine and already in use for other things I ended up scrounging up an ancient tape-based word processing system consisting of a metal box with a tape drive connected through a thick cable to an IBM Selectric typewriter. While it wasn't the epitome of ergonomics it was more amenable to some of the more digitally impaired members of the commission. That the Selectric's motor burned out just when I was going to produce the master printouts which led me on a hunt for a motor (found one for ~$50) and a complicated repair (re-adjusting the whippletree linkage without documentation but with time pressure from the printers was not my favourite experience). Still, we made it, the book was published, all's well that ends well.
For those that don't know, groff's ancestor "roff" is very closely tied to UNIX's origin story. roff itself had it's own antecedent called RUNOFF (whence the name) on Multics. roff was basically UNIX's first "killer app" and was used to typeset patent applications by the division of Bell Labs that handled that sort of thing. It legitimized the further development of UNIX.
Groff seems to be somewhat supplanted by mandoc these days, at least on the BSDs.
The macro packages were a royal pain in the neck. As soon as you mastered one, somebody submitted a paper to a mill which demanded another. I alternated -ms and -me for ages because of this.
When we had a continuous paper wet process xerography printer, the cut-marks were a godsend. Once we stopped having that printer, they were a major annoyance.
For quite a long time TBL would spit out misformed tables. Mike Lesk told me this was an adustment added for the throwback function in the printer they used at bell labs and was needed to "shoogle" the table horizontals back into place for the next table. -Apparently printing a page-width worth of underscores in sequence caused an accumulating mis-alignment so they added some code to throw it back.
Fwiw I wrote a bunch of my college papers on a version of Roff originally written by Col. G. L. Sicherman for CP/M, which I ported to Turbo C for the obsolete-when-I-got-it MSDOS laptop that I had back then. I ran that program under x64 Linux much more recently and it still worked after I ripped out some DOS stuff, despite some C anachronisms. The CP/M program is still around in old code archive sites.
I also remember writing a crude HTML to text renderer for an old Linux box because lynx -dump was too slow then. I wonder if the code I wrote is still around anywhere. Lynx on today's hardware is extremely fast.
jmclnx | 19 hours ago
TeaVMFan | 19 hours ago
I suspect many people will prefer HTML for markup. That's why I built EPublish, which is related but for an HTML -> EPub workflow:
https://frequal.com/epublish/
pasc1878 | 17 hours ago
forgotpwd16 | 15 hours ago
kragen | 13 hours ago
forgotpwd16 | 15 hours ago
Most people hate writing HTML by hand. That's why we got lightweight markup languages like Markdown, Asciidoc, reST, etc.
kragen | 13 hours ago
Many people will prefer Markdown or Commonmark for markup.
dofm | 18 hours ago
Might still have the source code to that work somewhere. And it probably still parses.
Can't remember why I did it but on reflection it might simply have been that LaTeX was not going to fit on my extremely space-constrained Linux machine but troff was already there.
ETA: this sentence made me chuckle. "It's much easier to read without the inline comments:" Oh yes, much ;-)
tmoertel | 18 hours ago
When I started writing fiction, here’s what I came up with. I write in Google Docs because it’s lightweight, works everywhere, and can easily export to Markdown format. From there, I manage the Markdown source in Git and Emacs. For typesetting—I cannot abide crappy word-processor output—I used to use Pandoc to generate LaTeX markup and run LuaLaTeX to produce PDFs. But that took several seconds. Now, I use Typst to go straight from Markdown to PDF files. It’s pretty much instant.
If you want to see what the output looks like, here’s the first chapter of my current project:
https://drive.google.com/file/d/1Wl4k_rdYGFZp-r5nq864r5CNzD1...
(Notice: This is a typesetting sample, not a writing sample. It’s my W40k-adjacent fanfic, so you have been warned.)
It’s set in 12pt Erewhon, which is an enhanced version of Andrey V. Panov’s Heuristica font family, which extends Robert Slimbach’s Utopia font family. Slimbach is a sublime type designer—he created Minion—and Utopia is one of his early works that is especially spirited.
sloum | 18 hours ago
I like Erewhon. Nice font.
pmdr | 18 hours ago
And perhaps infinitely procrastinating on the actual writing itself...
tmoertel | 18 hours ago
marttt | 6 hours ago
Reference: https://usesthis.com/interviews/john.macfarlane/
Semiapies | 17 hours ago
Me, I just write in Emacs, set up a makefile, and export to PDF with Pandoc. But I admire the work to make a comfortable yet undistracting writing environment.
computerfriend | 13 hours ago
kzrdude | 11 hours ago
anthk | 12 hours ago
https://t3x.org has two novels and tons of comp sci books probably made with very little...
kragen | 13 hours ago
She didn't have much choice of fonts on the pre-Graftrax Epson MX-80 she used. I think it was Pica or Elite.
Typesetting is certainly very satisfying, but it's not essential to writing.
breuleux | 13 hours ago
[0] https://breuleux.github.io/quaint/
solyin | 11 hours ago
tmoertel | 6 hours ago
For epubs, right now I'm using Pandoc: https://pandoc.org/epub.html. But, again, that's just now for the writing and proofing stages. For final output, I'll consider my options. (I may still go with Pandoc, but right now I'm using it because I was already using it for typesetting and so it was a low-friction choice.)
armcat | 18 hours ago
[1] https://www.bbc.com/news/technology-27407502
tmoertel | 18 hours ago
howunfortunate | 17 hours ago
bawolff | 13 hours ago
Personally i feel for the guy, imagine the whole world insisting you only work on the project you started back in 1991.
viccis | 17 hours ago
3eb7988a1663 | 16 hours ago
literallyanythi | 16 hours ago
Honestly, the amount of writing doesn't even seem that useful of a metric. Stephen king only wrote ~3x more than George, and about 6x more than someone like Nabakov (1.5 to 2 million words across two languages). The real takeaway IMO is to just write regardless of the technology you use
sloum | 16 hours ago
literallyanythi | 15 hours ago
And while not a novelist, Tarantino famously writes his screenplays all by hand as well.
atombender | 13 hours ago
Some notable examples I remember include J. R. R. Tolkien, Patrick O'Brian (who wrote all 21 books in the Aubrey-Maturin series by hand, and claimed at one point to write with "ink and quill"), Nabokov, Joyce Carol Oates, Ursula LeGuin, and Truman Capote.
themadturk | 10 hours ago
https://www.flickr.com/photos/djwudi/3617012248/
helterskelter2 | 18 hours ago
delusional | 17 hours ago
dofm | 17 hours ago
kragen | 13 hours ago
viccis | 17 hours ago
Sometimes I wonder if writing more short stories would be like playing 9x9 Go games for new authors. It won't exercise the big structural challenges, and it comes with its own challenges, but it does practice a lot of this in a much more digestable size.
As far as world building goes, I think GRRM/Rothfuss/Sanderson style "world building through epic scales of structures and systems kept consistent" is overrated and maybe even Considered Harmful if you look at what it's done to my first two examples. By contrast, Borges does more world building with the ontological tricks in his <20 page short stories than it feels like Rothfuss ever did, in much the same way Tolkien did it with similar tricks. For example, treating himself as a mere translator and even doing some philologist tricks like telling you he's simplifying some names into English (Sam's real name? "Banazîr"), and withholding more information rather than dumping it on you, means that his stories feel like recovered translated works from a world just as real as ours and that's why people still devour The Silmarillion just to get more of a look into it.
Borges would do similar in his short stories, even embracing a little bit of inaccuracies in the (fictional) narrator's account of some events, then hitting you with a surprise endnote at the end of the story with scholia about the provenance of the story given that narrator's mistakes.
Wolfe was famous for it too. Embrace some of the challenge of getting the details right and if you frame it right, it makes it more human and more "real".
egypturnash | 10 hours ago
fweimer | 16 hours ago
2b3a51 | 15 hours ago
Larry Kollar has provided a recreated source code repository at
https://github.com/larrykollar/Unix-Text-Processing
I recollect compiling the source from the github account having only to sort out one font path issue.
tmoertel | 9 hours ago
> The text of this book is set in Times Roman; headings are Helvetica; examples are Courier. Text was prepared using the troff text formatter and the devps PostScript filter. Figures are produced with a Macintosh. Printing is done on an Apple LaserWriter.
marttt | 16 hours ago
"This book was typeset (troff -ms|lp -dstdout|ps2pdf) in URW Garamond No. 8 by the author, using an MNT Reform laptop running the 9front operating system."
anthk | 12 hours ago
2b3a51 | 16 hours ago
Nils Holm (https://www.t3x.org/) also publishes ebooks using groff, but he does not (so far as I am aware) publish his markup or macros.
As to the writing: I'm still working on the sentences, so 45 pages is a distant goal.
hagbard_c | 15 hours ago
staplung | 14 hours ago
Groff seems to be somewhat supplanted by mandoc these days, at least on the BSDs.
kragen | 13 hours ago
tosti | 14 hours ago
gcapell | 11 hours ago
ggm | 10 hours ago
When we had a continuous paper wet process xerography printer, the cut-marks were a godsend. Once we stopped having that printer, they were a major annoyance.
For quite a long time TBL would spit out misformed tables. Mike Lesk told me this was an adustment added for the throwback function in the printer they used at bell labs and was needed to "shoogle" the table horizontals back into place for the next table. -Apparently printing a page-width worth of underscores in sequence caused an accumulating mis-alignment so they added some code to throw it back.
throwaway81523 | 9 hours ago
I also remember writing a crude HTML to text renderer for an old Linux box because lynx -dump was too slow then. I wonder if the code I wrote is still around anywhere. Lynx on today's hardware is extremely fast.