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

learn more… | top users | synonyms (1)

1
vote
1answer
28 views

For programming a command: emit \newline iff we are within a paragraph

Short version: I am defining an environment: \newenvironment{myenv}{\begin{trivlist}\item}{HERE something\end{trivlist}} Now at the point marked with "HERE", I need a "conditional newline" doing ...
4
votes
3answers
142 views

How to deal with bad line-wrapping of \texttt?

If I have long words inside \texttt blocks, in my case for writing about variable names, sometimes the word-wrapping doesn't quite work, resulting in slightly-too-long lines. \documentclass{report} \...
1
vote
0answers
42 views

Removing carriage returns in LaTex file

I have huge list of references in \bibtex format that I need to alphabetize. Unfortunately, the original list included carriage returns to wrap the individual entries and keep them compact in the .tex ...
2
votes
2answers
37 views

Linebreak problem with titlesec

I'm trying to format the section titles in my article to be Large, centered and underlined using titlesec. Some of my section titles are quite long so i need them to be in multiple lines. However, I ...
1
vote
1answer
28 views

How can I make a line break on HostMath [closed]

I want to express the following: I need to express it on HostMath, where \nextline somehow doesn't work. What I have so far: \text(If ) \frac{x-3}{3}=k \text( and ) k=3, \text(what is the value ...
1
vote
0answers
30 views

newline just before \cite

Is there anyway to insert a newline just before \cite command i tried with \\ and \newline but i could not compile my document i got errors just where i inserted the \\ and \newline here is my latex ...
4
votes
1answer
42 views

How can i split the chapter name in two lines, i have style file provided by college?

% % This is a version of NITC Seminar/Thesis/Dissertation latex format. Modified from the Old Dominion University Latex thesis template to confirm to NITC thesis % format. Modifications done by N ...
0
votes
0answers
43 views

How to breakafter?

