Questions tagged [line-breaking]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
18 views

Problems using empty lines in color switching command

This is a follow up to my question Change color system for part of a document? I tried to solve this problem by defining the document to be blue (or whatever color I want) then to switch the colors ...
0
votes
1answer
30 views

Make not breaking inline math the default

I find myself often converting some inline math like $a < b$ into ${a < b}$ so TeX won't insert a line break after the comparison operator. I would prefer if TeX simply treated my inline math as ...
0
votes
0answers
17 views

Preventing Hangul (Korean) words from splitting and breaking onto the next line

I am working on a document in Korean, using Hangul characters. It appears that LaTeX freely breaks apart words when it breaks lines naturally. I want to force LaTeX to ONLY break lines on whitespace,...
0
votes
1answer
98 views

When doesn't `\\` start a new line in `\caption`?

Using the command in Why does parameter double when used in caption?, it works in most cases, but in a few cases (like 1 out of 20) \\ does not start a new line. For example using \begin{table} \...
1
vote
1answer
50 views

Subsection throws LaTeX Error: There's no line here to end

I have section and subsection commands in my LaTeX code described as follows. These are included in the style file, foo.cls: \newenvironment{aside}{% \let\oldsection\section \renewcommand{\...
1
vote
0answers
29 views

How to break lines of s.th. like a minipage at smallest width possible without the minipage exceeding a given recommended height?

I use LaTeX 2e. I have material for horizontal mode. Is there an environment similar to minipage with syntax similar to \begin{SmallestWidthAtRecommendedHeight}[⟨Outer Position⟩]{&...
1
vote
0answers
38 views

Enable hyphenated word breaking

When I compile my LaTeX file to produce pdf, the word breaking is not happening. Instead the complete word moves to the next line and extra spaces are inserted between the words in the current line. ...
1
vote
0answers
25 views

How to add discardable vertical glue behind horizontal-mode-material only in case paragraph ends?

I use LaTeX2e. My question is: Can you have a command which adds vertical glue (or increases \parskip-glue) if the next thing that happens is starting new paragraph? Something like: \documentclass{...
2
votes
0answers
27 views

Automatic line breaking at fixed character limit in listings

Is there a way to make a linebreak within listings based on a character limit? This would sort of be like what most editors (like vim, emacs) have, where after a certain number of characters, say 80 ...
2
votes
1answer
30 views

List Environment with Items On Blank lines

How would one go about defining an environment that automatically places an itemize in front of whatever appears after each line break. So \begin{quicklist} foo bar quaz quiz zoom \end{...
3
votes
0answers
77 views

Wrap text in equations?

I'm writing a web application which generates LaTeX code to visualize an equation. There's one significant roadblock I'm running into: Sometimes, a part of the produced equation has a large number of ...
0
votes
0answers
19 views

tufte-book class word wrapping problems

I am having problems with text wrapping around a margin figure when I use the tufte-book class. Here is an MWE: \documentclass{tufte-book} \usepackage{amsmath, amssymb, bm, graphicx} \begin{document} ...
0
votes
0answers
44 views

Is there an alternative for using \mbox to prevent ugly hyphenation in the toc

Assume I have a long chapter title \chapter{one two three four five six seven eight nine ten} that appears in the table of contents like this: one two three four five six se- ven eight ...
1
vote
1answer
43 views

Latex doesn't break line - line goes into border area

In my document I have several lines where the words are not wrapped to the next line. Latex writes it into the border area of the page. I can not reproduce it in an MWE. There it is working correctly....
0
votes
1answer
22 views

Line break in title in LyX

I am using Beamer Article (standard class) in LyX. I have tried to break my title into many lines as I choose but I failed. I have tried "...line 1... ctrl+enter ...line2..." but in the PDF ...
3
votes
1answer
57 views

Consistency of hyphenation of hyphenated words

This is not something I have encountered before and not sure which is the recommended way to hyphenate words with hyphens in them. The MWE below yields two different results based on how the text ...
0
votes
0answers
21 views

Line-breaking between arrays

I have these lists of values but they're all packed together, how can I add a new line between them? I've tried \ and \newline and all sorts but it would come up with errors. Thanks! \documentclass[...
1
vote
2answers
44 views

How to line-break a framed text box?

Is it possible to line-break a framed text box in LaTeX? If so, is it necessary to use some package to do so, and what is the name of that package? EDIT: For greater clarity, let me give an example. ...
1
vote
1answer
35 views

Indentation of the second line of a chapter title in the header of a scrbook class document

I've got a custom scrbook class document and a long chapter title which produces a line break in the printing of the title in the header. The first character of the second line is not aligned with the ...
2
votes
1answer
80 views

\RaggedRight prevents hyphenation

The column type \newcolumntype{L}[1]{>{\RaggedRight\arraybackslash}p{#1}} proposed here does not hyphenate long words that don't have a hyphen, but instead lets them protrude beyond the column. ...
8
votes
2answers
116 views

Is there a new incompatibility between ragged2e an scrlttr2?

The following MWE used to work fine, but since I updated my TeX distribution yesterday (hadn’t done it in a while) it raises an error as soon as there appears more than on \\ in the address. It works ...
1
vote
2answers
36 views

Short word after long word in narrow table cell

In a narrow raggedright table cell with a long word followed by a short word (for example "aaaaaaaaaaaaaa bbb"), if the first word is too wide and therefore hyphenated (using this solution), then the ...
0
votes
1answer
25 views

Conditional line break for better page break

Is there a way to insert a condition line break, in order to get better page breaks, i.e. less empty space on the pages? My concrete problem is: In my document I have some large figures, and thus ...
0
votes
0answers
12 views

How to make a non-indented, monospaced Chinese character layout

I want the text to be laid out exactly as it appears here in the monospaced code environment: \documentclass[a4paper,12pt]{article} \usepackage[left=0.7in,right=0.7in,top=0.7in,bottom=0.7in]{geometry}...
12
votes
1answer
898 views

How can I stop this useless empty line popping up in the middle of my lists?

My custom enumerateoptional enumitem environment is putting a useless empty line in the middle of my enumeration list. To reproduce this, you need to fill a line 100%. See this example I extracted ...
0
votes
0answers
15 views

Force line break on `\citep{}` inside `longtable` (XeLaTeX) [duplicate]

I am trying to create a quite long table that will also contain citations inside, but the \breakcites macro apparently does not work inside tabular environment. Placing \citep inside \makecell does ...
2
votes
1answer
26 views

Wrap text in the document inside custom command

I have created a custom command as follows: \newcommand{\projectSubheading}[3]{ % \vspace{-1pt} \item \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r} \textbf{#1} & #2 \\...
1
vote
1answer
43 views

Line break issues with \color command. pdflatex pdfcolorstack inserts boxes?

Coloring commands sometimes change how TeX breaks lines. Here's a minimal example: \documentclass{article} \begin{document} % Used to produce log statements below this snippet. \tracingparagraphs=1 ...
3
votes
0answers
55 views

How to split long C/C++ code line on two lines without inserting new line number?

I am using the following snippet to insert C/C++ code into my LaTeX document but the problem is that the code on one line is too long and it goes over the right side of the document page. How to split ...
1
vote
1answer
21 views

How to Remove `\marginparwidth` for Pages without Margin Notes?

In regular LaTeX, how could I remove the space reserved for sidenotes on pages that don't have any margin notes? Issue: Just trying to use the extra space if possible. I am trying to do this with ...
0
votes
1answer
62 views

Overflow the world in the my article

I have a problem with the overflow of the world, and example 1 2 3 For resolve this problem I found two solutions, they are: \newline rewrite the sentences with the new words to resolve the ...
0
votes
0answers
145 views

Newline after \hbox “Underfull \hbox (badness 10000) in paragraph”

This question has been aksed elsewhere , but it is not obvious from answers there how do I achieve one more empty line after \hfill i.e. something similar to this without a Warning: \underline{motto:}...
2
votes
1answer
64 views

How can I make text alternate color every line?

I'm not referring to tables, just normal paragraphs of text. I want, for example, every other line to be drawn in red, or otherwise highlighted. My use case is preparing exams for students with ...
4
votes
1answer
71 views

environment without line breaks

I already read How can I prevent breaks in a custom environment? but this somehow does not solve my problem. I want to define an environment that defines a heading and then there is one line of text ...
0
votes
0answers
22 views

How to linebreak and keep indentation? [duplicate]

While writing down an algorithm, I've come to the following construct: There are multiple for/if/while's before this one so it is quite indented. Example code: \usepackage{algpseudocode,algorithm,...
1
vote
1answer
29 views

LaTeX breaking line right before colon

This thread : Prevent line break before : describes exactly my issue today. Thus, I tried the solution that was given, ie I added this in my preamble : \usepackage{polyglossia} \setdefaultlanguage{...
3
votes
4answers
375 views

How do I automatically add linebreaks “\\” to the end of each row of a tabular environment?

\begin{center} \begin{tabular}{ |c|c|c| } \hline \multicolumn{3}{|c|}{\textbf{Cycle Number and Phase}} \\ \hline t & $ \phi $ & I \\ \hline ...
1
vote
1answer
29 views

How to make a title of two or more lines? (revisited) [duplicate]

This is a sequel to this post. There are three lines in the title, and an awkward gap between the first ('AAAA...') and second ('OF'). How to get rid of it? PS: I am showing the title THIRD, so I ...
0
votes
1answer
21 views

Link address on new line in bibliography

I have the following reference in my bibliography.db file: @misc{vespa_url, author = "{ESS}", howpublished = "\url{https://europeanspallationsource.se/instruments/vespa}", title = "Vespa ...
0
votes
0answers
21 views

Remove unwanted newline at start of section [duplicate]

In the code below there are two line breaks between "test" and the the text below it. How do you make there be just one? \documentclass[7pt]{article} \usepackage{multicol} \usepackage{lipsum} \begin{...
0
votes
0answers
36 views

Negative line break command

Is there a command for a "negative line break" or for deleting line breaks? Something like -\\ such that: some\\ -\\ \\ \\text would display the same as some\\ \\text
2
votes
2answers
72 views

Line breaks with left and right rules

Sometimes, not always, rules are -- like parentheses -- left and right. The previous sentence exemplifies this. In such cases, line breaks oughtn't to separate the left rule from the word to the ...
3
votes
1answer
109 views

`\uline` from `ulem` package won't break lines automatically when containing boolean expression

Here is the MWE: \documentclass{minimal} % \usepackage{lipsum} % \let\uline\underline \usepackage{ulem} \newif\ifanswer \newcommand{\showanswer}[0]{\answertrue} \newcommand{\hideanswer}[0]{\...
1
vote
2answers
58 views

autobreak formula but doesn't work

I have a long formula , I use autobreak as follows,but it doesn't work \begin{align} \begin{autobreak} {E_{{S_{t + 1}}}}\left[ {\left. {E\left[ {\left. {{G_{t + 1}}} \right|{S_t},{S_{t + 1}}} \right]}...
0
votes
1answer
25 views

The last vertical line is broken … How do I leave it as a single line?

I tried to make a representation of a list of data structure as in the example below. \documentclass[a4paper,12pt]{article} \usepackage[margin=3cm]{geometry} \usepackage{array} \usepackage[table]{...
0
votes
0answers
107 views

Unnumbered centered part: linebreak in table of contents

I am working on a XeLaTeX “book” document, which is separated in two unnumbered parts. These two parts need to be entitled according to a “Title / Subtitle” scheme, with a linebreak as a separator ...
-3
votes
1answer
153 views

How do I create a line break in display-mode equation material?

How do I make a new line in $\LaTeX$? $$2^2+2=6 3^2+3=12$$ returns $$2^2+2=6 3^2+3=12$$ which is wrong.
2
votes
1answer
65 views

Using the algorithmicx package If Then Else, when line is to long indentation breaks

Ignore the Spanish in the code. The problem is that I am getting the then clause of the nested if with the wrong indentation because of the line break. \documentclass[11pt, oneside]{article} \...
0
votes
1answer
35 views

Children misalignment in forest

Problem I am trying to draw a tree diagram with forest package. I have multiline children including the \texttt command and a one-line child with normal text. This results in a misalignment among the ...
0
votes
0answers
13 views

How to add new line/enter in csv s.t. automatic table generation contains the enter?

Given this code that automatically generates a table from a csv file, how can I ensure that an enter or new line is put into a cell in the table? \documentclass{standalone} \usepackage{csvsimple} \...