# What does TeX do to make text more beautiful? (Answer: four things.)

This original question was: Are fonts rendered more beautifully with LaTeX than with other systems, such as Word?

The larger question really is: Beyond overall document layout, what specifically does TeX do to render text, words, paragraphs more beautifully?

There is a lot of information about the "beauty" of TeX in general elsewhere, however there isn't a consolidated, precise summary of the advantages.

(Update: I have consolidated all the information from the answers and other research into my answer below.)

• I'm a bit confused about this question. It's clearly not a duplicate of the linked question, but at the same time it seems intended as an answer and not really a question. If that's the case, it should be reopened, turned into a much smaller question and most of the rest of the question turned into an answer. – Alan Munn Sep 5 '19 at 14:06
• It is the concept of typesetting the whole paragraph while minimizing the imposed penalties that gives the best overall effect on a paragraph basis. The penalties are applied on the whole paragraph, not merely on a line-by-line typesetting. Penalties can be customized to achieve particular ends (see `\sloppy` and `sloppypar`, for example). – Steven B. Segletes Sep 5 '19 at 17:50

One important difference is that TeX breaks paragraphs into lines using a global algorithm, i.e. one that looks for an optimal solution for the entire paragraph. This is helpful when justifying text, as it allows you to make one line slightly tighter/wider if it helps some other line, e.g.

``````The first line is a normal line. While the
second   line  is  very   wide  due  to  a
superlongword in the third line.
``````

can be improved by moving one word from the first to the second line

``````The  first  line is a normal  line.  While
the second line is  very  wide  due  to  a
superlongword in the third line.
``````

One can only do this when looking at the entire paragraph instead of individual lines.

• In addition, you have a much better hyphenation and you have microtype. So if you set the text justified, there is no doubt. AND: If you use a decent document class, the margins, spacing between page elements etc., is for 99 per cent in harmony, so the total output will be much better, and in less time. – Sveinung Sep 4 '19 at 18:00

I can speak from a production standpoint. LaTeX can be a decent back end for an XML workflow, such as used by Scribe, which integrates Word templates, an XML database, Indesign (ID), and so on. The elements of layout and typography that you mention are a part of a greater picture. LaTeX typesets equations better than ID or Word. You can do equivalent things in LaTeX and ID, but the time and cost will differ, depending on the application. That triangle of time, cost, and quality can inform standards of beauty.

I started using LaTeX seriously when writing my thesis for my second master's degree. Way before that I had used TeX a little with my undergrad CS program on SysVr4 Unix. I needed to hyphenate English, German, Latin, and Greek. Word c. 2004 was still a mess with that. I got everything to work properly in LaTeX, much better than Word and EndNotes. Word has improved a little with hyphenation, but remains inferior. ID has a few options but it is neither as flexible nor as automatic as LaTeX. So if beauty means handling multiple languages well in the body text, bibliography, and footnotes, LaTeX is best.

I first designed the specs for Law and Gospel: How to Read and Apply the Bible (2010) using LaTeX, then the designer set up an equivalent in ID. Margin notes worked better in LaTeX than using the anchor mechanism in ID. There was a lot more human fiddling with the equivalent layout in ID. LaTeX automates a ton of features that you can set up in a template, then guarantee consistency and beauty thereafter.

ID is better at publishing on a grid and magically adjusting leading, character and word spacing across frames of text. Using microtype is very manual by comparison via `\textls` and the `Spacing` environment. But one still has to tweak the rules for individual paragraphs at times in ID.

The page ship out in LaTeX is different. It can do some complex things procedurally that would take longer to do in ID and be less precise and consistent, in my experience. TeX kind of imitates a Linotype hot metal press in the way it constructs pages. That has a certain beauty to it.

In LaTeX, if you use microtype and you start messing with leading, tracking, etc., you have to be very careful that you don't get unwanted page breaks or reflow when using widow and orphan control, which itself has multiple implementations. Furthermore, updating your TeX distro can cause a reflow. I saw this when I typeset my book, Breath of God, Yet Work of Man (2019) using LaTeX. That detracts from the beauty when "done" needs to be corrected and reprinted.

I typeset several books using Word because it allowed the publisher to use a template and outsource the work. That was nothing short of ugly. Even the idea of setting up running heads can be a chore because Word tries to think for you. You have to set up odd versus even headers with a different first page and ensure that the first page is odd. You have to pay super careful attention to the section links and set them up in order without any changes after they are finalized, else the links can break and your numbering is fried. Doing the equivalent in ID and LaTeX is a snap.

In Word you can play a little with spacing and leading, but it's an unstable mess and tends to reflow especially when using footnotes. Moreover, reflow can happen each time you open the document. Unwanted white space is hard to mitigate. Fixing that can take much time.

LaTeX and ID are of similar power and each is good for specific cases. LaTeX has as-yet rivaled power in automation of references, bibliographies, indexes, TOC, etc. The fact that so many design elements can be generated consistently and accurately adds to the beauty.

Based on the comments and answers and a lot of research, here is consolidated information. Please let me know any other info and I will update this consolidated answer.

Beyond overall layout, such as positioning of headers and tables of contents, there are four specific advantages of TeX over other systems, such as Word, that produce more “beautiful” output of the words, sentences, and paragraphs themselves - i.e. generally considered to be easier to read and more pleasing to the eye:

1. With paragraphs that are fully justified, with a straight right margin, TeX provides better, more even spacing to even out the words within the lines, using intelligent hyphenation of words at the end of lines to help achieve this effect. This also takes into account not just each individual line, but the look of the whole paragraph when making these hyphenation decisions (although I could find statements of belief to this second item, I could not find a specific anchoring reference – please let me know if possible and I will update this.)

2. The Microtype package, if applied, not a default, does four interesting things to help create “beautiful”, easier to read and more pleasing output:

(a) Character protrusion, also known as margin kerning, which for example will actually push a word a bit into the right margin if it ends with a letter that, if strictly lined up with the rest of the margin, would actually make it look slightly left-indented.

(b) Font expansion, which will use a wider or narrower version of a font to expand or decrease the width of some words if it would make the overall line justification more pleasing, for example to gain a bit more space and avoid a hyphenation, or make the words longer to decrease the amount of inter word spacing required to make the line appear more even.

(c) Letterspacing, also known as character spacing or tracking, to increase the amount of space between capital letters that otherwise, using default kerning, will appear too close together, or decrease the amount of space between very large capital letters.

(d) Additional kerning, useful for languages that require certain characters to be separated by a space, for example in French typography to add a small space before a question mark, and applies to single characters, not to character pairs.

(e) Adjustment of interword spacing, based upon the idea that to achieve a uniform greyness of the text, the space between words should also depend on the surrounding characters, e.g. if a word ends with an ‘r’, the following space should be a tiny bit smaller than that following for example an ‘m’. As of 2019-02-28, this feature is a “first approximation” and may be refined.

(f) Disabling of ligatures, completely or selectively, if you believe this is preferable.

(All the above info from: http://ftp.math.purdue.edu/mirrors/ctan.org/macros/latex/contrib/microtype/microtype.pdf )

3. Ligatures are applied to for example join the letters "fi" to provide better looking typography. (Although this might be considered a preference, and as above Microtype provides the ability to disable ligatures completely or selectively if you wish.)

4. Better and more beautiful layout of mathematical equations, one of the original purposes of TeX. This is a broad subject with a lot of detailed explanation elsewhere.