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

learn more… | top users | synonyms (1)

8
votes
4answers
4k views

Newlines after section headings in amsart

This latex code: \documentclass[9pt]{amsart} \begin{document} \subsubsection*{Animals} Rabbit horse monkey cow \end{document} Generates something that looks approximately like this: ...
8
votes
2answers
826 views

Line overflow with long filenames and urls

Consider the following text. Here /etc/postgresql/8.4/main/pg_hba.confoverflows into the margin, and is hypenated. /var/lib/pgsql/data/pg_hba.conf is also hyphenated, but does not overflow. So, I was ...
8
votes
2answers
1k views

ragged2e: “newcommands” option produces “underfull \hbox” warnings

The ragged2e package provides the commands \Centering, \RaggedRight and \RaggedLeft for setting ragged text while allowing hyphenation. The package offers a newcommands option that sets the standard ...
8
votes
2answers
362 views

How to deal with very long lstinline-phrases like long class names?

According to this Question: listing: How to deal with very long lines that do not contain spaces? My problem is that my \lstinline-phrases does not contain any special character like "-". In my ...
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 ...
8
votes
3answers
1k views

How to adjust font size or kerning to fit line width?

I have some text that nearly fits the given line width. I can see that a minimal adjustment of font size or kerning would make the text fit, but how do I tell LaTeX to squeeze the text? Yes, this ...
8
votes
2answers
484 views

Overfull \hbox from printindex

I've got a index generated with makeindex but when compiling the file again, when the index is generated, I get a bunch of overfull \hbox. This is an example of an index that results in overfull: ...
8
votes
3answers
360 views

How to put a non-breaking space in \cite

How do I put a non-breaking space inside a \cite macro with several citations? \cite{ref1,~ref2} causes an error. If I leave the space out, one is inserted and this is causing the citation to span two ...
8
votes
1answer
374 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 ...
8
votes
2answers
70 views

How do I separate items within a line so that the separator automatically does not appear at either end, and items are not line-broken?

In my CV, I have lists that look like this: wizardry \tdot fluid dynamics \tdot applied bear wrangling \tdot calculus \tdot [...] where \tdot is a \textperiodcentered character along with some ...
8
votes
2answers
1k views

Why \allowbreak is not working?

So, here's the code I have: \usepackage{amsthm} \begin{theorem} ...could be now considered as an algebraic structure $DB_E = \left\langle \mathbb{S},\allowbreak \mathbb{E},\allowbreak f,\allowbreak ...
8
votes
1answer
187 views

Newline in \def

I can not solve my problem. I have definition: \def\mfTitle{askdj asldj asdlk jhasd kjhaslkjd asdas} and I would like add a newline into it: \def\mfTitle{askdj asldj asdlk \newline jhasd kjhaslkjd ...
8
votes
2answers
669 views

\RaggedRight makes document longer

I have a document carefully written to fit in 4 pages; but when I added a \raggedright (or \RaggedRight with use of the ragged2e package) the length gets longer. Furthermore, suddenly the output ...
8
votes
2answers
234 views

Is there any solution for highlighting text in CJK?

Is there any solution for highlighting texts or sentences in Chinese, Japanese, and Korean? I know none, at the moment. But this will be changed, if someone would like to help me with CJK in LaTeX. ...
8
votes
1answer
4k views

How to break long url in an item

I have an enumerate. In an item I have a long url. I use the package breakurl and it works fine outside the enumerate but not in the item. \usepackage[margin=3cm]{geometry} \usepackage{hyperref} ...
8
votes
2answers
289 views

Passing text containing linebreaks as command or environment parameter?

I just tried to write some commands which used its argument to check whether they were empty (isempty{...} from package ifthen) or not. The problem was that the text to check contained a linebreak, ...
8
votes
1answer
972 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} ...
8
votes
2answers
921 views

Non-breaking space in \citet using natbib?

When adding citations in the body of a document I'm used to write ... in some interesting paper~\cite{interesting}. So that (if I'm using numbered references) the word “paper” and the citation ...
8
votes
1answer
1k views

Linebreak in \thanks footnote?

I am using the scrartcl class of Koma-Script with \thanks on the title page. Everything works as expected, so far, but I'd like to use a linebreak within the footnote. Here's an MWE: ...
8
votes
1answer
1k views

Adjust the indentation whithin the algorithmicx-package when a line is broken

I have this code \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm} \caption{Minimal Working Example for my Problem} ...
8
votes
2answers
332 views

How can I fix a problem where italics prevent line breaking when using microtype? [duplicate]

I wish to use protrusion and expansion from microtype as I like the look you get with them. I use amsthm and typeset theorems in italic as usual (with \theoremstyle{plain}). With microtype enabled, ...
8
votes
1answer
737 views

How to get XeLaTeX do proper hyphenation and full justification?

I want to use XeLaTeX to design a paperback (11x19cm) using Adobe's Garamond and Myriad as custom fonts. It is entirely written in German. However, both hyphenation and full justification are a mess: ...
8
votes
1answer
2k views

Beamer: effect of newline and hphantom

Why is it that the file \documentclass{beamer} \begin{document} \begin{frame} a\\ \hphantom{ }b \end{frame} \end{document} produces an a and a b vertically aligned with a line skip in ...
8
votes
2answers
3k views

Linebreak in Package algorithm2e

I'm using the algorithm2e package for pseudocode. I got some very long lines that needed to be wrapped. Is there a way to indent the following (breaked) lines and/or put a mark at the first line to ...
8
votes
1answer
4k views

