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

learn more… | top users | synonyms (1)

64
votes
1answer
26k 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?
10
votes
3answers
592 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 ...
3
votes
1answer
121 views

Automatically breaking a line before an in-line mathematical expression

How do I automatically break the line before mathematical expression without using \\ Minimal example: \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \begin{document} text text text ...
32
votes
7answers
7k 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 ...
5
votes
2answers
1k views

How can I get a line break in a theorem headline?

I have a theorem title, which is longer then the page width. How do I get the title in two lines? \begin{theorem}[this title is to long for one line] the theorem \end{theorem}
4
votes
2answers
726 views

resizebox doesn't respect linebreaks?

I'm trying to scale some text up. It seems like \resizebox (from graphicx?) and \adjustbox (from the adjustbox package) ignore line breaks: \resizebox{5cm}{!}{Hello\\ world} Is there a way to scale ...
9
votes
1answer
930 views

\overbrace split accross multiple lines

Is there a way to split the overbrace so that it appears in two halves over a multi-line equation. Something like /-----------Overbrace Label---- Equation over which to place ...
0
votes
0answers
115 views

How do I put a linebreak in a displaymath? [duplicate]

Possible Duplicate: How can I split an equation over two lines I have a displaymath formula that's too long. \linebreak and other commands that work in inline math don't seem to do ...
3
votes
2answers
366 views

Contextual newlines in tocloft

I'm using a shorttoc with tocloft to put the names of chapters on a newline. Unfortunately, there are some chapters (such as the Preface or Index) which are not numbered, and I end up with additional, ...
3
votes
2answers
4k views

How can I break a long equation?

