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

learn more… | top users | synonyms (1)

30
votes
2answers
16k 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. ...
2
votes
1answer
27 views

How to tell alltt not to skip lines at beginning/end?

It seems like there is no option for specifying that, like a hack for verbatim I found on tex.stackexchange: \usepackage{etoolbox}% \makeatletter \preto{\@verbatim}{\topsep=0pt \partopsep=0pt} \...
2
votes
1answer
39 views

long table multicolumn single word without hyphen [duplicate]

I am trying to create a long table that will be multicolumn. In one of the columns, I have a DNA sequence that is very long. I am trying to use the \multicolumn but the text is not wrapping possibly ...
8
votes
3answers
9k views

How do I keep a string of text together without it doing a line break?

I'm writing up a long paper, in which in prose I have various equations. However, I do not want a line break to occur within the equation - I want the equation to stick together. I want to do this ...
2
votes
2answers
53 views

Start a new line after the first page

The command to start a new line in LaTeX is \\. It works well on the first page of my document, but from the second onwards no longer works. Does anybody tell me why? This is the code: https://...
2
votes
1answer
37 views

Aligning long broken equation (with brackets also split over multiple lines)

I have long equation $F=\left\{ abcdef \right\}$ which needed to break line at halfway. To do it I use \begin{multline}. \begin{multline} F = \left\{ abc \right.\nonumber\\ \left. {} + def \...
15
votes
5answers
17k views

How to allow line break in a long hyperlink in a PDF compiled by latex-dvips-ps2pdf?

I am using latex-dvips-ps2pdf steps with -Ppdf option passed to dvips. The following code snippet \documentclass{article} \usepackage[colorlinks]{hyperref} \usepackage{breakurl} \hypersetup{...
0
votes
0answers
12 views

Line break within brackets in Bibtex

When I use Bibtex, I want everything within a bracket to appear in the same line. So, for example, in the attached Bibtex, I want the phrase "Phys. Rev. A" to appear in the same line. You can try and ...
4
votes
2answers
55 views

Unexpected first line break

Sometimes pdfLaTeX decides to break the first too early and I really can't understand why and how to avoid this. Unfortunately, following our standards, I had to disable word division, which seems to ...
1
vote
1answer
55 views

Breakable \colorbox? [duplicate]

Given a phrase in the middle of which TeX will place a return carriage, if we place this phrase within a \colorbox, TeX no longer places the return carriage and the phrase protrudes in the margin. Is ...
2
votes
1answer
68 views

How do I get a space or line break between paragraphs rather than an indent? Parskip is not working [closed]

So when I first started out with my file I had gaps between paragraphs and no indent, as I was using the parskip package as listed below in my pre amble. At some point for a reason unbeknown to me ...
2
votes
2answers
50 views

background package - Using text with line breaks

I'm designing a very simple cover for a university publication in Sanskrit. I'm using the package "background" to add some "watermark-like" Sanskrit text on the cover, both top and bottom, while the ...
11
votes
3answers
15k views

URLs in bibliography: LaTeX not breaking line as expected

I am trying to include long URLs in a bibliography, but those often overflow into the margin of the document. I have seen a number of questions about breaking URLs in bibliography, but after trying ...
7
votes
5answers
10k views

How to center table caption that includes a newline

My table caption spans more than on line so I added a \newline to split the caption at an appropriate position. Now, the two lines are left aligned. How do I center the two lines of the caption? \...
1
vote
1answer
37 views

How to insert a break line in LaTeX just like hr tag do in HTML?

In HTML, I can insert a line below any text using <hr> tag. How can I do same thing it in LaTeX?
69
votes
4answers
28k 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 ...
1
vote
0answers
25 views

How to break long sequence of fractions in math mode? [duplicate]

I tried few solutions, such as using seqsplit and breqn but no success. splitting-very-big-numbers-over-several-lines I want to break long sequence of fractions. Here is MWE \documentclass[12pt]{...
2
votes
1answer
19 views

Line break between two graphics in a subfig-style subfloat

What I am trying to achieve is this: AA B AA C A being one subfigure, B+C a second. However, I don't achieve the line break between B and C: \documentclass{article} \usepackage{subfig} \usepackage{...
3
votes
1answer
67 views

How can I redefine verbatim to wrap lines (add break before or after spaces)?

Before continuing, I would like to inform readers that I know it is generally discouraged to reimplement functionality that packages already support. Automatically wrap the text in verbatim has an ...
0
votes
1answer
29 views

Vertical Spacing After NewEnvironment Definition

How can I modify this, \newenvironment{definition}[1][Definition]{\begin{mdframed}\begin{trivlist} \item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}\end{mdframed}} so that a newline (vertical ...
1
vote
2answers
44 views

Automatic Line Breaking Under Gradient Color Text

How could I add automatically line breaking for a gradient color text? I would like to add gradient color for separate words and long ones are just causing trouble. The code I am using is \...
39
votes
4answers
2k views

How to create nonbreaking arbitrary length snakes for full-width justification?

This is a follow-up to the recent xkcd comic: Here is a simple version without justification: \documentclass{article} \usepackage[text={1.2in,3in}]{geometry} \raggedright \begin{document} \...
0
votes
0answers
43 views

Underfull hbox error using \newline and \hfill\break

I am trying to remove warnings/errors from the document I am writing that includes underfull (and overfull) \hboxs from the code below. Why does \newline and \hfill\break produce this warning? Aren't ...
2
votes
1answer
36 views

Tabular using X column not wrapping cells (tabu package)

I have the following code. \documentclass{article} \usepackage{lscape} \usepackage[table]{xcolor} \usepackage{tabu} \usepackage{multirow} \begin{document} \begin{landscape} \taburowcolors[3] 2{gray!...
2
votes
1answer
33 views

line break in “moderncv like \section” in the article class suggests missing \item

With the default definition of \section in the article class, I can make a multiline section header: \documentclass{article} \author{} \begin{document} \section{test \\ test} \end{document} The ...
0
votes
1answer
31 views

How to avoid linebreak at `http:` in url

I have a long url that gets wrapped at http: in my layout (using beamer). This is the latex-code: \documentclass{beamer} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{url} \...
7
votes
2answers
78 views

How does TeX break paragraphs into lines when there is only two element in a pararaph?

Suppose we have the following code: \def\tp#1#2{#1\hskip 300cm minus 300cm\hbox{#2}} \tp{Hello}{World it is} and \def\tp#1#2{#1\hskip 300cm \hbox{#2}} \tp{Hello}{World it is} The first one gives ...
2
votes
3answers
36 views

Odd indentation after \newline, after Math text

So this happens whenever I try to insert a new line in my source code: The center equation is no longer centered! Why does that happen? I can't seem to figure out how to center it. Here's the ...
99
votes
2answers
56k views

What does “overfull hbox” mean?

I often see output from TeX with the warning overfull hbox, badness 10000. What does this message mean?
2
votes
0answers
37 views

Marking line wraps

I have the following MWE to typeset two text paragraphs with the first line outdented. \documentclass{minimal} \usepackage{lipsum} \begin{document} \parindent=-1em \lipsum[1-2] \end{document} How ...
1
vote
1answer
38 views

Insert indent in algorithm at line break of the same \State

I have the following code: \documentclass[12pt,a4paper,twoside]{book} \usepackage{graphicx} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm*}[t!] \caption{...
1
vote
0answers
16 views

Preserve linebreaks in command argument

I'm using the pdfpcnotes.sty style from https://github.com/cebe/pdfpc-latex-notes and I'm currently trying to make it preserve newlines, i.e. if I write \pnote{ * Foo * Bar } I want this to ...
80
votes
6answers
37k 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 ...
4
votes
1answer
207 views

breaking lines in listings environment

I am trying to make listing environment brake lines. Unfortunately breaklines=true does not work for me. Here is my code: \usepackage{listings} \begin{document} \lstset{language=matlab,breaklines=...
3
votes
2answers
34 views

When line breaking goes wrong: does \hfuzz influence \emergencystretch

I read the excellent reply by David Carlisle on a line breaking question. However, one question remained open for me. Carlisle wrote: \hfuzz does not affect the typesetting in any way but just ...
1
vote
2answers
34 views

Line breaks inside commands

Is there a way to have line breaks inside commands that don't accept line breaks. For example, \documentclass{article} \begin{document} \mbox{line 1\\line 2} \end{document}
4
votes
3answers
117 views

Line breaking in multiple cases mathematical expression

How can I align this part of my paper: \subsection{Decision variables} \noindent$y_{pij}^{mk}=\left\{\begin{array}{ll} 1, & \;\;\; \hbox{ If the robot loads or uloades a part to/from machine $m$ ...
2
votes
1answer
77 views

linebreak in long URL? Breakurl won't break it

There are several questions on this site (for example here and here) where people are struggling with overfill hboxes when making clickable URLs. I have read and tried the answers there and none of ...
1
vote
0answers
21 views

How do I minimize tabulary width, contingent on minimizing height or lines per row?

I frequently find that I want to make a table with final column (typically out of 3-5) that will automatically break over multiple lines. So I use \begin{tabulary}{\linewidth}{llL} [...] \end{...
3
votes
3answers
76 views

Long definition with braces

I know, maybe this topic is duplicate but I didn't find the correct answer. \begin{align*} \Theta(g(n)) = \left{f(n)|\>\> \text{existují}\>\> c_1 >0, c_2 > 0 \>\> \text{a}...
2
votes
1answer
32 views

Breaking long formula at specific characters

I have some rather long formulas that are not equations, and I would like LaTeX to break them automatically whenever necessary, preferably at the \vee symbol. I currently use the breqn package and the ...
0
votes
0answers
17 views

long word after nonbreaking hyphen overflows

I tried the solution given here and here, however the mbox mechanic seems to lead to an overflow before the linebreak depicted below. Could the mbox command somehow be modified to not show this ...
24
votes
3answers
22k views

How to break long url in an item

I have an enumerate. In an item I have a long url. I use the package breakurl and it works fine outside the enumerate but not in the item. \usepackage[margin=3cm]{geometry} \usepackage{hyperref} \...
1
vote
1answer
29 views

How can I keep everything within a variable/macro on the same line?

I know there are various techniques to keep things on the same line. I have a two-word variable input. For example, Settings App. Let's say there are a group of apps, and I would like them always ...
2
votes
1answer
36 views

Subfig's ragged-right caption with hyphenated word breaks unaesthetically

Minimal working example \documentclass[11pt, twoside]{report} \usepackage{caption} \usepackage[]{subfig} \usepackage{graphicx} \begin{document} \begin{figure} \captionsetup[subfigure]{...
2
votes
2answers
70 views

Prevent line break before equation environment in enumerated list item

I try to accomplish the same thing as in this question: Prevent line break before equation environment in enumerated list item (to have the equation in the same line as "some text"), except that i ...
2
votes
1answer
29 views

Linebreak in overlaid figure text

As a simple example, consider this MWE: \documentclass{memoir} \usepackage{graphicx} \begin{document} \begin{figure}[h] \centering \includegraphics[width=0.4\columnwidth]{example-image} ...
1
vote
0answers
41 views

spaces in references in pdf view

I am using book document when I view my work on pdf, some of references looks like this with spaces. how to avoid them? Can I change "bibliography" to "references"?
3
votes
1answer
53 views

Prevent linebreak in URL in biblatex bibliography

Unlike most people, I'm trying to prevent breaking the URL in my bibliography. In the case below, the URL in the first item should stay the way it is, since it is not broken across the lines. The URL ...
28
votes
3answers
26k views

How to put a line-break in section heading?

I have some section headings occupying two lines and I'm not satisfied with the way XeLaTeX breaks the heading. If I manually add \\ the output looks fine, but I get the following warning: [hyperref] ...