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

learn more… | top users | synonyms (1)

3
votes
2answers
218 views

Macro with \n doesn't work, not sure why.

I created a macro called \code to wrap all the code fragments in my book, \newcommand{\code}[1]{\emph{#1}} But for some reason when I use this \code{\\n}, I never get the \n displayed. For some ...
3
votes
1answer
478 views

Insert \nobreak into subsection title in titletoc's \titlecontents star version

I want the label and title of subsection typsetting as a paragraph but NEVER break down in a subsection title. Say, the code below \documentclass{article} \usepackage{titletoc} \titlecontents* ...
2
votes
1answer
381 views

Put long formulas on new line/pgf tikz?

Sometimes I have to work with long formulas that can (or I want) not be split over two lines. I'm trying to write a macro that sent the formula at the new line if the formula would go over the margin. ...
18
votes
3answers
1k views

LaTeX word wrapping poorly

LaTeX is not word wrapping this anything close to sanely: \documentclass{article} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{geometry} \usepackage{lipsum} \geometry{margin=1in} ...
13
votes
2answers
9k views

\hfill after linebreak

I have a simple text. Right after the end of the text I use \hfill to get some words right aligned. \documentclass[11pt]{article} \begin{document} Lorem ipsum dolor sit amet, consetetur ...
11
votes
2answers
14k 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 ...
3
votes
1answer
232 views

How to properly break text with lots of inline formulas?

I have the following document: \documentclass{article} \begin{document} \textbf{Theorem:} $\forall x_0\cdots\forall x_{n+2}( \forall x_{n+3}(x_{n+3}\in x_{n+1}\leftrightarrow ...
22
votes
2answers
7k views

Line breaking of URLs in bibliographies

I have a problem with the line break of an URL. The URL can´t break correct and extends into the border. I´ve tried some things. Amongst others I loaded the package breakurl, but without any success. ...
36
votes
4answers
8k views

When should I use non-breaking space?

DEK gained a reputation of painting red the draft dissertations of his students, taking particular note of incidents when they omitted a non-breaking space that should have been included. I have this ...
5
votes
2answers
543 views

Line wrapping on narrow pages

I'm trying to format a long paper of mine for the kindle. The following works, but there's a problem. \usepackage[paperwidth=9cm, paperheight=11.5cm, top=0.1cm, left=0.1cm, right=0.1cm, ...
2
votes
1answer
528 views

Context-sensitive newline macro

I'd like to write a new command putOnNewLine such that \putOnNewLine{ABC} puts ABC on a new line, with exactly one line's vertical space separating it from what has gone before. It must also ...
0
votes
1answer
509 views

Split equation problem

I would like to split the following equation in two parts. Very basic thing, seems to be. \begin{equation} \zeta_k(x) = \frac{\sin (\frac{1}{2} (x - x_0)) \cdots \sin(\frac{1}{2} (x-x_{k-1}))} { ...
4
votes
1answer
2k views

Newline in equations

The code looks something like: $$ If \ abs(dx) = abs(dy) \ then \\ step = abs(dx)\\ else \\ step = abs(dy)\\ $$ I want the '\\' to ...
4
votes
1answer
415 views

Wrapping relational operators

If an expression $A = B$ (or say, $A \leq B$) occurs in a sentence and there is only enough space in the current line to accommodate $A$, LaTeX will place the equals sign beyond the margin and cause ...
8
votes
1answer
935 views

Title running off the page!

I haven't had this problem before so I'm not quite sure what's happening, but my title is running off to the right side of the page. This is my code: \documentclass{article} \usepackage{assymb} ...
1
vote
1answer
380 views

Caption alignment

For my master degree thesis I'm using a quite complicated latex template. The relevant part of the template is here: http://pastie.org/1728702 Probably this wasn't a good idea since I cannot ...
6
votes
1answer
580 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). ...
19
votes
2answers
3k views

How can I prevent LaTeX from breaking inline formulas globally?

I am using the acmsmall template and my inline formulas are being broken at equal signs and arrows; how can I prevent them from being typeset like that globally (i.e. without having to put tildes ...
14
votes
2answers
11k 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] ...
17
votes
3answers
6k views

Quote environment with reference at the end right

I want to define a quote environment such that after the quote on the right occurs the author with page number. My solution is yet the redefinition of the quote environment \usepackage{amsthm} % ...
5
votes
2answers
919 views

Centering and \MakeUppercase with linebreaks

I wish to make the list of authors show up as centered, uppercase and listed vertically on my titlepage. My documentclass contains a section like this \begin{center} ... ...
1
vote
1answer
593 views

Text crossing the page margin in math environment

I have some long text (a single sentence) which I want to put inside a math environment. But my text just goes accros the page margin and ignores the textwidth specification given in the preamble. ...
16
votes
1answer
3k views

How to suppress overfull hbox warnings up to some maximum?

I want LaTeX not to give warnings for overfull hboxes up to some maximum of say 2 pts. How to achieve this?
6
votes
4answers
948 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 ...
31
votes
4answers
3k views

How to prevent linebreaks after hyphen if word starts with hyphen?

(Remark: Maybe this is a typically German problem, I'm not sure in which other languages that might be relevant) Sometimes there are words which start with a hyphen, as they are connected with a word ...
6
votes
3answers
4k views

Insert a symbol at the end of line

I want to insert a symbol (\Box) at the end of the line.
5
votes
2answers
255 views

How to spread words in several lines uniformly?

In TeX, I can use \hbox to 1in{foo bar baz} to get Is it possible generalize the use, to get this result: by typing a paragraph foo bar baz test text only? I tried \break to break lines at ...
6
votes
1answer
1k views

Optional but encouraged line break + \hfill

How would I write a macro (to be placed immediately before every URL in a bibliography) whose effect is to tell TeX This is a good place to insert a line break, but breaking the line here is not ...
14
votes
1answer
3k views

Verbatim environment and line-breaking

I've been wondering about how to display simple codes. I used verbatim and then found the fancyvrb package which added a lot of nice little features, but then I inserted some code with a long line and ...
6
votes
1answer
608 views

Writing in the same line as the section title

I needed to add some text after some of my section title and it certainly needs to be in the same line, and not to be in ToC or bookmarks. Therefore i decided to create my own subsection-type-thingy ...
1
vote
1answer
489 views

Why does my linebreak not work?

I have the following code: \section{Questions} \freequestion What is the largest (LOC) class in the project? \par \makebox[\textwidth]{% \begin{tabularx}{\textwidth}{|X|S|S|S|S|S|X|} \hline ...
20
votes
1answer
5k views

Underfull \hbox in bibliography

I am getting lots of "Underfull \hbox" warnings that point to the *.bbl file. It looks like these messages appear only when URLs are very long, like in the below example: @techreport{nistguidesec, ...
35
votes
6answers
11k views

Prevent LaTeX to break an inline math equation

I hope this question was not asked before. At least I haven't found it. I have an inline math equation and LaTeX is breaking it into two parts. In this case I'd prefer to have the whole and short ...
12
votes
2answers
4k views

\texttt overfull hbox problem

I asked a question earlier about \verb and overfull hbox : In-line \verb -- overfull hbox problem And regarding the solution there, changed many of my \verbs to \texttt{}s. I have come up with a new ...
12
votes
1answer
28k views

In-line \verb — overfull hbox problem

I'm having a problem that I've had before and I'm tired of hacking my way through it and hope that there is some supported solution. I'll go ahead and create a document for example: \documentclass ...
9
votes
3answers
12k 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 ...
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 ...
19
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 ...
40
votes
1answer
4k views

Breaking equations with breqn

I am new to using the breqn package. It looks good, but I get an odd behaviour when an equation can almost fit in the page but not quite: the alignment gets completely wrong. Is there a way to fix ...
21
votes
2answers
4k views

Why should I put a ~ before \ref or \cite?

My question is in the title of this post, but extends to other referencing commands like \eqref, \citep, \citet (and the like) as well.
4
votes
2answers
1k views

Starting an enumerate of an enumerate on next line?

What I'm trying to do is to make my enumerates look like this a) i) answer ii) answer b) answer Currently, I'm using \begin{enumerate} \item \hfill \\ \begin{enumerate}[a)] \item ...
29
votes
2answers
6k views

Why does underlined text not get wrapped once it hits the end of a line ?

Sometimes I want to underline some text, and it extends past the end of a line. Why does \underline{} not automatically wrap my text for me ? Also, how can I underline text so that it will still ...
9
votes
2answers
6k 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 ...
4
votes
3answers
588 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 ...
12
votes
2answers
398 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 ...
47
votes
4answers
83k views

How to break a long equation?

I have a long equation but long enough to occupy two lines. I want to break it to improve readability. How can I break it? \begin{equation} F = \{F_{x} \in F_{c} : (|S| > |C|) \cap (minPixels ...
5
votes
5answers
11k views

How can I insert a newline in a framebox?

I have several frameboxes in my document, using the following command: \framebox(115,115){ R-Sq: \newline For example} I want to force a new line, but neither \newline or \\ appear to work. Is ...
5
votes
2answers
389 views

linebreaks for cjk languages?

What do I need to write documents in a CJK language? I'm getting no linebreaks at all on Japanese text. (overfull hboxes, text going off-page) Here is a (mostly) stripped-down test: ...
4
votes
1answer
3k views

hyperref url breaking

References: Forcing linebreaks in \url So, in a plain document with \usepackage{url} \begin{document} You can find this at \url{very-long-url}. \end{document} the URL will be broken down, e.g. ...
6
votes
2answers
304 views

Automatic repetition of mathematical operators after a line break

In handwritten mathematics it is common for the sake of clarity to repeat the last mathematical operator in those line breaks that occur in the middle of a formula. I mean something like: We compute ...