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

learn more… | top users | synonyms (1)

13
votes
2answers
805 views

Format a verbatim paragraph

How can I format a verbatim paragraph? I.e. break, fill and join input lines to produce globally balanced output with the lengths of each line approaching the target \textwidth as closely as possible. ...
13
votes
5answers
618 views

How to split a long formula and make it beautiful?

My method: \documentclass[UTF8]{ctexart} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{epstopdf} \usepackage{inputenc} \begin{document} \begin{equation} \begin{split} ...
13
votes
2answers
400 views

Breakable period

LaTeX will not insert a line break before or after a period . I understand why you'd want to avoid line break before a period, since you'd otherwise get stranded periods at the end of sentences. I ...
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} ...
13
votes
2answers
253 views

Persuading (la)tex “silently to go beyond the envelope of 'good taste' ” to avoid an overfull hbox

My understanding, based on reading this website, is that (la)tex performs at most three passes when trying to typeset a paragraph: one based on \pretolerance, one based on \tolerance, and one based on ...
13
votes
1answer
249 views

Box around raggedright links spanning two lines extends to right margin

I need to use boxed links and ragged right text. The problem is that when a link spans two lines, though the link is broken correctly (when using pdflatex) the box around the linked text extends until ...
12
votes
5answers
24k 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 ...
12
votes
2answers
5k views

No hyphen for a word

I want to put pdflatex to not put a hyphen in a word went it comes to the end of the line. I tried to put a \- in the beginning or the end of that word but it doesn't work. For example if I put:This ...
12
votes
5answers
3k views

Why do hyphenated words cause margin violations (and how can I prevent it)?

Sometimes my text goes past the right margin when there is a hyphenated word involved in the sentence. For example, in the figure below, the line that contains "inter-member" extends further right ...
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 ...
12
votes
3answers
6k views

Automatic line breaking of long lines of text?

Here, it is just a example. I have a line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa Now, I want to let LaTeX automatically ...
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 ...
12
votes
3answers
7k views

No newline after (sub)section?

I want my text to appear right after the call to \subsection{Name} but I can't find how to do it. I'm using the article class. An example of command: \subsection{a)} Blah blah bla... produces: ...
12
votes
5answers
2k views

Is it possible to skip the first line in a theorem environment?

I'm currently writing up some solutions, and I like to rewrite the problem before answering it. I've set exercise to be a theorem environment, and the code I'm using is \begin{exercise} ...
12
votes
3answers
1k views

How to deal with very long lines that do not contain spaces?

I have a problem with a lstlisting environment. I want to use it for displaying several very long lines that can not be reformatted. Independently of the option breakatwhitespace=true or false my ...
12
votes
2answers
460 views

Nonbreaking dash that allows hyphenation

The babel package provides useful dash variants, e.g. "~ for a non-breaking dash that forbids hyphenation in the parts, and "= for a breaking dash that allows hyphenation in the parts. However, ...
12
votes
2answers
411 views

New lines and TeX: difference between ^^J and ^^M

What is a new line for TeX in the following contexts: When reading from a file. When writing to a file. After having read a % character. In a \scantokens. I am asking in particular because the ...
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 ...
12
votes
3answers
2k 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 ...
12
votes
1answer
2k views

Typeset a dialogue?

I need to typeset a dialogue in LaTeX, it's for a translation assignment. The original dialogue does something like this: - I found it, I told him. My finger was in the book, where George Best's ...
12
votes
1answer
160 views

Does \\* within footnotes have any effect?

