{line-breaking} is about how (La)TeX breaks paragraphs into lines and how those breaks can be influenced.

learn more… | top users | synonyms (1)

18
votes
1answer
964 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 ...
16
votes
1answer
616 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 ...
10
votes
4answers
3k views

Text out of margins

I don't know why, but a line in my text is out of margins. How can I avoid this issue? I'm using classicthesis in TeXworks. Edit: with the command \overfullrule=5pt I can see a black square ...
10
votes
3answers
1k views

Why \linebreak doesn't work when text width is not set?

This is the code I have: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \tikz \node[rectangle split, rectangle split parts=2] ...
10
votes
2answers
260 views

Place TikZ coordinate or \zlabel at every (base)line

I'm currently adjusting the code shown in Test if a paragraph has a page break in it? to support underlining and highlighting using TikZ similar as shown in Cool Text Highlighting in LaTeX, but ...
9
votes
2answers
178 views

stacking text for cryptography

What is the best way to stack long passages of (fixed-wdith) text on top of each other? I am writing exercises and solutions for a cryptography class and would like to be able to have plaintext above ...
7
votes
1answer
284 views

Penalty or badness for linebreak near start or end of sentence

I would like to set a penalty or badness for breaking a sentence (or the contents of some \command{...}) too early. More specifically, I would like the penalty of a line break to be dependent on the ...
7
votes
2answers
423 views

Environment to allow line breaks at `,` in math mode

I find the question and accepted answer to Allowing line break at ',' in inline math mode? very useful, BUT I would like to make an environment (e.g. "allowbreaks"} out of it. The problem is that I'm ...
7
votes
4answers
3k views

How can I force long chapter names (including page numbers) to stay in the margins on the table of contents?

I'm somewhat new to LaTeX and have been tasked with satisfying some strict formatting requirements for this LaTeX document using a custom class. Currently, if there is a long chapter name (within a ...
6
votes
1answer
284 views

Right-aligned line-break with long verses in verse

I'm happily using the verse environment to typeset French poetry. However, I'm unsatisfied with the behavior of long-line breaks (when the verse is too long to fit on the page). The verse behavior is ...
2
votes
0answers
68 views

break line at comma inside listings [closed]

I'm trying to do some listings environments, but I'm encountering problems. The ideal output is this: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,⤦ ⤷ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
18
votes
3answers
1k views

LaTeX word wrapping poorly

LaTeX is not word wrapping this anything close to sanely: \documentclass{article} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{geometry} \usepackage{lipsum} \geometry{margin=1in} ...
17
votes
1answer
1k views

How to join paragraphs with a pilcrow \P?

Background There are many typographically distinct ways to separate paragraphs from one another, the most common being starting each paragraph on a new line with either an indent or additional ...
15
votes
1answer
1k views

Difference between control space and non-breaking space

