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

learn more… | top users | synonyms (1)

72
votes
1answer
11k views

Manual/automatic line breaks and text alignment in TikZ nodes

How can I insert a line break in a TikZ node? Simply putting \\ where I want the break doesn't work (see MWE). Is there a way to make lines break automatically at some specified width? And can I ...
235
votes
17answers
155k views

How to add a forced line break inside a table cell

I have some text in a table and I want to add a forced line break. I want to insert a forced line break without having to specify the column width, i.e. something like the following: ...
66
votes
4answers
118k views

How can I split an equation over two lines

I am having the following equation: \begin{equation} Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P(O \mid \lambda ) \sum_s \sum_m \sum_t \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} ...
72
votes
9answers
31k views

Forcing linebreaks in \url

I wish to typeset some relatively long URLs in a piece of text, and when I use \url{..}, the resulting text does not respect the margin boundaries that govern the main text body, instead going all the ...
60
votes
2answers
12k views

When to use \par and when \\

What is the difference between \par and \\ and when should I use \par instead of \\?
73
votes
2answers
25k views

What does “overfull hbox” mean?

I often see output from TeX with the warning overfull hbox, badness 10000. What does this message mean?
66
votes
3answers
30k views

What are underfull hboxes and vboxes and how can I get rid of them?

Often, TeX outputs underfull hbox and vbox warnings when running and in the generated log file. What are these and how can I get rid of them?
42
votes
6answers
16k views

How can I write multiple lines in a subscript?

