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

learn more… | top users | synonyms (1)

3
votes
1answer
808 views

Line Breaks in Text Mode not Working

This is a follow up from my previous question I am writing a large document in LaTeX, part of which is giving me much grief. Specifically, I have described an algorithm in several numbered steps. I ...
2
votes
1answer
302 views

How should I do manual line breaks?

How do I break lines manually? Methods I use: \linebreak \\ \n Which is the recommended one? Example: If I just put like this in my tex file, This is for people who love VIM and for people who ...
1
vote
1answer
732 views

How to remove line breaks before and after theorems?

By default, in the amsthm package, when you begin a theorem, LaTeX begins on a new line, and when you end the theorem, it also jumps to a new line. How can you prevent this behavior? For example, I ...
14
votes
3answers
6k views

How to avoid using \sloppy document-wide to fix overfull \hbox problems?

How to avoid using \sloppy document-wide to fix overfull \hbox problems? This is my minimal working example. \documentclass[12pt]{report} \usepackage[english,ngerman]{babel} ...
13
votes
5answers
620 views

How to split a long formula and make it beautiful?

My method: \documentclass[UTF8]{ctexart} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{epstopdf} \usepackage{inputenc} \begin{document} \begin{equation} \begin{split} ...
41
votes
1answer
5k views

Breaking equations with breqn

I am new to using the breqn package. It looks good, but I get an odd behaviour when an equation can almost fit in the page but not quite: the alignment gets completely wrong. Is there a way to fix ...
25
votes
4answers
10k views

Prevent line breaking in inline math, but allow flexible spacing

How can I easily tell Latex to prevent line-breaks inside a part of an inline formula, without affecting inter-word spacing? Writing something like $ab(c+d)$ in Latex is bad: Latex might put a line ...
22
votes
2answers
788 views

Repetition of a word on two lines

This question led to a new feature in a package: impnattypo There have been questions about rivers asked in the past. I'm wondering about words that are repeated in the same place on two ...
21
votes
1answer
6k views

Underfull \hbox in bibliography

I am getting lots of "Underfull \hbox" warnings that point to the *.bbl file. It looks like these messages appear only when URLs are very long, like in the below example: @techreport{nistguidesec, ...
4
votes
1answer
67 views

Specify number of columns in brqalign

Some time ago David Carlisle wrote an awesome brqalign function in this answer: http://tex.stackexchange.com/a/51543/4011. See the cited code below. How to modify the brqalign environment such that ...
30
votes
2answers
4k views

What is the difference between \nobreak and \nolinebreak?

What is the difference between \nobreak and \nolinebreak? I noticed that a lot of solutions in TeX.SE use the former, but I thought the latter is LaTeX while the former is plain TeX. And LaTeX macros ...
12
votes
1answer
2k views

Typeset a dialogue?

I need to typeset a dialogue in LaTeX, it's for a translation assignment. The original dialogue does something like this: - I found it, I told him. My finger was in the book, where George Best's ...
19
votes
1answer
2k views

Difference between \\ and \tabularnewline

What is the difference between \\ and \tabularnewline? Is it same as the difference between \\ and newline? Is \tabularnewline preferred over \\ when creating tables?
11
votes
4answers
5k 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 ...
9
votes
2answers
399 views

How to deal with very long lstinline-phrases like long class names?

According to this Question: listing: How to deal with very long lines that do not contain spaces? My problem is that my \lstinline-phrases does not contain any special character like "-". In my ...
9
votes
2answers
888 views

Avoiding a line break at the beginning of an enumerate

How can I avoid the line break at the begin of an enumerate environment? I've noticed that theorem-style environments succeed in doing so. I'm using the enumitem package and my concrete example is: ...
8
votes
3answers
754 views

An environment for setting \emergencystretch locally

The following environment, copied from this website about dealing with overfull hboxes, allows one to change the \tolerance parameter for just the paragraph(s) it encloses: ...
8
votes
1answer
2k views

Adjust the indentation whithin the algorithmicx-package when a line is broken

I have this code \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm} \caption{Minimal Working Example for my Problem} ...
8
votes
1answer
2k views

How to print in algorithmic package for some If condition or For loop in one line?

How to print \FOR{$j:=0,\ldots,i-1$} \STATE{$\C_{ij}:=\C_{ii}\cdot\C_{ij}$}; \ENDFOR in one line instead of two line?
7
votes
1answer
327 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 ...
6
votes
2answers
347 views

Automatic repetition of mathematical operators after a line break

In handwritten mathematics it is common for the sake of clarity to repeat the last mathematical operator in those line breaks that occur in the middle of a formula. I mean something like: We compute ...
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
1answer
2k 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 ...
16
votes
1answer
680 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 ...
14
votes
1answer
33k 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 ...
10
votes
3answers
2k 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
265 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
187 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 ...
8
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 ...
7
votes
1answer
333 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
485 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 ...
6
votes
1answer
3k 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 ...
2
votes
0answers
85 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, ...
19
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} ...
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
160 views

Does \\* within footnotes have any effect?

One is taught that \\* is an alternative to the line-breaking \\ that tries (often unsuccessfully) to inhibit a page break. Normally \\* would be used in ordinary ("body") text. (And I hereby ...
10
votes
3answers
2k 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
103 views

Use non-breaking space after name initials with biblatex macros

I want to enforce biber/biblatex to place non-breaking spaces between initials and last names of authors. Example: \documentclass{article} \usepackage[backend=biber,natbib=true]{biblatex} ...
8
votes
1answer
182 views

Break line only if it's too long, but breaking won't create a new page

I'm the author of the contracard package/class for typesetting calling cards for traditional dances. Currently, if you typeset a particularly long figure on a calling card it wraps like this (look at ...
8
votes
1answer
828 views

How to get XeLaTeX do proper hyphenation and full justification?

I want to use XeLaTeX to design a paperback (11x19cm) using Adobe's Garamond and Myriad as custom fonts. It is entirely written in German. However, both hyphenation and full justification are a mess: ...
8
votes
1answer
220 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
1answer
466 views

Underfull/overfull preference

When long words at the end of a line cannot be hyphenated (for example when hyphenation is suppressed with \mbox{}), LaTeX could either have the tendency to make lines overfull or the tendency to make ...
8
votes
2answers
474 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
3answers
227 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 ...
7
votes
2answers
296 views

How come the tilde ~ sometimes does not behave like non-breaking space?

This is again one of the behaviors that are quite difficult to catch in a reconstructible (and simple) example, so one has to resort to animations. Basically, the issue is this: the tilde (~) is ...
7
votes
2answers
77 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
153 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
308 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 ...