I want to break after whitespace or symbol in my http code example. I am using minted with my Xelatex. How my preamble looks like: \newminted{json}{breaklines,frame=bottomline,rulecolor=\color{...
1
vote
1answer
35 views

Line break in arabic text?

i'm stuck trying to insert a line break in an arabic text, any suggestions are welcome I'm using \usepackage{arabtex} Here is the complete example \documentclass[10pt,a4paper]{report} \usepackage[...
2
votes
2answers
81 views

Avoid linebreak in abbreviation

I use the macros for i.e. and e.g. from the tufte-book example. They look great, but sometimes a linebreak occurs in between like in the following example: \documentclass[nobib]{tufte-book} \...
2
votes
2answers
32 views

Colored text with linebreaks

at the risk that this has been solved somewhere, but I just can't find a solution: I want to highlight java class names in my text, for what I've created a macro \newcommand{\class}[1]{\textcolor{...
3
votes
2answers
82 views

Unable to line break \title with \maketitle - using custom title package

I want to use a title page package, ku-forside, made for my university, which can be found here. The site is in danish, so i will translate the instructions (briefly) to english: Hit "Zip-fil med ku-...
5
votes
2answers
56 views

Colorbox does not linebreak

I'm new here, so I'm sorry for any mistakes or error in from my part. I am trying to make colored textboxes that refer to colored blocks in a figure. My problem is that the colored box does not ...
2
votes
1answer
18 views

How to prevent line break before quotation mark when using a different font in quotation

I have \documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \newcommand\french[1]{\!\! \fontfamily{jkplkvos}\selectfont #1 \fontfamily{\familydefault}\selectfont \!\!} \begin{...
3
votes
1answer
20 views

break lines with \includegraphics[draft] option

When I am using \includegraphics with the draft option \includegraphics[draft]{long-image-name} the image name is shown instead of the image. Unfortunately it appears on one line without lines ...
2
votes
1answer
27 views

write a small text in an equation environment after the symbol “=” [duplicate]

I wanto to write something like this c dt = average probability that a particular 1-2 molecular pair will react according to R in the next infinitesimal time interval dt. I tried with ...
2
votes
1answer
26 views

How to tell alltt not to skip lines at beginning/end?

It seems like there is no option for specifying that, like a hack for verbatim I found on tex.stackexchange: \usepackage{etoolbox}% \makeatletter \preto{\@verbatim}{\topsep=0pt \partopsep=0pt} \...
2
votes
1answer
31 views

long table multicolumn single word without hyphen [duplicate]

I am trying to create a long table that will be multicolumn. In one of the columns, I have a DNA sequence that is very long. I am trying to use the \multicolumn but the text is not wrapping possibly ...
2
votes
2answers
51 views

Start a new line after the first page

The command to start a new line in LaTeX is \\. It works well on the first page of my document, but from the second onwards no longer works. Does anybody tell me why? This is the code: https://...
2
votes
1answer
33 views

Aligning long broken equation (with brackets also split over multiple lines)

I have long equation $F=\left\{ abcdef \right\}$ which needed to break line at halfway. To do it I use \begin{multline}. \begin{multline} F = \left\{ abc \right.\nonumber\\ \left. {} + def \...
0
votes
0answers
12 views

Line break within brackets in Bibtex

When I use Bibtex, I want everything within a bracket to appear in the same line. So, for example, in the attached Bibtex, I want the phrase "Phys. Rev. A" to appear in the same line. You can try and ...
1
vote
1answer
49 views

Breakable \colorbox? [duplicate]

Given a phrase in the middle of which TeX will place a return carriage, if we place this phrase within a \colorbox, TeX no longer places the return carriage and the phrase protrudes in the margin. Is ...
4
votes
2answers
55 views

Unexpected first line break

Sometimes pdfLaTeX decides to break the first too early and I really can't understand why and how to avoid this. Unfortunately, following our standards, I had to disable word division, which seems to ...
1
vote
1answer
30 views

How to insert a break line in LaTeX just like hr tag do in HTML?

In HTML, I can insert a line below any text using <hr> tag. How can I do same thing it in LaTeX?
1
vote
0answers
25 views

How to break long sequence of fractions in math mode? [duplicate]

I tried few solutions, such as using seqsplit and breqn but no success. splitting-very-big-numbers-over-several-lines I want to break long sequence of fractions. Here is MWE \documentclass[12pt]{...
2
votes
1answer
16 views

Line break between two graphics in a subfig-style subfloat

What I am trying to achieve is this: AA B AA C A being one subfigure, B+C a second. However, I don't achieve the line break between B and C: \documentclass{article} \usepackage{subfig} \usepackage{...
3
votes
1answer
59 views

How can I redefine verbatim to wrap lines (add break before or after spaces)?

Before continuing, I would like to inform readers that I know it is generally discouraged to reimplement functionality that packages already support. Automatically wrap the text in verbatim has an ...
0
votes
1answer
29 views

Vertical Spacing After NewEnvironment Definition

How can I modify this, \newenvironment{definition}[1][Definition]{\begin{mdframed}\begin{trivlist} \item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}\end{mdframed}} so that a newline (vertical ...
0
votes
0answers
32 views

Underfull hbox error using \newline and \hfill\break

I am trying to remove warnings/errors from the document I am writing that includes underfull (and overfull) \hboxs from the code below. Why does \newline and \hfill\break produce this warning? Aren't ...
2
votes
1answer
27 views

line break in “moderncv like \section” in the article class suggests missing \item

With the default definition of \section in the article class, I can make a multiline section header: \documentclass{article} \author{} \begin{document} \section{test \\ test} \end{document} The ...
2
votes
1answer
35 views

Tabular using X column not wrapping cells (tabu package)

I have the following code. \documentclass{article} \usepackage{lscape} \usepackage[table]{xcolor} \usepackage{tabu} \usepackage{multirow} \begin{document} \begin{landscape} \taburowcolors[3] 2{gray!...
0
votes
1answer
29 views

How to avoid linebreak at `http:` in url

I have a long url that gets wrapped at http: in my layout (using beamer). This is the latex-code: \documentclass{beamer} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{url} \...
1
vote
2answers
41 views

Automatic Line Breaking Under Gradient Color Text

How could I add automatically line breaking for a gradient color text? I would like to add gradient color for separate words and long ones are just causing trouble. The code I am using is \...
2
votes
3answers
36 views

Odd indentation after \newline, after Math text

So this happens whenever I try to insert a new line in my source code: The center equation is no longer centered! Why does that happen? I can't seem to figure out how to center it. Here's the ...
7
votes
2answers
77 views

How does TeX break paragraphs into lines when there is only two element in a pararaph?

Suppose we have the following code: \def\tp#1#2{#1\hskip 300cm minus 300cm\hbox{#2}} \tp{Hello}{World it is} and \def\tp#1#2{#1\hskip 300cm \hbox{#2}} \tp{Hello}{World it is} The first one gives ...
2
votes
0answers
36 views

Marking line wraps

I have the following MWE to typeset two text paragraphs with the first line outdented. \documentclass{minimal} \usepackage{lipsum} \begin{document} \parindent=-1em \lipsum[1-2] \end{document} How ...
39
votes
4answers
2k views

How to create nonbreaking arbitrary length snakes for full-width justification?

This is a follow-up to the recent xkcd comic: Here is a simple version without justification: \documentclass{article} \usepackage[text={1.2in,3in}]{geometry} \raggedright \begin{document} \...
1
vote
0answers
15 views

Preserve linebreaks in command argument

I'm using the pdfpcnotes.sty style from https://github.com/cebe/pdfpc-latex-notes and I'm currently trying to make it preserve newlines, i.e. if I write \pnote{ * Foo * Bar } I want this to ...
1
vote
1answer
36 views

Insert indent in algorithm at line break of the same \State

I have the following code: \documentclass[12pt,a4paper,twoside]{book} \usepackage{graphicx} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm*}[t!] \caption{...
3
votes
2answers
31 views

When line breaking goes wrong: does \hfuzz influence \emergencystretch

I read the excellent reply by David Carlisle on a line breaking question. However, one question remained open for me. Carlisle wrote: \hfuzz does not affect the typesetting in any way but just ...
2
votes
2answers
45 views

background package - Using text with line breaks

I'm designing a very simple cover for a university publication in Sanskrit. I'm using the package "background" to add some "watermark-like" Sanskrit text on the cover, both top and bottom, while the ...
1
vote
2answers
32 views

Line breaks inside commands

Is there a way to have line breaks inside commands that don't accept line breaks. For example, \documentclass{article} \begin{document} \mbox{line 1\\line 2} \end{document}
4
votes
3answers
116 views

Line breaking in multiple cases mathematical expression

How can I align this part of my paper: \subsection{Decision variables} \noindent$y_{pij}^{mk}=\left\{\begin{array}{ll} 1, & \;\;\; \hbox{ If the robot loads or uloades a part to/from machine $m$ ...
1
vote
0answers
21 views

How do I minimize tabulary width, contingent on minimizing height or lines per row?

I frequently find that I want to make a table with final column (typically out of 3-5) that will automatically break over multiple lines. So I use \begin{tabulary}{\linewidth}{llL} [...] \end{...
2
votes
1answer
29 views

Breaking long formula at specific characters

I have some rather long formulas that are not equations, and I would like LaTeX to break them automatically whenever necessary, preferably at the \vee symbol. I currently use the breqn package and the ...
0
votes
0answers
17 views

long word after nonbreaking hyphen overflows

I tried the solution given here and here, however the mbox mechanic seems to lead to an overflow before the linebreak depicted below. Could the mbox command somehow be modified to not show this ...
1
vote
1answer
26 views

How can I keep everything within a variable/macro on the same line?

I know there are various techniques to keep things on the same line. I have a two-word variable input. For example, Settings App. Let's say there are a group of apps, and I would like them always ...
2
votes
1answer
29 views

Subfig's ragged-right caption with hyphenated word breaks unaesthetically

Minimal working example \documentclass[11pt, twoside]{report} \usepackage{caption} \usepackage[]{subfig} \usepackage{graphicx} \begin{document} \begin{figure} \captionsetup[subfigure]{...
2
votes
1answer
24 views

Linebreak in overlaid figure text

As a simple example, consider this MWE: \documentclass{memoir} \usepackage{graphicx} \begin{document} \begin{figure}[h] \centering \includegraphics[width=0.4\columnwidth]{example-image} ...
2
votes
2answers
69 views

Prevent line break before equation environment in enumerated list item

I try to accomplish the same thing as in this question: Prevent line break before equation environment in enumerated list item (to have the equation in the same line as "some text"), except that i ...