Is there a way to force a line break inside a math mode text? My example: \[ \underbrace{....}_\text{Some long text that should be multiline} \] Trying \text{Some long text that\\ should be ...
50
votes
3answers
16k views

Allowing line break at ',' in inline math mode?

In the inline math mode ($...$), if the formula is too long, LaTeX will try to break it on operators, e.g. very long text followed by a very long equation like $a+b+c+d+e+f+g+h+i+j+k+l$ etc may be ...
19
votes
5answers
1k views

Wrapping long lines that contain no spaces

I need to format extremely long strings of text. I would like to be able to specify their width, and have them wrap, with or without some special symbol to indicate that the line is wrapped. The ...
59
votes
4answers
125k views

How to break a long equation?

I have a long equation but long enough to occupy two lines. I want to break it to improve readability. How can I break it? \begin{equation} F = \{F_{x} \in F_{c} : (|S| > |C|) \cap (minPixels ...
43
votes
5answers
47k views

How to break a line in a table [duplicate]

Possible Duplicate: How to add a forced line break inside a table cell In a table I would like to have a line break in the text inside a cell. Is there an easy way to do so, or do I have to ...
30
votes
3answers
15k views

How to get long \texttt sections to break

I often format path names with \texttt which can be very long. Usually Tex will not break this text. The line will just create a hbox overflow. It looks like this: ................ ...C:\documents ...
16
votes
3answers
815 views

Rounded box around placeholder text that supports line breaking

I want to draw a rounded box around a piece of text like that: The left and right borders should be half circles and line breaking should be supported. This my code so far: \setuppapersize[A7] ...
12
votes
2answers
19k views

Phantom and line break

I want to make a cloze test using LaTeX. My Idea was to use the \phantom command to produce the space: Some text \underline{\phantom{some text to complete}} some more text. Now the problem is that ...
46
votes
6answers
16k views

Prevent LaTeX to break an inline math equation

I hope this question was not asked before. At least I haven't found it. I have an inline math equation and LaTeX is breaking it into two parts. In this case I'd prefer to have the whole and short ...
24
votes
2answers
9k views

Line breaking of URLs in bibliographies

I have a problem with the line break of an URL. The URL can´t break correct and extends into the border. I´ve tried some things. Amongst others I loaded the package breakurl, but without any success. ...
32
votes
2answers
9k views

Why does underlined text not get wrapped once it hits the end of a line ?

Sometimes I want to underline some text, and it extends past the end of a line. Why does \underline{} not automatically wrap my text for me ? Also, how can I underline text so that it will still ...
15
votes
1answer
4k views

Verbatim environment and line-breaking

I've been wondering about how to display simple codes. I used verbatim and then found the fancyvrb package which added a lot of nice little features, but then I inserted some code with a long line and ...
8
votes
1answer
2k views

“Allowing line break at ',' in inline math mode” breaks citations

In answering another question allowing line break at ',' in inline math mode, Stefan Kottwitz suggested two excellent ways to allow line breaks in inline math mode after ,. One way was to use the ...
63
votes
5answers
4k views

Avoiding “rivers” in successive lines of type

This question led to a new feature in a package: impnattypo The following quote is from James Felici, The Complete Manual of Typography (2003), p. 161: Rivers occur when word spaces stack ...
21
votes
2answers
4k views

Reduce bibliography to one line

Quick question, hopefully with a quick answer. I'm writing a paper where I'm limited by length (2 pages) and I need references, but it doesn't have to look nice. I'd like LaTeX to compress my ...
19
votes
1answer
4k views

URL line breaks with biblatex

How do I allow long URLs to have line breaks at any point. This is in the bibliography not the main text. I am trying to save space so don't want extra spaces to be added to make it only break at ...
67
votes
1answer
29k views

What is the difference between \newline and \\?

As far as I know, \\ and \newline both insert a new line. But they do not have an identical expansion and tracing shows they do not execute the same commands, so what is their difference?
45
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 ...
29
votes
2answers
805 views

Ensure minimal length of last line

This question led to a new feature in a package: impnattypo One rule in French typography is that the last line of a paragraph should not be shorter than the double of the indentation of the ...
23
votes
4answers
14k views

Verbatim environment that can break too long lines?

I want to generate a PDF of user-submitted text using LaTeX. To handle crazy user input, I first thought about using the verbatim package, but of course it doesn't break up too long lines. Is there ...
22
votes
5answers
7k views

How do I make LaTeX push long citations to a new line?

When I use the \cite command for my citations, often LaTeX will overflow the margins for my lines, and the text looks pretty bad. How can I make LaTeX push long citations to the next line ...
17
votes
3answers
8k views

Include a line break in algorithmic while maintaining indentation

I have this code: \DeclareCaptionFormat{algor}{% \hrulefill\par\offinterlineskip\vskip1pt% \textbf{#1#2}#3\offinterlineskip\hrulefill} ...
20
votes
2answers
4k views

How can I prevent LaTeX from breaking inline formulas globally?

I am using the acmsmall template and my inline formulas are being broken at equal signs and arrows; how can I prevent them from being typeset like that globally (i.e. without having to put tildes ...
18
votes
1answer
4k views

How to suppress overfull hbox warnings up to some maximum?

I want LaTeX not to give warnings for overfull hboxes up to some maximum of say 2 pts. How to achieve this?
11
votes
1answer
297 views

Error with table

\begin{table}[ht] \makebox[\textwidth][c]{ \begin{tabular}{ccccc} \hline \hline [] & [] & [] & [] & []\\ [] & [] & [] & [] & []\\ ...
7
votes
2answers
3k views

Why is text being placed beyond the specified line width?

I thought that I knew a few things, but looks like I have some basic misunderstanding on how TeX is supposed to typeset material. I thought that settings by the geometry package would force the text ...
4
votes
2answers
518 views

White spaces between color tabs and two other questions

!Partially solved! How to remove small white spaces between color blocks? (when you compile this tex there are small white spaces between the & \cellcolor{EM}\& & \cellcolor{EM}\\) I ...
24
votes
3answers
13k views

Prevent hyphenation and use line break in block of text

I have a custom block of text on my title page which can be longer than a single line. By default LaTeX is hyphenating a word at the end of a line, but I want it to break on to the next line. How do ...
16
votes
3answers
1k views

Changing the style of the first *typeset* line of a paragraph

I've been playing around with dropcaps in LaTeX (with the yfonts and lettrine packages), and one typographical effect you often see after dropcaps is having the entire first line of the paragraph ...
11
votes
1answer
2k views

Breaking links and escaping characters in bibliographies with backlinks and ocgcolorlinks set

I have the following situation: I have to use the ocgcolorlinks option in hyperref, so that links are not broken. So I had the idea to set each char as a link with \href. After putting some code ...
19
votes
2answers
7k views

How to deal with bibliography items containing long URLs?

A picture is worth a thousand macros: I don't blame LaTeX for having difficulty in formatting this entry. What can I do, however, to alleviate the effects and avoid the Word-like indentation? A ...
15
votes
5answers
2k views

Is it possible to skip the first line in a theorem environment?

I'm currently writing up some solutions, and I like to rewrite the problem before answering it. I've set exercise to be a theorem environment, and the code I'm using is \begin{exercise} ...
10
votes
3answers
730 views

Censor text spanning multiple lines

I'd like to censor or hide some text while replacing it with the appropriate amount of white-space. The replacement text cannot be searchable. The text to be hidden usually exists in the LR mode. The ...
35
votes
7answers
8k views

Allow line break, but without inserting a dash

I have a sentence that contains a number of long dataset names. I would like to allow LaTeX to break these names at certain positions that I would like to specify somehow just like I can use \- to ...
22
votes
2answers
5k views

Why should I put a ~ before \ref or \cite?

My question is in the title of this post, but extends to other referencing commands like \eqref, \citep, \citet (and the like) as well.
20
votes
4answers
21k views

Aligned equations in LaTeX

I have a long equation in LaTeX, which I need to break up into more lines. I've done this, although its not quite what I was looking for. Here is a MWE showing my problem: ...
15
votes
2answers
5k views

\texttt overfull hbox problem

I asked a question earlier about \verb and overfull hbox : In-line \verb -- overfull hbox problem And regarding the solution there, changed many of my \verbs to \texttt{}s. I have come up with a new ...
16
votes
7answers
5k views

LaTeX not hyphenating properly, text running off page

I'm having a problem with LaTeX not hyphenating $\beta$-galactosidase, and the word as a result running off the page. I have narrowed down the problem to a particular package, as a bare minumum LaTeX ...
12
votes
5answers
4k views

Why do hyphenated words cause margin violations (and how can I prevent it)?

Sometimes my text goes past the right margin when there is a hyphenated word involved in the sentence. For example, in the figure below, the line that contains "inter-member" extends further right ...
18
votes
1answer
217 views

Why does a color meant for the first typeset line *only* (with package magaz) affect the *entire* document?

I am trying to make a nice layout that gives a different style to the first line in a section using the package magaz. All examples I have seen feature some variation of small caps {\scshape text} or ...
14
votes
2answers
8k views

No hyphen for a word

I want to put pdflatex to not put a hyphen in a word went it comes to the end of the line. I tried to put a \- in the beginning or the end of that word but it doesn't work. For example if I put:This ...
10
votes
2answers
2k views

Force line break inside a \lim argument in align environment

Inside an align environment I have a \lim with two variables which should be displayed in two lines: \begin{align} ... f & = \lim _ {a \rightarrow -\infty \linebreak b \rightarrow \infty} ... \\ ...
9
votes
2answers
9k views

Line breaking (or hyphenation?) of references in apalike

This is a problem I encountered some time ago and I never could solve it: how can you achieve correct line-breaking or hyphenation when citing references with the apalike style? Here is an example: ...