7
votes
3answers
216 views

How does (or, what happens when) Tex typeset(s) a line and linebreak?

I could not find references to this with a cursory search, so I thought I'd post a question; I'm aware this is probably discussed at length in the Tex book or similar, but unfortunately I don't have ...
0
votes
1answer
33 views

Reduce the number of lines of a paragraph [duplicate]

How can I tell Latex that I want my paragraph with n less lines? I saw a question some days ago, but after twenty minutes of heavy searching (I think), I found nothing. There is a “penalty” or ...
0
votes
0answers
29 views

Inserting a line break in a formula [duplicate]

I have the following formula in LaTeX: \begin{equation} =\sqrt[m]{\mid C_{new}\left(pi\right)-f\left(pi\right)\mid^{m}-\mid C_{k}\left(pi\right)-f\left(pi\right)\mid^{m} ...
44
votes
3answers
1k views

Why no vertical-mode Knuth-Plass?

I have only basic knowledge of the TeX internals, so I hope what I am saying here is not complete nonsense. If I understand correctly, in TeX, horizontal positioning / line breaking is done using a ...
1
vote
0answers
44 views

How to break long expressions automatically in displaymode? [duplicate]

Whenever an expression is too long, it will be broken automatically in inline mode but done nothing in displaymode E.g. MWE: \documentclass[11pt]{article} \begin{document} ...
4
votes
3answers
231 views

How are space tokens and empty lines processed by long commands (as their potential arguments)?

How are spaces and empty lines processed by long commands (i.e., those that do not accept paragraph breaks inside)? Are there different space tokens aside from " " and an empty line? It appears that ...
23
votes
4answers
588 views

unexpected interaction between \raggedright and \parshape

While answering Random start of line, I came upon a strange interaction between \raggedright and \parshape. If a ragged-right paragraph ends in a short line, this line will be "the most ragged". ...
4
votes
2answers
356 views

What is the ConTeXt or plain TeX equivalent of \nolinebreak?

The command \nolinebreak[4], if placed between two characters, should prevent a line break from appearing in that location. This command does not seem to be defined in ConTeXt. Is there an equivalent ...
16
votes
1answer
657 views

Is it still worthwhile to let TeX try line-breaking without hyphenation?

Here's TeX's line-breaking approach (as I understand it) in a nutshell: If \pretolerance is positive, try to break a paragraph into lines without inserting discretionary hyphens and without ...
11
votes
3answers
497 views

How to display only certain lines of a paragraph?

From reading Knuth's TeX Book (Chapter 14 How TeX Breaks Paragraphs into Lines), I understand that entire paragraphs are read in and then "massaged" by the "line-breaking algorithm" in an optimal way ...
18
votes
1answer
1k views

Knuth's line breaking algorithm

I'm trying to understand the basics of Knuth's line breaking algorithm. At the beginning of Chapter 12: Glue of his TeXbook, there is a figure like the one below. My question is: where did those ...
17
votes
2answers
4k views

What's the difference between \tolerance and \badness ?

I'm having some difficulty understanding this sentence on page 29, Chapter 6 of Knuth's TeXbook: Run TeX again, and begin this time by saying \hsize=2in \tolerance=1600 \input story ...
5
votes
1answer
229 views

Discouraging line break in an alignment

In the question Generate table with dynamic number of columns the OP posed a question to which my initial reaction was "No". However, now I've run into something interesting which, if I'm reading it ...
5
votes
2answers
270 views

How to spread words in several lines uniformly?

In TeX, I can use \hbox to 1in{foo bar baz} to get Is it possible generalize the use, to get this result: by typing a paragraph foo bar baz test text only? I tried \break to break lines at ...
12
votes
2answers
408 views

New lines and TeX: difference between ^^J and ^^M

What is a new line for TeX in the following contexts: When reading from a file. When writing to a file. After having read a % character. In a \scantokens. I am asking in particular because the ...
9
votes
1answer
1k views

Newline/linebreak in \message

I want to prompt some messages to my console. I used \message{Hi out there!} Now i want some more Text but with an linebreak. \message{Hello World %some line break here Salut monde } Well i ...
4
votes
3answers
451 views

Restricting the length of a line of text while allowing line breaks

While attempting to answer this question, I re-read Chapter 14 of The TeX Book (on how TeX breaks paragraphs into lines). It got me thinking: Is there a way to restrict the length of a string of text ...