{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
2answers
292 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
265 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
6k views

Change text background within paragraph (with automatic linebreaks)

How do I change the text color as well as the text background color for e.g. a sentence within a paragraph? I know \textcolor for coloring the font and \colorbox for background coloring ...
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 ...
7
votes
1answer
88 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 ...
7
votes
3answers
146 views

Overruns in newtheorem in latex

I'm defining a newtheorem as follows: \newtheorem{definition}{Definition} the problem is when the definition name is long, it results in overruns. I've tried \\ to split the name in two lines, ...
7
votes
1answer
620 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: ...
7
votes
1answer
421 views

Automatically prevent line-break at hyphen of specific words (e.g. “dual-self”)

Usually questions about hyphenation and line-breaks are concerned about how to allow hyphenation when a word already contains a hyphen. That's not what I'm after: I would like to prevent the word ...
7
votes
1answer
777 views

Line length in fancyvrb

What I'm doing: Typsetting source code using pygments. What is happening: the code typsets fine, but because pygments puts the code into a Verbatim environment, some of the lines are far too long. ...
6
votes
1answer
349 views

Underfull/overfull preference

When long words at the end of a line cannot be hyphenated (for example when hyphenation is suppressed with \mbox{}), LaTeX could either have the tendency to make lines overfull or the tendency to make ...
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.
6
votes
1answer
2k views

How can I prevent hyphenation in a table column?

I have a table (tabular) with some fixed width columns, and I'd like to prevent a hyphen being inserted (preferring a line break to be inserted prematurely). The sample table's content is below. ...
5
votes
2answers
228 views

tikz alignment for multi-line text within font commands

Why doesn't tikz accept multi-line text within font commands like \texttt and \textbf? For instance, compilation of the document \documentclass[tikz]{standalone} \begin{document} ...
5
votes
1answer
266 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
1answer
177 views

How to create a page with two columns that can span pages to achieve my special goal?

I am a Chinese plain TeX user and also a beginner. Now I encounter a hard question, that is I must write some numbered English paragraphs at the left column and its corresponding Chinese ...
5
votes
4answers
1k views

Line breaks and the URL package

Long URLs need to be broken at the end of a line. Here's a topic about that. That topic suggests adding the hyphens option to the URL package, and also to define ...
5
votes
1answer
425 views

Automatic linebreak in align environment in macros

I have given a selfdefined command like \newcommand{\AND}[2]{\left(#1 \vee #2 \right)} which makes sure that I always give the correct number of parameters to my formula and which handles the ...
5
votes
1answer
272 views

Different alignment for table number and caption

I have a table whose table number should be right-aligned and its caption should be center-aligned on the next line like this: Table 1 Caption ...
5
votes
1answer
153 views

Avoiding linebreak before number

Is there a way to avoid linebreaks before all numbers without explicitly using the tilde? It would be nice if it worked both for explicit numbers, as in Sample~1 as well as when a number is implied, ...
5
votes
1answer
119 views

Implicit newline at the end of each paragraph?

In certain styles of text I define \parindent 0pt in the preamble and write the text in this manner: paragraph 1\\ paragraph 2\\ and so forth. I wonder if there is anything I can include in the ...
5
votes
3answers
655 views

How to break long word containing symbols but with no hyphen?

Below is my minimum working example: \documentclass[10pt,a4paper,draft]{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{lipsum} \begin{document} ...
4
votes
2answers
359 views

Start a new line in label using pgf-pie

I'm using pgf-pie. It is not a standard package. I found it on google code. As its name, it is used to create pie chart. \begin{figure}[htp] \centering \begin{tikzpicture}[scale=0.9] ...
4
votes
1answer
298 views

Too long hyperlink can not fit on page

I have a problem with a too long hyperlink. This reference is one word, but it is too long and doesn't set the text width, so some part is pushed beyond the margin: ...
4
votes
1answer
2k views

Newline in \multirow environment

One element of a multirow column is long. How can I split it so that it spans over multiple line. The following code \documentclass{article} \usepackage{multirow,array} \usepackage{booktabs} ...
4
votes
2answers
173 views

Hyphenatable material enclosed in group braces

I have text that I need to repeat quite a few times: \newcommand{\repeatme}{text to repeat that is somewhat long and verbose} I'd like to underline this text and have it not cause hbox overflow ...
4
votes
2answers
3k views

Linebreak and \enquote

Using the \enquote{} command from the csquotes package my quotes seem to be wrapped to the next line a lot of times like this: This is an "example " sentence. Without the extra whitespace. Now ...
4
votes
2answers
965 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}
4
votes
3answers
444 views

Restricting the length of a line of text while allowing line breaks

While attempting to answer this question, I re-read Chapter 14 of The TeX Book (on how TeX breaks paragraphs into lines). It got me thinking: Is there a way to restrict the length of a string of text ...
3
votes
1answer
45 views

condense non-numbered bibliography into one line

What I am trying to do is basically the same as (almost) answered here: http://tex.stackexchange.com/a/5574/39336 The difference is that I am using a different bibstyle. This bibstyle creates the ...
3
votes
1answer
87 views

ConTeXt: Scale font for text based on maximum width

Background Looking to devise a scaling factor for two fonts such that the text, when added to the final document, fits on one line. Example In the images below, the two fonts are the first ...
3
votes
1answer
99 views

Custom table caption (Updated)

I'd like to achieve a custom table (figure) format with Table numbering and title (this is usually the title also used in the list of tables but does not have to be) in boldface, and the (longer) ...
3
votes
1answer
69 views

Using savebox around the BODY of environ

I tried to use a \savebox around the \BODY macro of \NewEnviron. Can I keep the linebreaks somehow (they are gone, in the MWE)? \documentclass{article} \usepackage{environ} \newsavebox{\mybox} ...
3
votes
1answer
63 views

Weird new line using \cmpd from chemnum in long headingtitles

I have a problem using \cmpd in a heading, that is too long. For some weird reason, the compound number gets put on a new line, even though there is no need. I already have a workaround using ~, but ...
3
votes
1answer
163 views

URL linebreaks W/O \sloppy

Hours of reading the different articles on url linebreaking did not reveal a solution for the following problem: I've got a long url, which I do not intend to short using online services. The url ...
3
votes
1answer
68 views

output generated macro content with newline

I would like to debug a latex macro, but I do not really know how. I got the following MWE which replaces the \\ in a string. I would like to print the value of generated string to check the result. ...
3
votes
1answer
1k views

How can I fix this overfull hbox?

\documentclass[10pt]{article} \usepackage{chemfig} \usepackage[margin=1.2in]{geometry} \newcommand{\chem}{\setatomsep{2em}\chemfig} \begin{document} \begin{itemize} \item[--] 1$^\circ$ Alcohol ...
3
votes
2answers
2k views

Tabbing environment: How to line break?

I'm desperately trying to get a linebreak in a CV at the end of my dissertation. When I do this: \begin{tabbing} \hspace*{4.5cm}\=\kill 09/2004 -- 11/2010 \> \textbf{Study of Biology at TU ...
3
votes
3answers
3k views

Line break in rotatebox in table?

I use \rotatebox to create a table with vertical headers, like so: \documentclass{article} \usepackage{rotating} \begin{document} \begin{table} \begin{tabular}{|l|l|l|} \hline ...
3
votes
2answers
654 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 ...
2
votes
1answer
47 views

inline code listing runs into right margin

I am trying to typeset an inline C# code listing using the listings package. However, the chunk of inline code spans a few lines, so listings has to insert a coupe of line breaks into my code. So far, ...
2
votes
1answer
74 views

Make the lines of a description item line up

I am trying to line up the lines of a single description item. When I introduce a line-break or when the line becomes to long, the new line isn't lined up with the first one. I'm aware of the fact ...
2
votes
1answer
107 views

List all sections in TOC in one line wrapped [duplicate]

How can I list all sections under a chapter in TOC, in one (wrapped) line (without pagenumber is fine)? Thanks. Expected,: Chapter 1 .................................................... 10 section ...
2
votes
1answer
116 views

Text gets out beyond the table

I use WinEdit and try to make a table. The problem is that I can not move the text in a multirow to the second line. There are the packages I use: \documentclass[12pt, a4paper]{article} ...
2
votes
2answers
366 views

\noalign without line break / additional spacing

I need a non-breaking version/redefinition of \noalign to use it at the end of an environment (in this case align). So far I searched for the standard definition of \noalign to write a redefinition ...
2
votes
1answer
518 views

Background color in inline code listings with linebreak

I want to highlight code inline with a gray background. Preferably with listings. This question is related to Colored background in inline listings. But as my MWE shows it doesn't work with line ...
2
votes
4answers
563 views

Boxes overflow column

It's all in the subject. I used all kinds of boxes in a towcolumn article, but whenever the boxed text is long enough, the box happily continues into the other column! Is there a "smart" box that ...
2
votes
2answers
192 views

Custom references page with additional line breaks

Is it possible by any chance to style the references page to match this: [1] The Author, The Author2 "The title of some kind" 3rd. edition ISBN: xxxx-xxxx-xxxx-xxxx
2
votes
1answer
753 views

How do I put multiple lines in a title when using the apa6 class?

Right now I'm using \title to define a title and \maketitle to display it. How do I put multiple lines in the title? I need to adhere to APA 6th edition format, and according to the book I'm using, I ...
2
votes
1answer
777 views

When I prevent hyphenation using an \mbox, the box gets pushed into the right margin

I've used \mbox to prevent LaTeX from breaking certain long words into hyphenated pairs. Now I have a new problem: the unbroken words are extending into the right margin. Here's some minimal sample ...
1
vote
1answer
429 views

Wrap lines in verbatim

I just started to learn LaTeX, and I have to do some documentation with it. However, the guy editing the TeX manuscript of the documentation before me didn't pay attention to word wrapping, so long ...