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

learn more… | top users | synonyms (1)

62
votes
5answers
32k views

Description list - How to put the definition on a new line?

I have the following LaTeX code: \documentclass{article} \begin{document} \begin{description} \item[foo] bar \item[baz] bang \end{description} \end{document} and it produces the following PDF: ...
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 ...
36
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 ...
16
votes
2answers
13k 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] ...
13
votes
2answers
4k views

Hyperref + \url: long URL with dashes won't break

I've discovered a rather weird behaviour of PdfLaTeX. In this example \documentclass{article} \usepackage[breaklinks]{hyperref} \begin{document} ...
16
votes
3answers
1k views

How to wrap text around a figure? (revised)

This question has been asked before (and in fact I stole the diagram below from that question) but the answers are not sufficient for my needs (at least near as I can tell). What I want is the ...
9
votes
2answers
840 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 ...
9
votes
3answers
12k views

Newline in a table cell which is centered

This question may look like a duplicate but, none of the answers given to the possible duplicates contain the answer to this specific case. I have a tabular, say \begin{tabular}{ccc}. While adding a ...
9
votes
1answer
2k 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 ...
5
votes
1answer
547 views

Manually URL linebreak with Biblatex

First I should say that I don't have much experience with LaTeX. I'm using BibLaTeX and Biber. My Problem: I have a (justified) bibliography with long URL's containing long words. BibLaTeX makes a ...
8
votes
2answers
5k 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 ...
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 ...
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 ...
10
votes
3answers
298 views

Asterism and similar breaking / non-breaking options

What are the options that can be considered an alternative to the old asterism (⁂) symbol ? I would like to denote a small break in the flow of the text, I noticed that this days many people like to ...
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
3answers
3k views

Break an inline math formula

I have a theorem that looks like this: Now I would like to break the (A....D) math expression. The problem is, that nothing I did from the solution of this answer helped (since probably people will ...
6
votes
3answers
2k views

Underscore makes text go past end of line into margins

In my LaTeX document, I have a few special terms that contain underscores, such as AAA_BBB_CCC. In one case, such a token is placed at the end of the line, and for some reason it reaches into the ...
4
votes
3answers
647 views

Line break in lines with colons

I noticed that if I've got something like this: one::two::three::four one::two::three::four one::two::three::four something weird happen: % the right page margin would be here ...
15
votes
1answer
2k views

Difference between control space and non-breaking space

In my answer to How can I get following layout? I've used non-breaking spaces ~ (ties) to align monospaced text. Actually I rather meant control spaces \ , but they're less convenient to type (and ...
12
votes
2answers
10k 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 ...
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). ...
10
votes
2answers
8k 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}[ ...
7
votes
1answer
7k views

Tabular: Underfull \hbox (badness 10000) in paragraph at lines

I read all the questions regarding the error message Underfull \hbox (badness 10000) in paragraph at lines but I am still not sure if my code is correct. The problem is with the tabular of a table. ...
6
votes
1answer
196 views

How do \widowpenalty and \clubpenalty interact for a 2-line paragraph?

Sometimes \\* does not suffice to prevent a linebreak. Adding {\widowpenalty10000 \par} or {\clubpenalty10000 \par} helps if the separated line is paragraph-final and stranded at the top of a page ...
6
votes
2answers
649 views

latex tabular issue

I am creating a tabular in LaTeX. I want one column to be as small as possible, with no inter column spacing, so that it's just enough to fit the text. I know the answer to this question: I need to ...
6
votes
1answer
2k views

How to force line breaks within a fancyvrb verbatim environment?

Consider the following LaTeX document: \documentclass{article} \usepackage{fancyvrb} \DefineVerbatimEnvironment{example}{Verbatim}{commandchars=\\\{\}} \begin{document} \begin{example} Foo\\{}Bar ...
6
votes
3answers
853 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} ...
5
votes
2answers
483 views

References in margins `biblatex`

How can I use biblatex and not have the references run into the margins? I've seen some posts and solutions to this problem pertaining to URLs but I'm not using web links so it's a different problem. ...
4
votes
2answers
367 views

What is the ConTeXt or plain TeX equivalent of \nolinebreak?

The command \nolinebreak[4], if placed between two characters, should prevent a line break from appearing in that location. This command does not seem to be defined in ConTeXt. Is there an equivalent ...
4
votes
1answer
3k views

How to make (force) line-break in Chapter Title (in ToC, Chapter, Header) - if possible?

