Questions tagged [line-breaking]

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

Filter by
Sorted by
Tagged with
9 votes
3 answers
893 views

Why does TeX break the line between -- and ,?

I have the following \hbox, and if I unbox it and put it to a paragraph (or when I just type aaa --, bbb or aaa --\nobreak, bbb), TeX is breaking the line between -- and ,. > \box0= \hbox(6.88875+...
pts's user avatar
  • 1,103
9 votes
2 answers
881 views

How can I get a very wide table to wrap all three rows within the margins?

I have a series of tables that are going to be very (very!) wide, but with only 3 rows. Is there any way I can get the tables to wrap within my margins, without having to break the rows within the ....
user25655's user avatar
9 votes
3 answers
12k views

Break long word in tabular

I have a long word inside my tabular I need to break. The other rows and columns look perfect, but since this is only 1 word, the actual word overlaps on the other column. Not ideal. Is there a ...
MortenMoulder's user avatar
9 votes
3 answers
1k views

How to carry long text of \href to the next line while ocgcolorlinks is present?

This simplest code \documentclass[a4paper]{book} \usepackage[ocgcolorlinks]{hyperref} \begin{document} \href{"some URL"}{"long text"} \end{document} by compiling with pdflatex puts the "long ...
Jordan's user avatar
  • 327
9 votes
4 answers
3k views

longtabu and scrpage2: line breaks in page header cause compilation errors

Please consider the following MWE: \documentclass{scrartcl} \usepackage{longtable,tabu} \usepackage{lipsum} \usepackage{scrpage2} \chead[Headline 1\\ Headline 2]{Headline 1\\ Headline 2} \pagestyle{...
DigNative's user avatar
  • 1,255
8 votes
2 answers
2k views

Closing parenthesis as delimiter not matched when breaklines=true

I want code in parentheses and in brackets to appear in different colors. In the following document, the words brackets again appear in green as intended, and outside again is black as intended, but ...
arne.b's user avatar
  • 451
8 votes
2 answers
2k views

Insert a character at beginning of each line after the current one?

I'm looking for a way to obtain automatically the following layout of French "continuous guillemets", used in old typography when a citation includes another citation that spreads over several lines (...
Sylvain's user avatar
  • 125
8 votes
1 answer
6k 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} ...
strpeter's user avatar
  • 5,235
7 votes
2 answers
367 views

Start the content of an item on a new line after the item label in enumerate environment

How to have the full content of an enumerate item to start on a new line below the item label and number, and aligned to the left margin of the document ? This question is closely related to this ...
macxpat's user avatar
  • 119
7 votes
3 answers
719 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 ...
sdaau's user avatar
  • 17.1k
6 votes
2 answers
16k views

Is it possible to have italic and bold text, and linebreaks under the \underline{text} command?

I was trying to emphasize text with \textbf, \textit and \underline commands. But the text will not automatically wrap to the next line. I also tried the ulem package, and it did not work too. Does ...
Zhou Wang's user avatar
6 votes
2 answers
948 views

Wrap text at any point if normal hyphenation not possible

I have data (generated from a database, not manually typed in) that mostly fits into a table cell with fixed width, but sometimes overflows because there are long words for which no hyphenation is ...
m4t's user avatar
  • 61
6 votes
2 answers
904 views

Preventing hyphenation of specific short, repeated, hyphenated words

I'm writing a document where I frequently refer to some experimental cases which are called things like "M-1" and "P-2". It's always a single number, a hyphen, and a single number. In several places, ...
David's user avatar
  • 63
6 votes
1 answer
177 views

Section break that displays content iff it occurs in middle of a page

I'm trying to create a section break that will display a separator when it occurs in the middle of a page, but display nothing if it lies at the top or bottom of a page, where there's nothing to be ...
avy's user avatar
  • 163
5 votes
2 answers
4k views

Insert hyphenation point in BibTeX using PDFLaTeX and hyperref

How to tell PDFLaTeX to make hyphenation in place where I want it to be? I have my document file: \documentclass[10pt,a4paper]{article} \PassOptionsToPackage{hyphens}{url}\usepackage{hyperref} \...
faramir's user avatar
  • 309
5 votes
4 answers
3k views

How to avoid global \sloppy with many \texttt

I read that using a global \sloppy is bad practice. I have a document with many variables of a source code that I reference as in \texttt{VariableName}. I use a lot of them both in normal paragraphs ...
SCBuergel's user avatar
  • 153
5 votes
2 answers
2k views

seqsplit does not work unless the string is given as an argument directly

Consider the following example. If I do \seqsplit{ReferencedIDs} the string does not get split. If on the other hand, I insert the string as an argument directly it does. As usual, I don't know why ...
Faheem Mitha's user avatar
  • 7,788
4 votes
3 answers
3k views

Line break after description label

How can I ger a line break after the label of a description environment item? I'd like to keep the indentation and the bold face for the item label, but I'd like to have the body of the item in a ...
MvG's user avatar
  • 2,643
4 votes
1 answer
451 views

Prevent line break before :

Here is my minimal code: \documentclass[12pt]{memoir} \usepackage{polyglossia} \setdefaultlanguage{french} \begin{document} Bonjour tout le monde. Si je vais au bout de la ligne, je vais avoir cela :...
Blacksad's user avatar
  • 263
4 votes
1 answer
1k 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 ...
Peter Grill's user avatar
4 votes
3 answers
266 views

Landscape table to fit entire page by automatic line breaks

I want to include a large table into my document. I use the landscape environment to make it sideways and managed to make it fill out the entire width of the page by using \linewidth, but my table ...
Idiza's user avatar
  • 41
3 votes
2 answers
760 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 a ...
Axioplase's user avatar
  • 409
3 votes
1 answer
453 views

condense non-numbered bibliography into one line

What I am trying to do is basically the same as (almost) answered here: https://tex.stackexchange.com/a/5574/39336 The difference is that I am using a different bibstyle. This bibstyle creates the ...
John Smith's user avatar
0 votes
1 answer
345 views

Make \texttt not exceed line length

I have to state a few long numbers in a document. These aren't meant to be regarded as regular numbers but instead as data. So I don't want to format them with \num{<...>} but with \texttt{<.....
UTF-8's user avatar
  • 411
41 votes
4 answers
32k 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 ...
Jukka Suomela's user avatar
38 votes
1 answer
2k views

Obtain \badness or glue adjustment for each line

This might be interesting for perfectionists and/or fastidious typesetters who would like to improve the document even further (beyond the beyond the magnificence of a book with zero bad boxes). We ...
Andreï V. Kostyrka's user avatar
33 votes
1 answer
63k views

How do I manually break a line in the title of my thesis -- using the U of Maine package

I'm using the LaTeX class package to write my thesis according to University of Maine formatting guidelines. I'm running into an issue with line breaks in the title. I'm required to break my title ...
derefed's user avatar
  • 433
29 votes
2 answers
6k views

Copy from PDF without line breaks at end of each line

When I produce the PDF, open it and copy the paragraph into notepad, there is a forced line break at the end of every line in the PDF. Is there a way to get over this, so that I can copy the paragraph ...
Dominik Teiml's user avatar
29 votes
3 answers
62k views

Tabular, parbox, vertical alignment

What i want to achieve is really simple: I want to be able to align cell content at the top (which is the default behavior of tabular) while being able to manually break lines (and anything you could ...
user3339's user avatar
  • 391
24 votes
3 answers
2k 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 ...
Bloops's user avatar
  • 913
24 votes
4 answers
13k views

Avoid hyphenation in chapter title

I wonder if there is a way to avoid hyphenation of words in the title of a chapter. I have tried \mbox but that makes the word run over the margin. I've also tried inserting a \\ in front of the word,...
Matthias's user avatar
  • 4,051
24 votes
3 answers
11k views

How to use \sloppy for just some references?

I’m using XeLaTeX within MiKTeX and also the biblatex package for the literature. I’ve noticed that my bibliography set using \printbibliography is not set with the \sloppy option by default, which ...
josefec's user avatar
  • 1,772
24 votes
1 answer
8k 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 ...
mforbes's user avatar
  • 5,571
23 votes
3 answers
4k views

When can I safely add an empty line?

I really like spacing my LaTeX to stay organized, but I'm always scared that adding a space will affect the output when all I really wanted to do was separate the "code" a bit. So most of the time I ...
Meta's user avatar
  • 333
21 votes
5 answers
3k views

Non-breaking space in \citet using natbib?

When adding citations in the body of a document I'm used to write ... in some interesting paper~\cite{interesting}. So that (if I'm using numbered references) the word “paper” and the citation ...
Juan A. Navarro's user avatar
21 votes
1 answer
46k views

Break a subfigure set in two lines

Is it possible to break a figure block made by three subfigures in two lines? I would like to maintain the first subfigure on the first line and the other subfigures on the second line. \begin{figure*...
Eleanore's user avatar
  • 367
21 votes
1 answer
31k views

Manually breaking a long URL (in the bibliography)

I have a large bibliography in which a few items are causing underfull hboxes due to a long URL. Answers to similar questions suggest a number of global options for fixing this; e.g. Forcing ...
Mohan's user avatar
  • 15.9k
20 votes
2 answers
9k views

Does amsmath provide any medium to auto-break equations?

I'm writing large equations in texlive with amsmath, and I want them to be automatically broken at the end of the line. Is there any way to do that with amsmath? What would you recommend me to do ...
Tomas's user avatar
  • 5,451
18 votes
4 answers
11k views

Splitting root symbol

How can the \sqrt command be modified to split root symbol into two or more lines automatically? Example: \documentclass{standalone} \begin{document} \begin{minipage}[t]{0.8\textwidth} ...
m0nhawk's user avatar
  • 9,664
17 votes
2 answers
2k views

Is there way to put hard space after defined words? [duplicate]

In Polish typography, one should avoid putting prepositions at the end of the line. Example: Nie wiedziałem, że nie umieszcza się przyimków na końcu strony. - bad Nie wiedziałem, że nie umieszcza się ...
Ichibann's user avatar
  • 8,381
17 votes
3 answers
20k views

Break Lines in minted environment

Usually when adding code in a LaTeX document, I use the listings package. When trying to modify and personalise styles in listings, @1010011010 suggested to use the minted package. To be quite frank, ...
Thanos's user avatar
  • 12.4k
17 votes
2 answers
69k views

How to make a title of two or more lines?

My document has a long title, so I want the title spans two lines. I've use this: \title{my title that must be in two or more lines} but it doesn't work. How can I get it done?
slackmart's user avatar
  • 557
16 votes
2 answers
19k views

Why is \linebreak failing?

Consider the following minimal, using \linebreak: \documentclass{article} \begin{document} It is impossible to say how first the idea entered my brain, but, once conceived, it haunted me day and ...
yannisl's user avatar
  • 117k
16 votes
2 answers
16k views

Line breaks in TikZ nodes [duplicate]

I have this code that outputs a small family tree \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \begin{document} \begin{tikzpicture}[ man/.style={...
user avatar
15 votes
1 answer
15k views

Multi-line legend entry in pgfplots

In some of my plots the curve description in the legend is too long, making the legend going over the plot, even if the legend is placed as far away as possible. Therefore I want to have multiple ...
arc_lupus's user avatar
  • 1,781
15 votes
4 answers
5k views

What to do when a line in a bibliography entry overflows?

The usual solution to fix lines that overflow is to rewrite it. However, that hardly works with bibliography entries that experience the same problem. So what can I do to fix it? I can't rewrite ...
gablin's user avatar
  • 17k
15 votes
3 answers
43k 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 ...
anonymous's user avatar
  • 151
15 votes
2 answers
5k views

Is it possible to have hyphenations in \underlined{text}?

In a document I was writing, I had some really long captions and I wanted to emphasize the important parts in them. I tried to use \underline{} but no hyphenation was used at both the caption and at ...
pmav99's user avatar
  • 6,060
14 votes
4 answers
31k 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 ...
Emerson's user avatar
  • 3,530
14 votes
4 answers
26k 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 where ...
Baduel's user avatar
  • 1,279

1
3 4
5
6 7
14