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 of movable-type printing presses, when ‘type’ (letter stamps) had to be ‘set’ (arranged) 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 two fundamental approaches to modern typesetting: graphical and code-based, the feasibility of doing it yourself, and whether or not I would recommend it.
For the purposes of this post, it is worth identifying three forms of a document:
- Source: This is your text, in whichever format you have written it (Word document, paper, etc.).
- Intermediate: This is the typesetting file, in which you define which bits of the source are titles, chapters, and where you specify margins, fonts, etc.
- Output: A file (most often a PDF) that can be sent to a printer for printing.
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 of a paragraph is left on its own at the bottom of a page.
- Widow: When the last line of a paragraph is left on its own at the top of a new page.
- Semantic meaning: What bits of text mean (e.g. this piece of text is a chapter title, or a footnote, or a page number).
Typesetting Considerations
The purpose of typesetting is basically aesthetic, and considerations include:
- Giving the book a ‘feel’ that matches the tone of the content. This will involve carefully choosing fonts, font sizes, paper, paper sizes, margin sizes, title styles, leading, and tracking, amongst others.
- Consistent formatting, including of titles, frontmatter, 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 (source). Graphical programmes are often quite tolerant of different sources, so .docx (Word documents), .txt (text documents), .pages (MacOS Pages), etc. will be fine.
- 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.
- The intermediate form of your document is in a proprietary format. 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). This puts you at the mercy of the software manufacturer. If you later want to change your typesetting (perhaps for a new edition), and the price has doubled or the software is no longer available, you will have to either pay, or start from scratch.
- There is a huge difference between the source and the intermediate form of the document, meaning that you have to manually create things like titles by highlighting and clicking, and that if you want to make significant text changes after typesetting has begun, you will find yourself re-doing a lot of the parts that did not change.
- Because it is a proprietary format, and graphical, it 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), take a very different approach. By having you write your document in a special ‘markup’ language, the source and intermediate forms become the same document.
This markup is just normal language with a couple of special ‘tags’ included to specify the semantic meaning of the text. As an example, if you wanted: this is some text to be a chapter title, you would write # this is some text. In the output, Typst will not print the literal # character, instead it will format that piece of text as a chapter title. Another simple example is italicised text: it is #emph[specified] like this. #emph (as in emphasis) tells Typst that this word should be italicised, and the output will be “it is specified like this”.
Now, if you are a person of sound mind, you are likely wondering why on earth anybody would ever want to do that. The answer, I think, is subtle, but important: The text that I write contains within it information about its semantic meaning. This means that the structure of your book is inside the text itself, and the typesetting process is purely cosmetic.
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: "Arial",
size: 12pt,
)
I know this looks arcane, and intimidating, but what it means, broadly, is:
- When you get to a new chapter, split the page in half vertically into two blocks.
- Vertically centre the chapter title in the top block.
- Add
Chapter NUMBERbeneath the title (Typst will automatically count the chapters and substitute 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.
- Throughout the book, pages are a specific size, with specific margin sizes, text is a specific font and size, etc.
This is what I was referring to in the previous section: the 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 the software has no idea that it is a chapter title, and if you miss one, bad luck. One very useful thing about this is that, being text based, it integrates very well with AI. You can ask it to generate a template, and then tweak it to your heart’s content: “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 an updated 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 (this also applies to this blog). 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 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 an excellent job automatically.
- Send the generated PDF to the printer.
Pros & Cons
Pros:
- WYSIWYM (What You See Is What You Mean): 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. You do not have to write the templates yourself, just tell an AI “set up a Typst project”, and then continue to use the AI to refine it based on your tastes.
- Allows writing and typesetting to run in parallel: Because the typesetting is heavily algorithmic, and all of the semantic meaning 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’.
- Allows you to experiment. It is trivial to generate ten different versions of the output, each with a different font, different margins, etc., to see what you prefer.
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, and requires more trial-and-error than dragging things around in a graphical programme).
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 than 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 big downside here 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. This is doubly true for a graphical approach — code-based tools will do a good job of implementing the style you choose (once you choose it), graphical tools rely on you doing a good job of implementing your chosen style yourself.
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 judgement. 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.
The process of typesetting is not particularly difficult, the tricky bit is the judgement. Code-based tools like Typst use algorithms based on a century of typesetting expertise to produce a consistent, high quality output; a human uses judgement. An excellent human typesetter manually using a graphical tool will probably do a better job than an algorithm, but for an author, this introduces some complexity: Do I have the judgement to decide whether a ‘professional’ has done a good job or not?
Final Answer
The question therefore becomes one of defining success: Do you want a product that could be perfect, but is expensive and inconvenient, and incurs the risk that you are paying somebody to do something whose quality you are not qualified to judge, and therefore that might end up being far less than perfect, or do you want a product that is almost perfect, but much cheaper and more convenient, and guaranteed to be almost perfect? In my view, the goal of typesetting is to produce something beautiful, and to allow the formatting to get out of the way of the text — as long as the format matches the mood of the text, and there are no issues egregious enough to distract from the writing, I am happy.
So, here is my final ranking from best to worst:
- Do it yourself, in code. Code-based typesetting will give you something excellent every time, for free, with full flexibility.
- Pay a professional. You spend a lot of money, give up a lot of control, and you have to trust that the professional that you chose knows what they are doing. If you get lucky, this can give you a slightly better (although not hugely better) result than code-based tools.
- Do it yourself, graphically. Typesetting is an art, and it takes a long time to become good at it. This option is a huge risk, for very little benefit, and in my view is the worst of both worlds.