Upon compiling, one of my equations extends out of my column width in my final output. Options I tried-- breqn package asks for expl3.sty file which the compiler is unable to locate, (would have ...
3
votes
2answers
392 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 ...
2
votes
1answer
1k views

How to prevent linebreak between subsection header and content?

I want a. to be in the same line with {w | w begins ... Yesterday, I found one solution that uses some commands to set the subsection title but I can't find it today since I did not remember the ...
1
vote
2answers
526 views

\newenvironment text exceeds the text width

I set up a \newenvironment, some texts in this environment exceed the text width, but this doesn't happen always. The following is the \newenvironment setup % is used for parameters within a detailed ...
2
votes
3answers
134 views

How to avoid a line-exceeding statement in a description's item tag?

Having a description like this: \begin{description} \item[One or several threads are operating concurrently on some data structure, which is bad because and also blablabla.] \end{description} How ...
5
votes
1answer
425 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 ...
10
votes
2answers
264 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
796 views

Fixing a code to highlight formulas and text on several lines

In this post I've found the following amazing code to highlight text on several lines. The problem is that code dosen't work well with formulas : for example, fraction using the mode display are ...
12
votes
5answers
22k views

LaTeX equivalent of <br><br><br> in HTML?

In HTML, all I would have to do is: This is line one <br>.<br>.<br> This is line two to get the following output: This is line one . . This is line two I've been playing around ...
6
votes
1answer
249 views

Is there a (standard) font with a literal end-of-line character in it?

For ... complicated ... reasons (which I'll explain in a moment), I want to be able to put a literal end-of-line character in my document. Simply putting ^^J results in an Ω. Looking at the ...
2
votes
1answer
293 views

Testing for multi-line paragraphs

I'm running into a situation where I need to insert some code (specifically, \hfill) only if my paragraph runs more than one line. This isn't a simple alignment thing, as I'm working with ...
2
votes
1answer
319 views

Oddly wide spaces in subsection title

I have a problem, this is what it looks like: And this is the code: \subsection{Bakterienst\"amme und Anzuchtbedingungen} Where does the huge whitespace come from?
3
votes
2answers
1k views

How to prevent verbatim from generating linebreak?

I tried: \begin{verbatim} is_terminating() \end{verbatim} function can be implemented as follows: But the text after verbatim section will be printed in a next line, is there a way to prevent this ...
8
votes
1answer
2k views

URL linebreak in footnote

I use a footnote with a too long url, so that I'd like to see a linebreak. The url package does linebreaks automatically as far as i know, but in the footnote it won't do it. Anyone have a solution to ...
5
votes
1answer
4k views

Multirow and lines - how to draw line going through selected columns

I was wondering if it is possible to draw line which goes through some columns in table(not all columns). I have a table which looks like that \begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|} ...
12
votes
2answers
2k views

Hyphenating hyphens: how to change the default \discretionary

My language, Portuguese, have undergone another orthography reform (those committees simply can't avoid themselves from doing this mess from time to time.) Now we have to adapt, which brings us to my ...
17
votes
1answer
3k 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 ...
0
votes
1answer
96 views

Space for generated text

Throughout my PDF document, generated text on the end of the line is spilled out to the margin. That is, if I use, e.g., \ref{} or \cite{}, then LaTeX does not consider the actual size of the ...
5
votes
2answers
932 views

How can I stop TeX from bleating about an underfull \hbox?

I have a paragraph that contains an underfull \hbox. (It's loaded with huge proper nouns that don't hyphenate easily.) It's not going to be fixed (badness is only 1330), but I'd like to get TeX to ...
0
votes
0answers
461 views

Why does doing \\ in LaTeX causes Undefined control sequence error [closed]

I have a weird LaTeX error here. It seems as if the newline (\\) command is the culprit of a compilation error. The error shows up at the ending line of the .tex document: the \end{document} line, ...
8
votes
1answer
1k 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?
4
votes
2answers
2k views

Suppress black box at end of line

Under TeX, when I write a line too long, it prints a fat black box at the end of the line. That is probably a feature, but I dislike it. How to turn that OFF? Is there a command-line option or ...
11
votes
2answers
1k views

Disallowing line break before dash (en dash and em dash)

In Polish typography dash (pol. myślnik) should not be put after a line break. Below you can find badly and correctly typed samples using en dash (pol. półpauza) and em dash (pol. pauza). ...
0
votes
0answers
232 views

Unwanted line breaks in middle of words [duplicate]

Possible Duplicate: How to prevent LaTeX from hyphenating the entire document? I have a two-column article with custom margins. In some points of the text, line breaks occur in the middle ...
8
votes
1answer
377 views

Adding overfull hbox 'slugs' to final document version

I'm using a documentclass which looks dramatically different in draft mode compared to final. I'm preparing my document for the final formatting, so I don't want to pass the draft option. However I ...
3
votes
2answers
2k views

Underlined blank that wraps

I'd like to create an "answer blank" in a document. It should basically look like an underline with nothing above it. I found a question about it ( How does one TeX a blank? ), but that doesn't deal ...
4
votes
2answers
2k views

Change style of printing acronyms with glossaries package

I'm using the glossaries package to define my acronyms and print them out. I'm using this style: \newglossarystyle{super3colleft}{% \renewenvironment{theglossary}% {\tablehead{}\tabletail{}% ...
1
vote
2answers
589 views

Linebreak in equations

I have a very simple LaTeX problem with the following LaTeX fragment: The function computes: \[ e \leftarrow (((x||a) + (y||b)) \oplus y,\\ r \leftarrow x + y \] The result should then be in ...
2
votes
1answer
589 views

Macro for tabbing with complex line breaks (or similar environment)

I have a complicated transcription with mid-line aligned text. I've been using tabbing to do it automatically, but it obviously doesn't do line breaks. I want to write a macro (unless something ...
1
vote
1answer
518 views

Breaking formulas before and after binary operators

Page 195 of the TeXBook reads: Although formulas within a paragraph always break after binary operations and relations, displayed formulas always break before binary operations and relations. ...
29
votes
2answers
1k views

How to visualize the underfull box in final output PDF files

I am finalizing a document. There are a few underfull vbox I just cannot figure out where they are. Sometimes it is easy to figure out which page is underfull vbox from the log file, but sometimes it ...
7
votes
4answers
7k 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} ...
6
votes
1answer
805 views

Emergency stretch hook

Is there a way to automatically set parameters when emergency stretch is required? Here is my situation. After I implemented the solution chosen for unbreakable spaces in Bible verse references, I ...
5
votes
2answers
514 views

line break aware custom environment

I have a use-case where I would like to specify some special formatting for the text being input via the \input command. This text is customer's address being printed in some sort of a form. Ideally ...
7
votes
2answers
2k views

Fixing an overfull box

I have an overfull box in a French text which looks like this: The sequence at the end of the line is: d'Ananias~: \og Vous "Vous" cannot be hyphenated and \og inserts a non-secable space, so ...
15
votes
4answers
869 views

How can I make (La)TeX prefer to fill centered lines

My thesis formatting requirements ask for multiline chapter and section titles to be a maximum of 4.5 inches wide with any subsequent lines being wrapped such that they are sucessively shorter, ...
9
votes
1answer
7k views

Change text background within paragraph (with automatic linebreaks)

How do I change the text color as well as the text background color for e.g. a sentence within a paragraph? I know \textcolor for coloring the font and \colorbox for background coloring ...
7
votes
1answer
636 views

How to avoid line breaking after subsection in Memoir?

\documentclass{memoir} \usepackage[english]{babel} \usepackage[latin1]{inputenc} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsthm} \usepackage{bbm} ...
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
2answers
4k views

What's the difference between \tolerance and \badness ?

I'm having some difficulty understanding this sentence on page 29, Chapter 6 of Knuth's TeXbook: Run TeX again, and begin this time by saying \hsize=2in \tolerance=1600 \input story ...
7
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 ...