{line-breaking} is about how (La)TeX breaks paragraphs into lines and how those breaks can be influenced.
32
votes
4answers
31k 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)} ...
45
votes
7answers
12k 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 ...
109
votes
14answers
63k 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. Something like this:
\begin{tabular}{|c|c|c|}
...
36
votes
3answers
12k 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?
21
votes
5answers
4k 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 ...
14
votes
3answers
824 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 ...
36
votes
2answers
8k 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 ...
53
votes
5answers
3k 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 ...
23
votes
6answers
6k 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 ...
50
votes
2answers
11k views
What does “overfull hbox” mean?
I often see output from TeX with the warning overfull hbox, badness 10000. What does this message mean?
31
votes
5answers
22k 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 ...
21
votes
3answers
7k 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 ...
12
votes
1answer
2k 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 ...
7
votes
2answers
1k 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 ...
17
votes
2answers
4k 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. ...
16
votes
3answers
835 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 ...
21
votes
4answers
6k 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 ...
23
votes
1answer
3k 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 ...
13
votes
3answers
3k 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}
...
17
votes
2answers
1k 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 ...
9
votes
3answers
879 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} ... \\
...
8
votes
1answer
7k 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 ...
7
votes
2answers
2k views
How to prevent LaTeX from line-breaking a phrase?
How can I prevent LaTeX from putting line-breaks into a phrase?
I could replace dashes with "~ and spaces with non-breaking spaces, but I'm looking for a more general solution in case I need other ...
5
votes
1answer
830 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 ...
3
votes
1answer
2k views
hyperref url breaking
References: Forcing linebreaks in \url
So, in a plain document with
\usepackage{url}
\begin{document}
You can find this at \url{very-long-url}.
\end{document}
the URL will be broken down, e.g. ...
3
votes
2answers
5k 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:
...
18
votes
2answers
2k 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.
5
votes
2answers
89 views
Line break in citation with organization as author
I have the following reference:
@MISC{EX2012,
author = {{S}ingle {A}uthor {O}rganization},
year = {2012},
title = {Example}
}
A citation for this is breaking after "Author", but extending ...
33
votes
1answer
7k 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?
19
votes
2answers
5k 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
2answers
457 views
What is the right way to use of non-breakable space before math expressions?
I have seen LaTeX code that
puts a ~ between every math expression and the text preceding it,
does not use ~ in this manner at all, and
uses a ~ in this way if and only if the math expression ...
24
votes
2answers
497 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 ...
16
votes
2answers
3k 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 ...
18
votes
2answers
2k 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 ...
13
votes
1answer
2k 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 ...
12
votes
2answers
3k 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 ...
7
votes
1answer
692 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 ...
10
votes
1answer
2k 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?
8
votes
2answers
279 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 ...
7
votes
2answers
3k views
How can I make my text never go over the right margin by always hyphenating or breaking on word-boundaries?
I've seen several different methods that can be used to make long words not go over the right margin, but all of them have been paragraph-based. I need a solution that can apply to the entire text ...
6
votes
2answers
2k views
paragraph style - how to force line break? \paragraph{} \\ - make paragraph a header?
I want to format paragraph to work as a regular title
\paragraph{title} text goes here
output of that is:
title text goes here
how can I change the output to force line break and use the usal ...
11
votes
3answers
412 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 ...
9
votes
3answers
626 views
How to deal with very long lines that do not contain spaces?
I have a problem with a lstlisting environment. I want to use it for displaying several very long lines that can not be reformatted. Independently of the option breakatwhitespace=true or false my ...
8
votes
5answers
2k 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 ...
7
votes
2answers
1k views
Skipping line after “Proof” in proof environment
Like the OP in Is it possible to skip the first line in a theorem environment?, I would like to be able to skip a line after the word "Proof" so that the first line of the proof is actually part of ...
5
votes
2answers
198 views
Biblatex: URL-breaking not working in DVI-mode
I'm preparing my bibliography and noticed that biblatex-printbibliography produces Overfull \hbox several times.
Examples (gray lines indicates text margins, red line is the physical page margin):
...
4
votes
1answer
318 views
Listing, zebra effect and broken lines
In Creating a zebra effect using listings, I've found one solution to produce a zebra effect for listing.
Unfortunately, this only works if the lines are not broken. Is there a way to fix this?
Here ...
4
votes
1answer
336 views
How to adjust macro to respect current \linewidth?
I'm having issues with text going past the end of the specified \textwidth. I posted this question about why text was being placed beyond the specified line width. The MWE provided there produced ...
3
votes
2answers
282 views
Adding extra lines/spaces in source, *not* affecting semantics
I'm editing a file with quite huge interleaves of text and formulas like this
lorem ipsums
\begin{align}
foo & bar\\
qux & rofl\\
& toto
\end{align}
lorem ipsums
…
And I face ...
108
votes
5answers
3k views
How to define the badness of a river?
I've written an algorithm to try and detect rivers in paragraphs and it actually detects quite a lot when I run it. Some of them are clearly false positives, but there are others that are indeed ...
