📜 ⬆️ ⬇️

In the paragraph, everything should be fine

Complyutinsky polyglotte


There is a dispute with a long history among the maker-ups (almost like between “pointed-points” and “blunt-tips”): whether it is necessary to automatically insert inseparable spaces after all single-letter unions and prepositions. I wanted to insert my “five kopecks” and briefly outline the third option, but I had to dig a little deeper. It turned out about the paragraph as a whole.


When a publisher prepares a book (or site) for publication, he wants everything to be fine in it: from the outline of each letter to the overall design as a whole. At the moment, as far as I understand, artificial intelligence has not yet learned either the intelligible design of fonts or the design of global design. However, the middle, namely the layout of individual paragraphs, humanity calmly left to the machines.


Give something to give, but the result is sad for now. For centuries, the developed rules of how to place the letters in front of the reader's eyes, so that he was comfortable with the text, are now forgotten and ignored. Once a printer spent several hours (or even days) on creating a page to be printed in small quantities, and now neither the programmer nor the machine spends a millisecond of his time on applying the rules of high-quality typography to texts that people will scan tens of thousands of times.


It is especially sad to see this on “readers”, devices that pretend to supplant a paper book. The transfers are not placed, hence there are terrifying holes in the middle of the text or a tattered right edge. A QReader on my ancient Nokia 3250 was able to quite well arrange hyphens. This option is not connected with the weak processing power of the readers, is it? Is it really more difficult to make up a text page than to render a pdf or jpeg full screen? Well, and what prevents it from doing browsers on modern computers, I am completely wondering. It seems just laziness and carelessness.


There is information in various reference books about what a “perfectly formed paragraph” is, in short it would be possible to sum up the following list:


  1. correct font
  2. letter spacing in each row is reasonably variable
  3. interword spaces in each line reasonably
  4. interword spaces in adjacent lines are not too different
  5. reasonable leading
  6. harmonious indent or initial letter
  7. neat left edge (optically), without equally beginning adjacent lines (homeoarchy)
  8. neat right edge (optically), without a paling of many carries in a row and without equally ending adjacent lines (homoioteleuton)
  9. if the set is “flag” ( align=left ) or off in the center ( align=center ), then the word at the end of the line should not “hang in the air”, it should be based on the letters of the next line
  10. good last line: not too short (less than 2 indentation lengths) and not looking too tight (less than the indentation to the right edge)
  11. without “corridors” (rivers of white)
  12. no discordant transfers or unplanned associations

In general, the paragraph should be a homogeneous whole, giving the reader a minimum of discomfort when moving from letter to letter, from word to word, from line to line.


The system of rules describing the layout of paragraphs is somewhat similar to the rules of the road: this is possible, and this is not possible. But, unlike the traffic rules, there is no additional benefit, called the “Table of fines”. For example, if on the road you really need to overtake the tractor, then there may be a choice between driving on the side (1500 rubles) and driving in the opposite lane (5000 rubles or deprivation of rights). This system of "penalties" does not know InDesign. For him, “no” means “never for anything”, and by banning 4 consecutive transfers, I can get a crazy stretched string. It seems to me that the majority of readers will notice the leaky line, and four translations in a row - only professional bores. This means that the choice should not be the same as that of InDesign.


And this option with fines is painted in his beautiful book by an equally excellent Donald Knuth: in his work “ Computer Printing House ” there is a whole chapter devoted to the layout of a paragraph (pp. 79-166). There is a lot of mathematics and a lot of lyrics, but the basic idea is as follows. The text is presented as a sequence of 1) boxes, 2) tensile adhesive and 3) fines for breaking a line in a given place. The criterion for a bad paragraph layout is the sum of penalties for stretching / stinging lines, penalties for hyphenation and some other additional penalties (for a large difference in the length of adjacent lines, for two consecutive shifts, etc.). The layout task is to minimize the total amount. And there Knut leads the program-algorithm for solving this problem.


This whole thing works quite well, there are also for TeX-a and hyphenation patterns, with tracking and optical alignment, it works nicely thanks to a microtype , and the set of French typographical rules "Lexique des règles typographios en rationale nationale" (very close to the above ) can be applied using impnattypo .


Microtype using microtype


The toolkit is a good thing, it remains to learn how to use it, to describe which flaws we have in the layout are forgivable and which are rude. Now my "five kopecks."


There are a couple of articles on Habré about the rules relating to non-breaking spaces in texts, there is also a powerful DoTextOK script, but given the above, I cannot agree with the authors about what to put after one-letter unions and prepositions [] non-breaking space. I would like to introduce a new term in typography - “weakly spaced gap”. That is one that can be broken if necessary.


The rule that I managed to find on this topic is:


In book publications, prepositions and conjunctions that begin a sentence, as well as single-letter conjunctions and prepositions in the middle of sentences should not be left at the end of the line. In magazine, newspaper, informational and operational polygraphy publications, it is allowed to leave at the end of the line one-letter prepositions and alliances within the sentences, as well as three-letter prepositions starting the sentence.

P. G. Gilinson. "Handbook of technical and artistic editors" M .: 1988. P. 11.4.1.1, p. 422

Unfortunately, this is not a very clear rule. Do all the spaces in this block have to be inseparable: “Why and with 1,000,000 friends ...”? And in what cases this “should not be left” should be preferred over “should not be allowed too sparse lines” and “should not be allowed white corridors in the text”?


In addition, this rule is not quite clear to me aesthetically. Sometimes it leads to the fact that a whole series of lines begins with single-letter words. Is it beautiful? Does this add readability? Once in our student years, wrapping the news in a narrow column, we got 4 lines in a row, starting with the preposition "in." Editing the text, brought this number to 6 - and went to print. But that was pure hooliganism.


I propose to change this rule. On the following code for LaTeX:


 \usepackage{newunicodechar} \newcount\afterconjunctionpenalty \afterconjunctionpenalty=1000 \newunicodechar{⋅}{\penalty\afterconjunctionpenalty\ } 

Thus, we will get two special characters in LaTeX: “~” to denote an inseparable space and “⋅” to denote a weak discontinuous space. The value of the fine can be chosen to taste or even change locally.


And then a few regular replacements in the text.


regexp

Do not tear off the single-letter words at the beginning of a sentence for anything:


 ([^--])([-])\s+ $1$2~ 

Multi-letter unions and prepositions at the beginning of a sentence would be good not to tear off:


 ([^--])(|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||)([,]*)\s+ $1$2⋅ 

One-letter unions and prepositions inside the text would be good not to tear off the multi-letter words (some sticking to the next word, some to the previous word):


 ([^--][])\s([--]{2}|[0-9]+) $1⋅$2 \s+([]\s) ⋅$1 

I've been working for some time already and I like it :-)


I wonder if these chips will ever move to InDesign and web typography?


')

Source: https://habr.com/ru/post/339110/


All Articles