One is taught that \\* is an alternative to the line-breaking \\ that tries (often unsuccessfully) to inhibit a page break. Normally \\* would be used in ordinary ("body") text. (And I hereby ...
12
votes
1answer
568 views

Is there a way to avoid short lines?

Is there a universal setting to tell TeX that the last line of a paragraph can not have just one word? For instance, instead of this: This is a sample paragraph and there is one word here. you ...
11
votes
4answers
5k 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 ...
11
votes
3answers
881 views

No indentation after empty line

Indentation can be selectively suppressed using \noindent or completely with the option parindent=full to the KOMA document classes. Books (fiction) are usually structured using paragraphs, indented ...
11
votes
2answers
17k views

Phantom and line break

I want to make a cloze test using LaTeX. My Idea was to use the \phantom command to produce the space: Some text \underline{\phantom{some text to complete}} some more text. Now the problem is that ...
11
votes
1answer
306 views

Is it a good practice if we always locally precede \href with \sloppy?

Is it a good practice if we always locally precede \href with \sloppy as follows? if you are interested to know the details, please contact me at {\sloppy ...
11
votes
4answers
8k views

How to add line break to caption without using caption package

I wish to add a line break to a caption, but I would wish to avoid adding of caption package. Is it possible? \documentclass{article} \usepackage[format=plain, ...
11
votes
3answers
758 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 ...
11
votes
3answers
583 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 ...
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 ...
11
votes
3answers
243 views

How to generate non-blanks between words?

In an otherwise-vanilla latex doc, I have a long list of strings that I need separated by <space> <cdot> <space>. The output needs to look like: Lorem <cdot> ipsum ...
11
votes
1answer
1k views

Breaking links and escaping characters in bibliographies with backlinks and ocgcolorlinks set

I have the following situation: I have to use the ocgcolorlinks option in hyperref, so that links are not broken. So I had the idea to set each char as a link with \href. After putting some code ...
11
votes
1answer
90 views

remove endashes at linebreaks

I want to typeset a paragraph of endash-separated expressions, like this \documentclass{article} \setlength{\parindent}{0pt} \begin{document} \centering test -- test -- test -- test -- test -- test ...
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). ...
11
votes
1answer
20k views

underfull \hbox (badness 10000) in paragraph

Why do I get the message: Underfull \hbox (badness 10000) in paragraph at lines 107--108 I want a blank line between the problem name and the table, but if I use \\ or \newline along with a ...
11
votes
1answer
2k views

Is the number of authors restricted in article?

At the begining of the .tex file I put \title{title here} \author{name 1 \and name 2 \and name 3 \and name 4 \and name 5 \\ \small institution\\ \small ...
11
votes
1answer
210 views

Layout issue with biblatex

On the screenshot you can see that the ISBN number breaks the layout: How can I fix the layout? On my small attatched example the layout is not so much demaged like in my real work but you will ...
11
votes
1answer
266 views

Error with table

\begin{table}[ht] \makebox[\textwidth][c]{ \begin{tabular}{ccccc} \hline \hline [] & [] & [] & [] & []\\ [] & [] & [] & [] & []\\ ...
11
votes
1answer
153 views

Split up several equations into smaller ones?

I've tried to search for it, but I couldn't seem to find an answer to my question, so here goes. Let's say I'm writing a report of some sort. I'm up 50 pages or so, and at least 100 equations. Then, ...
11
votes
1answer
415 views

How to highlight arabic texts with allowing line breaks?

I would like to highlight some texts. For Latin texts the \hl command of the soul package works well, but not for Arabic texts. (\hl{SOME ARABIC TEXT} has only a small line as output in the pdf ...
10
votes
5answers
2k views

I just want to have the text in my pdf the same way I have it in my editor

I want to paste from the clipboard a plain text copied from a text editor (line wordpad++, vim, notepad etc), and I want TeX to respect the same line break formatting that the editor has. This works ...
10
votes
4answers
324 views

How to break this long radical into multiple lines?

I've got a very long radical in a display-math environment, so long that the equation spills in the right margin. How can I break that equation over multiple lines, so that it doesn't go into the ...
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}[ ...
10
votes
4answers
2k 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 ...
10
votes
2answers
7k views

How can I make my text never go over the right margin by always hyphenating or breaking on word-boundaries?

I've seen several different methods that can be used to make long words not go over the right margin, but all of them have been paragraph-based. I need a solution that can apply to the entire text ...
10
votes
2answers
3k views

paragraph style - how to force line break? \paragraph{} \\ - make paragraph a header?

I want to format paragraph to work as a regular title \paragraph{title} text goes here output of that is: title text goes here how can I change the output to force line break and use the usal ...
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} ... \\ ...
10
votes
3answers
291 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 ...
10
votes
3answers
2k views

Why \linebreak doesn't work when text width is not set?

This is the code I have: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \tikz \node[rectangle split, rectangle split parts=2] ...
10
votes
3answers
637 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 ...