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

learn more… | top users | synonyms (1)

6
votes
1answer
2k views

Automatic line breaking for two-column text

I am using the following document class: \documentclass[twocolumn]{svjour3} Unfortunately, the two columns of output text just look horrible as they are not properly aligned on the right-hand side ...
4
votes
1answer
636 views

How can I create my own listings style/format?

I'm trying to format some SQL statements using the listings package. It looks OK for small statements but the long ones look bad. select * from Customers where C_nID=10; to select * from customers ...
3
votes
1answer
448 views

Line breaking words with apostrophe gets overflows

I'm using this Latex document class (that's the class used for the CHI/TEI conferences) and I'm facing a strange problem with automatic newlines with words having apostrophes: in Italian we are used ...
12
votes
2answers
2k 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 ...
7
votes
2answers
4k views

Line breaks in subfig

I'm trying to put some text in a subfloat using the subfig package. (It's supposed to be part of the figure, not the caption.) I can't figure out how to add a line break. When I try this code: ...
7
votes
1answer
1k views

Table of contents (minitoc, parttoc) and line breaks

I have to make a table of contents for each part of a book document. I use minitoc package, and \parttoc command. I have line breaks (\\) in the chapters and sections titles in both [] and {} ...
5
votes
1answer
16k views

New line in math mode and indent this line

How can I have a indented new line in math mode? The line after \newindentedline should be indented and start in a new line. \[ X \subset Y \Rightarrow \forall x \in X: x \in Y \newindentedline ...
5
votes
1answer
3k views

Newline within underbrace in math environment [duplicate]

Possible Duplicate: How can I force a line break within \text{…}? In the MWE below, is it possible to force a line break in the text under the Z so that the overall equation is more ...
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} ... \\ ...
1
vote
1answer
435 views

Use of marginpar: problems with Underfull \hbox

I'm using the latex commnad \marginpar{}, however for some reason I get the warning: Underfull \hbox <badness 10000> in paragraph ... each time I create a comment on the margin. Is there ...
6
votes
1answer
711 views

How to remove the extra line?

I use this command to show the headword in dictionary. \newcommand{\entry}[2]{\hangpara{2em}{1}\textsf{\textbf{#1}}\ #2 \markboth{#1}{#1}\par}\nopagebreak[4] When the headword is exactly as long as ...
1
vote
0answers
115 views

How to prevent contents of verbatim text from running off the page? [duplicate]

Possible Duplicate: Verbatim environment that can break too long lines? How to prevent contents of verbatim text from running off the page? \documentclass[12pt,a4paper]{article} ...
7
votes
2answers
1k views

Section titles, hyphenation, manual line breaks - and how to avoid them

I have several section titles in my document that are getting hyphenated, which is quite ugly. I am now looking for some way to avoid the hyphenation, which is is somewhat related to this question, ...
23
votes
3answers
1k views

How to avoid a linebreak before a comma?

I just had a problem with a linebreak after a word ending with a hyphen which was followed by a comma. This example shows the problem: (The example is constructed, but this just occurred to me in a ...
4
votes
2answers
534 views

Macro to convert 'multi-line' text to 'single-line' (remove line breaks?)

Consider the following example: \documentclass{minimal} \def\myMultiLineText{% Line One Line One \\ % Line Two Line Two \\ % Line Three Line Three \\ % Line Four Line Four % } \begin{document} ...
8
votes
1answer
6k views

Forcing new line after item number in enumerate environment

How can I force the text of an enumerate item to start on a new line below the item number?
16
votes
1answer
679 views

Is it still worthwhile to let TeX try line-breaking without hyphenation?

Here's TeX's line-breaking approach (as I understand it) in a nutshell: If \pretolerance is positive, try to break a paragraph into lines without inserting discretionary hyphens and without ...
8
votes
2answers
5k 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 ...
152
votes
5answers
5k 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 ...
17
votes
4answers
9k views

How can I prevent inline math formulas from overflowing into the margin?

When I compile my document in LaTeX, some formulas in the document in math mode, between $ $, go into the right margin area beyond all the text. Is there a way to fix this aesthetic problem?
3
votes
1answer
376 views

Get the Length of the Rest of a Line [duplicate]

Possible Duplicate: Is there a way to measure the remaining space of a line of text? I have some text and want to put a \hrulefill at the end following by a period. However, if the text of ...
29
votes
2answers
759 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 ...
17
votes
3answers
2k views

Can I have the \overfullrule rule colored in pdfLaTeX?

I know that I can use \overfullrule=5pt to get overfull lines marked with a black marker. I am using pdfLaTeX. Is there a way I can get this marker or something similar in magenta instead?
14
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 ...
11
votes
3answers
501 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 ...
1
vote
2answers
169 views

Character on hanging list

I'm the maintainer of the ledmac package (for critical editions). I would like to have the possibility to start all the lines with hanging indentation with some chosen character, like this (where ...
16
votes
3answers
1k views

Formatting FAQ lists in LaTeX

I want to format a list of "Question + Answer" pairs in a TeX-document. In HTML I use the <dl> command: http://www.w3.org/TR/html401/struct/lists.html, e.g.: <dl> ...
8
votes
2answers
855 views

Linebreak before URL with biblatex/alphabetic

Using biblatex with alphabetic style, how could I insert a line break (\\ or \linebreak) before the URL output (with the aim to have less linebreaks within URL)? (I use url and hyperref) Slightly ...
35
votes
5answers
3k views

one-letter word at the end of line

This question led to a new feature in a package: impnattypo I come from Poland and I'm writing some text in my native language. One of our typography standards is that we do not leave ...
22
votes
2answers
788 views

Repetition of a word on two lines

This question led to a new feature in a package: impnattypo There have been questions about rivers asked in the past. I'm wondering about words that are repeated in the same place on two ...
3
votes
1answer
546 views

varioref hyperlinks go outside the text boundary

I'm using the varioref package to get descriptive references. When used with the hyperref package, the links will often go outside of the text boundary, as demonstrated in the MWE below. If I set ...
3
votes
1answer
311 views

Automatically breaking formulas [duplicate]

Possible Duplicate: How can I split an equation over two lines I am trying to compile my papers into Kindle readable PDF files. I can get pretty good outputs by just changing the height and ...
4
votes
2answers
3k views

Formula out of margin

I got some issues while writing a formula in LaTeX. I have to print this in my document: \textit{P3ACM}: $ \left \langle \left \langle ( 09.00, 18.00 ) , \{ Monday, Tuesday, Wednesday, Thursady, ...
65
votes
1answer
27k 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
642 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
123 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 ...
33
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}
5
votes
2answers
779 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
968 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
373 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
397 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
549 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 ...
3
votes
3answers
139 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
451 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
265 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
839 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 ...