I've found how to make different text for Title appearing in ToC, Chapter and headers Chapter title in header too long : \chapter[medium-length title for TOC, if wanted]{full title name} ...
3
votes
1answer
440 views

Pandoc: Markdown to PDF, without cutting off code block lines that are too long

I'm trying to convert a Markdown file into a PDF file using Pandoc. I have a lot of code blocks in my Markdown. And if I have a line of code that is too long, it will just be cut off in the PDF. How ...
1
vote
2answers
657 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 ...
21
votes
3answers
2k 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 ...
11
votes
3answers
764 views

force long text inside \item[{\texttt{}] to wrap

I have a LaTeX document that is automatically generated and then inserted as part of my own larger document with \input. This other document has a description environment for examples, one item for ...
9
votes
0answers
102 views

How to typeset long numbers in LaTeX [duplicate]

Possible Duplicate: How to typeset large numbers I saw the posts on how to typeset long formulas into LaTeX, but I just want to output a really long number into LaTeX. 2011^2011 is long, ...
8
votes
1answer
77 views

Applications of various strength of \linebreak command

This is a curiosity-driven question. The LaTeX \linebreak command comes with five options, from 0 to 4, determining its strength. \linebreak[0] allows TeX to break a line where he normally does not ...
8
votes
1answer
158 views

Tweak showlabels/showkeys - wrap the label

Can showlabels wrap the label in the margin? A very similar question is showlabels: wrap labels in marginpar, but the solution of @DavidCarlisle does not solve the more general case. Consider the ...
8
votes
3answers
292 views

“Fill in the missing words” needs line breaking before a \phantom{word}, and a list of removed words

Apologies for the very long title. I'm writing a "fill in the missing words" document. I have made a makro \fjern{} ("remove" in Norwegian) which underlines the argument and places it in a phantom ...
7
votes
1answer
518 views

\penalty-10000 or \linebreak?

What are the practical differences between \penalty-10000 and \linebreak? Do both make \allowbreak redundant? \documentclass{article} \begin{document} Text text text text text. This is a paragraph ...
7
votes
1answer
142 views

Environment prints same character at beginning of each output line

I am writing a Latex document with pseudocode interspersed with theorems and discussion. Some of the comments in the pseudocode are long. I would like to automatically start (and end) each output line ...
7
votes
3answers
2k views

How to split optimisation problem over two lines?

I have this expression involving minimisation. How do I split it over two lines? The problem is \min seems to be separated from the objective function. breqn does not seem to work, as this is not an ...
6
votes
1answer
327 views

Automatic camel case breaking

Based on my old question Push long words in a new line, I search for a possibility to allow linebreak before a capital character in camel case terms. For example the term ...
6
votes
1answer
691 views

\input only part of a file using catchfilebetweentags package

I would like to include only a part of a .tex file into a different .tex file. The part I want to include is delimited by some comment tags, as it is used by catchfilebetweentags package. I tried the ...
6
votes
1answer
639 views

Overfull \hbox produced by ntheorem subtitles

I switched from using the standard AMS theorem package to ntheorem so I can put alternative end marks on theorem environments (I want my examples to have an end mark, but not the same one as proofs). ...
6
votes
4answers
1k views

Splitting very big numbers over several lines [duplicate]

Possible Duplicate: Wrapping long lines that contain no spaces I'm writing a report (in LaTeX) in cryptology and I have to work with very large numbers. I want those big numbers to be on ...
5
votes
1answer
362 views

Chemfig new line reaction scheme

I just recently started using LaTeX and chemfig and have a question in regard with making a new line in the text below or above the reaction arrow. I am trying to place MW, 160C, 5min under Na2CO3, ...
5
votes
3answers
3k views

Push long words in a new line

I have sometimes very long words, which are for example method names and so on. Is there any possibility to force LaTeX to push them to a new line, if they overflow the margins? It is possible to ...
4
votes
1answer
70 views

In table cell, how to break long words after “::” or “_”?

I have a software program can generate tables which may be very long and may contains words with many letters,so i use longtabu package. Some words may look like this: AAA_BBB_CCCC_DDDDD_CC ...
4
votes
1answer
1k views

How to force latex to put a quote in one line?

I am currently writing a CV on LaTeX. I want to have a quote on the head of my modernCV, but latex puts ONE word into a second line. Can I make LaTeX put all the quote into one line? ...
3
votes
1answer
1k views

URL in new line Bibtex

I'm being asked to put the url field in a new line after the reference information. Is there a way to do this using IEEEtran? Edit: Noting the initial suggestions, you can find the idea of the task ...