In my answer to How can I get following layout? I've used non-breaking spaces ~ (ties) to align monospaced text. Actually I rather meant control spaces \ , but they're less convenient to type (and ...
14
votes
1answer
7k views

in-cell newlines (in tabular environments)?

I'm working on a table containing multi-line cells and I wonder if the following concept is supported by LaTeX. The concept itself is simple: allow a cell to span multiple lines by increasing the ...
12
votes
1answer
28k views

In-line \verb — overfull hbox problem

I'm having a problem that I've had before and I'm tired of hacking my way through it and hope that there is some supported solution. I'll go ahead and create a document for example: \documentclass ...
9
votes
3answers
1k views

Proof environment - line break after the “Proof.”

I want to make the proof environment in amsthm package to auto add a line break right after the "Proof." I tried the following code, which also removed the QED sign, but it doesn't work: No linebreak ...
8
votes
1answer
206 views

Line breaks in listings

Is there a way like wrap the line after at most 60 letters but it should not break inside some commands like listings does? Example: \documentclass[a5paper]{article} \usepackage[T1]{fontenc} ...
8
votes
2answers
444 views

How to wrap text in a table when there are no spaces at which to break the line?

I have a lot of text in table. I want to wrap it with in 2cm. In the last column, I have [1][2][3].....[89][100] but the column width is only 2 cm. It is supposed be wrapped by itself. How can I ...
8
votes
2answers
7k views

Writing an equation in a new line

I wish to write an inline equation using $%math...$, but the current line is too long, so the equation is broken into two parts, first one in the original line, and the other in a new line. I don't ...
8
votes
1answer
4k views

Line break in edge labels in tikz graph

I'm using tikz and pgf to draw state machines in a document, and I'd like to be able to have a multiline edge label between two nodes. Something like the following would be ideal: \begin{center} ...
7
votes
2answers
71 views

Line break in macro

I have defined a macro in my document as \newcommand{\FSeq}[2]{\ensuremath #1_1, #1_2, \ldots, #1_#2} The problem is that surpasses the margin usually. Is there anyway to solve this problem? I ...
7
votes
1answer
149 views

Why does Context line-break my quotation and leave the quotation sign on it's own row?

Using Context to set a book I have the following problem: Context linebreaks some quotations in a way that makes the quotation sign (in my case a guillemet [sic!]) appear on its own row. How can i ...
7
votes
1answer
270 views

Shipout line like Shipout page

In lineno package guide, I found: Attaching line numbers after TeX has broken the paragraph into lines is already quite a difficult job for TeX. Why? Because TeX does not normally give you any ...
6
votes
1answer
67 views

How do \widowpenalty and \clubpenalty interact for a 2-line paragraph?

Sometimes \\* does not suffice to prevent a linebreak. Adding {\widowpenalty10000 \par} or {\clubpenalty10000 \par} helps if the separated line is paragraph-final and stranded at the top of a page ...
6
votes
1answer
235 views

TikZ: Text alignment and line breaking

I have some troubles with text alignment along path in tikz. I made custom shape and wrote text along path inside it in the following way: \documentclass{article} \usepackage{tikz} ...
6
votes
1answer
191 views

biblatex: no linebreaks in name lists when typesetting ragged-right

When typesetting a bibliography \raggedright, biblatex seems to have trouble breaking a line between an author's first/last/middle names (and, if multiple authors are present, between two authors). ...
6
votes
1answer
6k views

Tabular: Underfull \hbox (badness 10000) in paragraph at lines

I read all the questions regarding the error message Underfull \hbox (badness 10000) in paragraph at lines but I am still not sure if my code is correct. The problem is with the tabular of a table. ...
6
votes
1answer
301 views

Biblatex breakline Doi

I'm using the XeTeX with BibLaTeX and biber. That's the line: \usepackage[backend=biber, citestyle=authoryear-ibid, bibstyle=authortitle-ibid]{biblatex} It's working fine but I'e just get one ...
6
votes
4answers
3k views

Something like \raisebox that respects line breaks

If one wants to raise some text one uses something like \raisebox{0.5 em}{some text} However this doesn't respect line breaks and may cause some nasty overflows. Is there a way to have \raisebox ...
6
votes
1answer
2k views

line break inside cases environment

I have an equation using a cases environment, with one case with a long description text: \begin{eqnarray*} \begin{cases} 1 \text{too long description of the first case, not ...
5
votes
4answers
84 views

How to span \textit{} and \Large several lines in \author{}

I would like to span \textit{} in several line in \author{} tag. So far I know I can do this ( but here \LARGE will only affect the Name) : % title \title{\textbf{Cool title}} \author{\LARGE ...
5
votes
1answer
94 views

Make less space between lines on a table

I have a big table where I need to use multiple lines on each cell. The table is too big though so I need the space between lines on each cell to be smaller. I found on another post that I could use ...
5
votes
2answers
360 views

References in margins `biblatex`

How can I use biblatex and not have the references run into the margins? I've seen some posts and solutions to this problem pertaining to URLs but I'm not using web links so it's a different problem. ...
4
votes
1answer
92 views

Line breaking and alignment in list

Consider the following code: \documentclass[ a4paper, 12pt ]{article} \usepackage[ hmargin=2.4cm, vmargin=3cm ]{geometry} \usepackage{amssymb} \usepackage{enumerate} % better to use ...
4
votes
3answers
174 views

Automatic line-breaks in tables?

I'm writing a short tabular CV that I have to add to my thesis. I thought a quick way would be to use a table for that purpose: \begin{tabular}{ll} 2009-present & very long text 1, very ...
4
votes
1answer
380 views

Command \obeylines in a macro

I need to collect data (a sequence of input strings) in the preamble of a document, but the strings are to be typeset later in the document and must obey the line breaks set when typing the strings at ...
4
votes
2answers
519 views

Macro to convert 'multi-line' text to 'single-line' (remove line breaks?)

Consider the following example: \documentclass{minimal} \def\myMultiLineText{% Line One Line One \\ % Line Two Line Two \\ % Line Three Line Three \\ % Line Four Line Four % } \begin{document} ...
4
votes
2answers
2k views

Starting an enumerate of an enumerate on next line?

What I'm trying to do is to make my enumerates look like this a) i) answer ii) answer b) answer Currently, I'm using \begin{enumerate} \item \hfill \\ \begin{enumerate}[a)] \item ...
3
votes
2answers
94 views

Using \color in a paragraph column inside a tabular environment results in a line break [duplicate]

Some of my documents are compiled into multiple outputs. Some Versions contain certain parts, while other versions contain only a placeholder. For this purpose I have a macro \markup that colors its ...
3
votes
1answer
260 views

Changing vertical alignment of items in middle of line (for ToC entry)

Well, I'm really starting to hate LaTeX sometimes - mostly because you can't really learn one thing, and have it applied everywhere else you wanted :/ For instance, I asked the question Changing ...
3
votes
2answers
1k views

Why doesn't \newline work inside lstlisting?

I am new to LaTeX and am using a template provided by a friend: \subsection{P2P library} The library is implemented in C-Sharp and provides two basic facilities - maintaining a member list at every ...
3
votes
1answer
1k views

An environment to change the vertical space around a formula

Specially in beamer presentations, I use a custom environment to change the vertical space around a formula. The code is: \newenvironment{shrinkeq}[1] { \bgroup ...
2
votes
1answer
162 views

Title indentation after linebreak

I have a document with a few long-named sections, which break at two lines, like this: To meet some standards I need to change indentation of these titles (after \linebreak) at the level of normal ...
2
votes
2answers
699 views

Theorem formatting: strange interaction with itemize

This question is related to this one. I want to have theorem headers alone on a line like this: Theorem 1. some text... In the amsthm documentation, they suggest doing this: ...
1
vote
1answer
273 views

Prevent the overflow of text

I'm having some Yiddish text overflow it's box in a XeLaTeX document. I suspect there is a simple command to stop this from happening. Does anyone know an easy solution or do I need to make and post a ...
15
votes
4answers
845 views

How can I make (La)TeX prefer to fill centered lines

My thesis formatting requirements ask for multiline chapter and section titles to be a maximum of 4.5 inches wide with any subsequent lines being wrapped such that they are sucessively shorter, ...
14
votes
1answer
148 views

Does \\ suppress hyphenation for the following word?

I am not sure, if this is a bug of the package showhyphens or some LaTeX-behaviour I don't understand. Please have a look on the following example: % arara: lualatex \documentclass[ngerman]{article} ...
14
votes
3answers
384 views

How to insert a non-stretching but line-breaking thin space?

How do I insert a small space that looks like the space I get with \, but allows a line break like a normal space does? I.e., I'm looking for a non-stretching, non-non-breaking space whose width is ...
10
votes
2answers
847 views

Wrong line break in description environment after a long label

I encountered an issue with my description environments: If I use a label that almost is as long as the text width, the explanatory text afterwards is not wrapped correctly. I am using the mdwlist ...