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

learn more… | top users | synonyms (1)

7
votes
1answer
483 views

Penalty or badness for linebreak near start or end of sentence

I would like to set a penalty or badness for breaking a sentence (or the contents of some \command{...}) too early. More specifically, I would like the penalty of a line break to be dependent on the ...
1
vote
1answer
468 views

bibliography problem large spacing

@booklet{Ph4, author = {Panchenko, D.}, title = {Statistics for Applications / Gamma Distribution}, year = {2006}, url = ...
4
votes
1answer
412 views

How to line break a siunitx unit

I made a new command for this unit: \SI{#1(#3)e#2}{\KBE\per\gram\of{FM}} But it is so bulky and it seems that latex can t handle the "normal" linebreak. So, my new UNIT is sometimes over the normal ...
1
vote
2answers
107 views

Linebreak in math environment

I have an odd problem, I tried already all possible things, align, eqnarray, $, \[ \] and so on, but the following stays the same: I have a formula inside text and it is not broken, so it goes into ...
8
votes
1answer
3k 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 ...
1
vote
1answer
467 views

Placing several pictures in one line, but with linebreak

I am trying to plot several pictures in one line, but only two per line and then the next two in the next line. And I want it all to be in one Figure so that I have only one caption. I can place ...
15
votes
1answer
1k views

How to break long URLs using common hyphenation but adding a line feed indicator?

I saw several questions like this one that request a solution for breaking apart URLs. I wonder if it is possible to hyphenate the words in a URL as it happens in normal text (i.e., breaking apart ...
11
votes
1answer
335 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 ...
5
votes
1answer
616 views

listings: closing parenthesis as delimiter not matched when linebreaks=true

I want code in parentheses and in brackets to appear in different colors. In the following document, the words brackets again appear in green as intended, and outside again is black as intended, but ...
9
votes
2answers
2k views

Avoid putting statements on the same line with algorithmicx

I'm writing a simple pseudocode, but I have a problem with a repeat..until block. Basically what happens is that the return statement that follows the end of this loop gets rendered on the same line ...
6
votes
1answer
181 views

Preventing line break at the start of a long name in `\lstinline`

This question has developed from How to deal with very long lstinline-phrases like long class names?. That question is about line breaking inside a \lstinline phrase. I have provided an answer which ...
11
votes
2answers
557 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 ...
5
votes
2answers
110 views

Tie an inline math environment to be in the same line

How should I put command so that my inline math environment could be together. For example 0<x<1 is break up into two parts, 0< and x<1 in the next line.
1
vote
1answer
2k views

list item multilined ( `\newline` inside of item label ?)

How to make multiline item label ? Example \documentclass[a4paper,10pt]{article} \usepackage{lipsum} \begin{document} \begin{itemize} \item[Great Item] \lipsum[1] \end{itemize} \end{document} I ...
4
votes
1answer
223 views

\newcommand creates underfull\hbox (badness 10000) in paragraph

I have a 2-column document with repeating boxes. So I created these macros (don't mind the colors and boxheight): % ------------------------------------------------------- % aitparagraph % % gives ...
5
votes
1answer
503 views

Manually Break line in custom chapter title

\documentclass[openany, 10pt]{book} \usepackage[utf8]{inputenc} \usepackage[MeX]{polski} \usepackage{titleps} \usepackage{lipsum} \usepackage{tocloft} \renewcommand\cftchapaftersnum{.}% adds dot ...
0
votes
1answer
304 views

Words don't wrap inside redefined \marginpar{}

I have tried to play with a MWE from @cmhughes in this topic, and discovered that words inside \marginpar do not wrap like they should. Here is a MWE: ...
9
votes
2answers
2k 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} ...
9
votes
1answer
1k views

bibtex: URL and DOI line breaks on different characters

In my references, I want to allow DOI's to break on a slash '/' character (or as a last resort on any character) to avoid underfull lines like the third reference below. Note that URL's are already ...
6
votes
1answer
2k views

Automatic break/hyphen for too long meaningless words

Since there is no pattern for hyphening meaningless words, they should be individually hyphenated/broken with methods such as \hyphenation{longword}, \seqsplit{longword}, etc. However, there should ...
7
votes
1answer
257 views

Allow line breaks but not page breaks in inline formulas

It often happens that LaTeX breaks up an inline formula over two lines. However, I find it quite distracting when it breaks an inline formula over multiple pages. For example: ...
4
votes
1answer
7k views

Vertical align at center in beamer slides using the [allowframebreaks] option and \newpage

I'm writing my thesis slides in beamer. I need to align vertically at center the slide's contents when I use the [allowframebreaks] option in the frame environment and the \newpage to start a new ...
3
votes
1answer
1k 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 ...
4
votes
1answer
724 views

correct the hyphenation

How to correct the hyphenation in my paper that is entirely wrong? For example, in my paper, there are wrong hyphenations like result-s, s-mall, s-pace, etc. How can I fix this problem. I don't use ...
30
votes
2answers
19k 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 ...
6
votes
3answers
6k 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 ...
23
votes
2answers
557 views

What is “\\” called?

I’ve seen it take arguments, and apparently there’s a starred version, but I can’t find any documentation because it is ungooglable!
2
votes
1answer
187 views

Listings not breaking up

I have a code listing as shown in the picture (number 4) that goes a bit out of the margin although breaklines=true. When I try to break new line it gives me an error Listings Error: lstinline ended ...
2
votes
1answer
189 views

Listings package does not break with mwrep document class

I cannot get listings package to break lines with any of the methods described in previous questions: Listings package does not break, ...
7
votes
1answer
501 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 ...
7
votes
3answers
1k views

Automatic linebreak on specific character

Based on my old question Push long words in a new line, I search for a possibility to allow linebreak on specific character. For example in my case I want to break on "_" (underscore). ...
7
votes
1answer
1k 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 ...
2
votes
1answer
807 views

Quote exceeding quote right margins

I have a quote that displays long chains of words, such as hippopotamus/hippo The quote environment does not break words, so I have text exceeding the right margin of the quote. How can I ...
18
votes
1answer
947 views

Best choice between using \\ or leaving space after each paragraph to end the paragraph

Here is the thing, I have always used a blank space between paragraphs in order to tell latex that there is a new paragraph. But there is someone I work with very often that keeps using \\ to break a ...
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. ...
5
votes
1answer
458 views

Linebreaks in KOMA-script captions

Using the captions package, linebreaks can be incorporated into figure-captions easily: \documentclass[12pt]{book} \usepackage{graphicx} \usepackage{caption} \begin{document} \begin{figure}[htbp] ...
4
votes
1answer
2k 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? ...
17
votes
2answers
288 views

Could TeX typeset note text between two lines of the body?

How to typsetting the note text like There is body blahblah blahblah I need a note here and then blah blah The note about word blahblah blahblah ...
10
votes
1answer
3k views

Listings package does not break

The following code does not break even though the breaklines and breakatwhitespace is set: \lstset{ language=XML, numbers=left, numberstyle=\tiny\color{gray}, stepnumber=1, ...
12
votes
3answers
1k 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 ...
3
votes
1answer
163 views

Line breaking and floating

I have a matrix and I want to show some lines of text floating right to the matrix. The problem is that the following code shows two lines of text without executing \\ break-line. \[ M = \left( ...
6
votes
1answer
743 views

Command \obeylines in a macro

I need to collect data (a sequence of input strings) in the preamble of a document, but the strings are to be typeset later in the document and must obey the line breaks set when typing the strings at ...
7
votes
1answer
1k views

Avoid line breaks after \lstinline

I'm writing a computer science paper with LaTeX and have a lot of inline code. Now, when this code is followed by a comma and is at the end of line, the line break is inserted before the comma, which ...
5
votes
2answers
602 views

Text created with a \newcommand overflows into margin (not xspace question)

I am aware of the use of xspace to handle the space after a macro in different situations. However, it seems that I cannot avoid having my text created with a \newcommand from running into the ...
9
votes
2answers
2k views

Mutliple inputs with line breaking

I am trying to write an algorithm with multiple inputs in algorithm2e. The result I would like to have is something like Algorithm ------------------- Input: Input number 1 Input number 2 ...
6
votes
1answer
3k views

Breaking an array of equations

I wanted to break long equations in an array environment. To do this, I used dmath environment from breqn package but it did not work. How can I write long equations in an array environment with line ...
17
votes
1answer
33k views

Inserting a specific number of blank lines

I'm new to LaTeX and trying to format my Honors Thesis, which has very specific formatting rules to prepare the manuscript for publication. For instance, on the Abstract page, I am required to place 3 ...
5
votes
1answer
3k 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} ...
2
votes
1answer
662 views

split a \xrightarrow into two lines

I'm using the command \xrightarrow{}[] in a two column document. The problem is that the string above the arrow is too long and the arrow ends outside the column. Is there a way to "split" the arrow ...
0
votes
2answers
2k views

New line instead of word-breaking [duplicate]

Possible Duplicate: Prevent hyphenation and use line break in block of text When some word at the end of sentence does not fit in the line - I would like it to be moved to the new line, and ...