Line break in edge labels in tikz graph

I'm using tikz and pgf to draw state machines in a document, and I'd like to be able to have a multiline edge label between two nodes. Something like the following would be ideal: \begin{center} ...
8
votes
1answer
215 views

Overfull hbox in biblatex

I just ran into a problem using biblatex with a long author and title: The output extends past the right margin of my text, because biblatex does not insert a linebreak before the date. Please see the ...
8
votes
1answer
69 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
306 views

Identical vertical spacing between paragraphs of different textsize

Something that happens to me very often is that I change the size of certain formula-like material (something close to but not identical to pseudocode in my case) but get inconsistent vertical ...
8
votes
1answer
535 views

Handling overflows in biblatex bibliographies

I'm finally making the transition to biblatex. This is a remarkable package, and has allowed me to cut out quite a bit of old code I used to use to handle eprints, DOIs, crossref mapping problems, ...
8
votes
1answer
5k 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?
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?
8
votes
2answers
8k views

Line breaking (or hyphenation?) of references in apalike

This is a problem I encountered some time ago and I never could solve it: how can you achieve correct line-breaking or hyphenation when citing references with the apalike style? Here is an example: ...
8
votes
1answer
127 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
1answer
269 views

Prevent line-breaking after short words

The publisher requires that most of short words (shorter then 4 chars, and all the prepositions, etc.) should not be left last on the line but kept with the following word. Wrong: Following the ...
8
votes
2answers
271 views

How to automatically keep the indentation level when a line has to be broken

I'm using the algpseudocode package with two custom commands, \Let and \LongState to handle automatic indentation of (broken) long lines in the spirit of Werner's answer, which uses \parbox to wrap ...
8
votes
1answer
210 views

Line breaks in listings

Is there a way like wrap the line after at most 60 letters but it should not break inside some commands like listings does? Example: \documentclass[a5paper]{article} \usepackage[T1]{fontenc} ...
8
votes
1answer
101 views

How to typeset Tibetan in XeLatex with correct linebreaks?

I am trying to typeset Tibetan language in a document, but the text does not wrap at the margin. I think this could be easily fixed if I tell XeLaTeX to recognise the Tibetan tsheg character ('TIBETAN ...
7
votes
3answers
251 views

How to place a line break between every character in ConTeXt?

I have some text appearing in a macro, like this: \printascolumn{This is some text.} How can I place a line break between each letter or printed symbol, such that it appears like this? T h i s i ...
7
votes
3answers
213 views

How does (or, what happens when) Tex typeset(s) a line and linebreak?

I could not find references to this with a cursory search, so I thought I'd post a question; I'm aware this is probably discussed at length in the Tex book or similar, but unfortunately I don't have ...
7
votes
4answers
3k views

Something like \raisebox that respects line breaks

If one wants to raise some text one uses something like \raisebox{0.5 em}{some text} However this doesn't respect line breaks and may cause some nasty overflows. Is there a way to have \raisebox ...
7
votes
3answers
156 views

Preventing newline from left column from forcing a newline in the right column

I'm writing a CV in LaTeX, and got started with the sample called Writing a CV in LaTeX. I'm trying to modify it so that a newline in the left column does not force a newline in the right column. ...
7
votes
2answers
251 views

How come the tilde ~ sometimes does not behave like non-breaking space?

This is again one of the behaviors that are quite difficult to catch in a reconstructible (and simple) example, so one has to resort to animations. Basically, the issue is this: the tilde (~) is ...
7
votes
2answers
215 views

Breakable fill-in blanks

What is a good way to create blank space (preferably, underlined -- it is to be filled in by hand when document is printed) that takes up all the remaining space on a line. The blank space may appear ...
7
votes
4answers
152 views

Justify long line with no spaces but a lot of hyphens

% !TEX TS-program = xelatex % !TEX encoding = UTF-8 Unicode \documentclass[11pt]{memoir} \usepackage{fontspec} \usepackage{showframe} %%% Book Layout %%% \setstocksize{4in}{5.75in} ...
7
votes
2answers
238 views

How to get a line break in a title on the page head?

I am writing a document using the amsart and the title is just very long. Now I wonder, how I could get a linebreak such that it would not overfill the heade of each page. I tried \protect\\\ but this ...
7
votes
3answers
198 views

How to break long equations while keeping alignment?

I have the following long equations: \documentclass[]{article} \usepackage{amsmath} \begin{document} \begin{displaymath} \begin{aligned} (\chi_1|\chi_1) ...
7
votes
3answers
1k views

Alternative to \substack{} for a related purpose

I would like to write something like the following, but involves mathematical symbols: I tried using the \substack{} but it makes the font smaller. I'd like a novel alternative to achieve this. ...
7
votes
3answers
408 views

How to avoid unbreakable \pmb boxes when typesetting math?

I have a big problem called as a river problem. I'm using the report class defined as: \documentclass[11pt,notitlepage,a4paper,oneside]{report} \usepackage[english]{babel} ...
7
votes
4answers
32k views

Bold text and newlines inside equations.

What I'm doing: \usepackage{amsmath} \usepackage{amsthm} \usepackage{eucal} \usepackage{amssymb} \usepackage{mathrsfs} % don't know what some of those do, but i think all the math related ones are % ...
7
votes
4answers
163 views

Line breaks of math expressions in subfloat environment

I would like to show a figure in which there are a graph representation above its edge and node lists in LaTeX. I have written something like this: \begin{figure}[!ht] \subfloat[First figure]{ ...