Typesetting | What Is It? Can I Do It Myself?
Summary
Typesetting is the process of preparing a document for printing. The term comes from the days when letter stamps 'type' had to be 'set' in the right order to stamp the desired text onto paper.
Nowadays, typesetting is digital, but is often still purchased as a professional service. I decided to typeset my book myself, and in this post, I will explore the feasibility of doing it yourself, and whether or not I would recommend it.
Fundamentally, there are two approaches to modern typesetting: Graphical, and code-based.
Glossary
- Frontmatter: Anything that comes before the main text, such as title pages, copyright notices, dedications, etc.
- Endmatter: Anything that comes after the main text, such as appendices, glossaries, etc.
- Recto: A page on the right-hand side of an open book.
- Verso: A page on the left-hand side of an open book.
- Leading: The vertical spacing between lines of text.
- Tracking: The horizontal spacing between individual characters.
- Kerning: The spacing between certain pairs of letters.
- River: When spaces between words line up on successive lines, leaving a noticeable 'river' of blank space.
- Orphan: When the first line a paragraph is left on its own at the bottom of a page.
- Widow: When the last line a paragraph is left on its own at the top of a new page.
Typesetting Considerations
The purpose of typesetting is basically aesthetic. It is to make the book readable, and attractive.
- Consistent formatting, including of titles, front/endmatter, etc.
- Avoiding visual glitches that distract from the text, or compromise its legibility, such as 'rivers', 'widows', and 'orphans'.
Graphical Typesetting
Software like Adobe InDesign or Affinity Publisher allow books to be typeset using a graphical interface. The workflow, broadly speaking is to:
- Define templates for standard text pages, and chapter-openings. This will include things like the physical page dimensions at which you want to print the book, margin sizes, etc.
- Define paragraph styles (font family, font size). You will likely want a different style for standard paragraphs, first paragraphs of chapters, and chapter titles.
- Import your text. Graphical programmes are often quite tolerant of different sources, so .docx (Word documents), .txt (text documents).
- The software will 'flow' the text, meaning that it will automatically create the requisite number of pages.
- You apply formatting to the text (e.g. select a title and apply the 'chapter title' style).
- Manual cleanup: you run through the text and make any micro-adjustments. For example, you might choose to squeeze the spacing between words in a paragraph to prevent the last line slipping onto the next page and creating a 'widow'.
- You export the file, and send it to the printer.
Pros & Cons
Pros:
- 'WYSIWYG' (What You See Is What You Get): Changes are visible in real time.
Cons:
- Software is often quite expensive.
- Although it is graphical, there is very much still a learning curve.
- Proprietary formats: If you typeset your book in one piece of software, and later want to edit it in a different piece of software, you will not be able to (notwithstanding a huge number of weird internet 'conversion' tools that will do a poor job of moving from one format to another).
- There is a large separation between the text and the formatting of the text (this will become clearer in the next section).
- Integrates very poorly with AI.
Code Based Typesetting
Software like LaTeX (used extremely heavily in academia) and Typst (a modern variation of LaTeX, gaining traction everywhere that LaTeX is used), allow you to write your document in a special 'markup' language. As an example, if you want to write text: you write it like this, if you want to write a title, # you write it like this, and if you want to write something with an italicised word in it you #emph[write] it like this (where 'write' will render as write). It is worth stressing that normal prose will look almost exactly the same as if you were not using Typst. For the most part, the only difference will be the odd #emph[italic] tag where you want a few words formatted differently. As an example:
Normal text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas varius nisl vitae urna interdum consequat. Fusce a pharetra enim. Phasellus fermentum sem ultricies dignissim posuere. Quisque eu imperdiet quam. Nulla odio nibh, varius ut rutrum vitae, vulputate non erat. Duis in est malesuada, egestas purus condimentum, dictum velit. Nunc eget pellentesque velit, sit amet porta purus. Sed ut sodales risus. Curabitur enim risus, facilisis eu rhoncus sed, iaculis ut erat.
Typst markup:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas varius nisl vitae urna interdum consequat. #emph[Fusce] a pharetra enim. Phasellus fermentum sem ultricies dignissim posuere. Quisque eu imperdiet quam. Nulla odio nibh, varius ut rutrum vitae, vulputate non erat. Duis in est malesuada, egestas purus condimentum, dictum velit. #smallcaps[Nunc] eget pellentesque velit, sit amet porta purus. Sed ut sodales risus. Curabitur enim risus, facilisis eu rhoncus sed, iaculis ut erat.
(Where the first word of the third sentence is italic, and the first word of the antepenultimate sentence is rendered in smallcaps).
Now, if you are a person of sound mind, you are likely wondering why on earth anybody would ever want to do that ever. The answer, I think, is subtle, but important: The text that I write contains within it information about what it means semantically: the text tells you which bit is a title, which bit should be italicised.
You are able to define templates, like this one in Typst:
#let template(body) = {
set heading(numbering:"1", supplement:"Chapter")
show heading: it => {
set text(weight:"regular")
layout(size => context {
block(
height:size.height/2,
width:size.width
)[
#set align(center + horizon)
#set text(16pt)
#smallcaps(it.body)
#set text(14pt)
#v(2em)
#smallcaps([#it.supplement #counter(heading).display()])
]
})
}
set par(
justify:true,
spacing: 0.90em,
leading: 0.90em,
first-line-indent: (
amount:2em, all: false
)
)
body
}
As well as some general rules for your document:
#set page(
margin: (
inside: 25mm,
outside: 20mm,
top: 20mm,
bottom: 20mm,
),
width: 129mm,
height: 198mm,
)
#set text(
font: "EB Garamond",
size: 12pt,
)
I know this looks arcane, and intimidating, but what this means, broadly, is:
- When you get to a new chapter, split the page in half vertically, and vertically centre the chapter title in the top block.
- Add 'Chapter NUMBER' beneath the title (Typst will automatically count the chapters and put in the correct number).
- Format chapter titles with smallcaps.
- For paragraphs within a chapter, set the spacing, justification, leading, how much the first line is indented, if at all, etc).
This is what I was referring to in the previous section: my text itself tells you which parts of it are which. In graphical programmes, you have to click a piece of text and select 'chapter title', otherwise it has no idea that it is a chapter title, and if you miss one, bad luck. The most useful thing about this is that, since it is text based, it integrates very well with AI. You can put this template into Claude, and tell it 'I want chapter titles to be a little bigger, and for inter-word spacing to be a little tighter', and it will just give you a template, you never have to write it on your own if you do not want to.
This is a good time for a note on my AI philosophy. I am not interested in wading into the AI debate on this blog, but I will set out how I use it. I never, ever, under any circumstances, use AI to produce or edit my text. As an author, I view my text as my output, and I have no interest in letting AI touch it in any way. Formatting, however, is a different matter, and if AI makes it easier for me to go from manuscript to print-ready PDF, I will fill my boots.
The workflow when using code-based tools is to:
- Write the manuscript using the special 'markup' that I mentioned above.
- Define some templates as described above (AI can absolutely do this for you).
- Run the compile command. The software will flow the text, using a sophisticated algorithm to avoid 'rivers', 'orphans', and 'widows'. If you are unhappy with how the algorithm has rendered a particular paragraph, you can add some custom directives just to that paragraph to change its rendering (again, AI can do this for you). Anecdotally, I have never had to do this, Typst has always done a good job automatically).
- Send the generated PDF to the printer.
Pros & Cons
Pros:
- WYGIWYM (What You Get Is What You Meant): All of the information about how your book will look is in the text (template files, etc). There is no proprietary file format that opaquely 'remembers' that at some point you said this line was a chapter title.
- Free! Typst (and LaTeX) is free, and community maintained. You will never be locked out of your book, or be forced to pay for software that you no longer need just to be able to open books that you have written in the past.
- Plays very nicely with AI, since it is text based.
- Allows writing and typesetting to run in parallel: Because the typesetting is heavily algorithmic, and all of the semantic information is in the text, I can make heavy edits to the manuscript and know that Typst will render them properly without assistance - no need to go through and tell it that 'this is a new chapter', or 'this thing is now a chapter title'.
Cons:
- Steeper learning curve.
- Feedback loop is slower. If you change paragraph spacing, for example, you will not see the difference it has made to the text until you 'compile' the document into a PDF (this takes seconds, but it is still an extra step).
Conclusion: Code Vs Graphical, DIY vs Professional
I am not going to try to steer you between graphical and code-based solutions. As you have probably gathered, I much prefer code-based, but this is hardly surprising given that I work with code all day. The more interesting question is whether you should do it yourself, or pay somebody to do it.
DIY
This is definitely harder, but it gives you much more control, and a lot more flexibility, and it is free (except for your time and sanity, but you are an author, so the jury is out anyway). Have you already typeset your manuscript, but now realise that you want to change some text? You absolutely can do so (as discussed above, it is much less manual in code that graphical, but it is possible in both); on the other hand, if you have already sent it to a typesetter, and received the completed document back, it is too late (unless you want to pay them to make changes). If you are as indecisive as me, this is a huge benefit. The downside to this is that you need to know what you like - if you are doing it yourself, there is no 'house style', no advice from a human typesetter, you have to be able to decide whether you like a particular font, font size, spacing, margins, etc.
Professional
This is more expensive, you give up a lot of control, and is more of a 'one and done'. Of course, you can tell your typesetter your views on fonts, margins, etc, but you will not be hovering over their shoulder looking at how paragraph four on page three hundred and two leaves too much of a gap between itself and bottom of the page - you will have to trust their judgment. Similarly, typesetters may allow you to change manuscripts in small ways after the typesetting process for minimal or no cost, but if you want the flexibility to rewrite swathes of text, try dozens of different fonts/margins/sizes etc, costs will add up extremely quickly.
In my view, typesetting is something that you should do yourself. It requires judgment, but is not particularly difficult, and between the internet and AI there is more than enough support for anybody to understand it easily. It is also worth thinking carefully about you definition of success: if your goal is to have a document that follows every single traditional rule of typesetting to the letter, pay somebody to do it; if your goal is to produce a document that looks beautiful and does not contain any faux pas that are serious enough to distract from the text, do it yourself.
