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
5 votes
2 answers
320 views

Why isn't every space between words a feasible breakpoint?

p98 of the TeXbook gives a paragraph trace beginning: []\tenrm Mr. Drofnats---or ‘‘R. J.,’’ as he pre- @\discretionary via @@0 b=0 p=50 d=2600 @@1: line 1.2- t=2600 -> @@0 ferred to be called---was ...
user avatar
1 vote
0 answers
31 views

How do I break the text in a table-cell? [duplicate]

I am using Tufte book. For the table below, I want to add a line break in the first column. I want "Nr. of transactions" to be in one line and "pre-processing" on the second line. ...
user avatar
  • 25
1 vote
2 answers
80 views

Split a huge matrix across lines to fit on page

I'm writing my thesis and running into the following problem. I have a huge matrix (10 rows and 15 columns) which doesn't fit on a page. I would like LaTeX to split the matrix across lines, but right ...
user avatar
  • 61
1 vote
1 answer
36 views

Automatic line breaking of boxes

I want to automate some things in LaTeX using loops and saveboxes, but the boxes don't want to go automatically to the next line when there is no space for them (saveboxes are necessary). The code ...
user avatar
0 votes
1 answer
32 views

Indentation in Beamer Frametitle [duplicate]

I'm coming here looking for help because I've tried in every way to correct the error in the attached figure. When dealing with a long title, the second line suffers an unnecessary indentation. I ...
user avatar
3 votes
2 answers
386 views

Why does LaTeX neither break at nor hyphenate after a "user kern"?

When using the \kern command for user-defined kerns or the \, shorthand for small non-breaking spaces, this expands to a "userkern" node. At such nodes LaTeX doesn't break the line and the ...
user avatar
  • 371
0 votes
0 answers
45 views

Specifying a Second Line Indentation When addtocontents Entries are Long

This post asks a more general question than Formatting the Display of Multi-Lined addtocontents Entries. Consider: \documentclass{book} \begin{document} \Large \addtocontents{toc}{\protect {\textbf{I....
user avatar
1 vote
0 answers
42 views

Formatting the Display of Multi-Lined addtocontents Entries

In the following MWE \documentclass{book} \begin{document}\large \addtocontents{toc}{\vskip 10pt} \addtocontents{toc}{\protect {III. The words of this sentence are quite a few; I would like the ...
user avatar
0 votes
1 answer
44 views

Using seqsplit and truncate together

I have a table in tabularx, and I need to put an url into one of the columns. The best and probably easiest solution for me would be to use: \truncate{200pt}{url} from the truncate package, which ...
user avatar
  • 1
0 votes
0 answers
33 views

Quotation marks jump in next line

I'm writing a text and I'm using quotation marks as follows: We will do as in the work $\glqq$ some text$\grqq$. Now "$\grqq$" is jumping to the next line. Can I avoid this somehow? Thanks!
user avatar
  • 135
2 votes
1 answer
40 views

Beamer: extra blank line between display math and enumerate

I use the beamer class. If display math followed by some enumerate environment, beamer will insert an extra blank line between them. The following is the codes. \documentclass{beamer} \begin{document} ...
user avatar
  • 395
0 votes
0 answers
55 views

LaTeX sporadically replaces dashes with $\Gamma$ when making linebreaks

I'm working on a large report and have noticed that the output pdf often contains $\Gamma$ at the end of lines, when there should be `-' instead. However this is not consistently the case, as you can ...
user avatar
2 votes
1 answer
25 views

line height varies with wrapping text

I was trying to create a new title page for uni project. For that I took an online template and changed the text. The problem now is, that the title wraps and has different line height in some lines. ...
user avatar
  • 123
0 votes
0 answers
44 views

How to force line break in normal paragraph

Sometimes the paragraph will not break properly with no blank codes. How to set break automatically? Here is example code: \documentclass{article} \begin{document} Like this, the code without ...
user avatar
0 votes
2 answers
49 views

How to break long text in black box in tcolorbox?

\documentclass{article} \usepackage[most]{tcolorbox} \tcbset{ boxsep=4pt, left=0pt,right=0pt,top=0pt,bottom=0pt, colframe=white,colback=black, highlight math style={enhanced} } \begin{...
user avatar
0 votes
1 answer
42 views

How to break words at the end of line in text and quotes

I would like LaTex to break words (where needed) at the end of a line - both in the main text and in quotes. Having gone through similar questions, it sounds like LaTex normally does this ...
user avatar
0 votes
0 answers
47 views

Markdown -> Latex -> PDF: md inline code snippets going out of page bounds

Problem I have a bunch of changelog.md files for our software that use backticks for inline code. I pull them as part of the documentation build process and compile a PDF with latex. Latex seems ...
user avatar
  • 75
1 vote
1 answer
52 views

Bug in Line Breaks?

A certain line I have written seems to never want to break on the pair of words "on groups", unless I forcibly add \linebreak. I demonstrate this in the following picture, which uses ~ to ...
user avatar
  • 1,147
1 vote
2 answers
39 views

Line-breaking with underscores in longtable

I have the following code: \begin{landscape} \setlength\tabcolsep{3pt} \begin{longtable}{m{0.5cm}|m{3cm}|m{3cm}|m{3cm}|m{9cm}} \hline \textbf{C1}&\textbf{Col2}&\textbf{Col3}&\textbf{Col4}&...
user avatar
  • 121
0 votes
0 answers
22 views

How do I stop latex from breaking up words at line breaks? [duplicate]

For example, latex breaks "signaling" into signal- ing at the line breaks, in order to keep the width of text uniform, I believe. How do I stop this and have complete words?
user avatar
0 votes
0 answers
24 views

What's the best way to deal with large pieces of text like keywords, camel cased words, namespaces, etc [duplicate]

I'm writing a text which has a lot of long Redis keys and camel cased text (like class names). This could be extended to long keywords and namespaces too. I want to accentuate these in way, so I'm ...
user avatar
  • 539
1 vote
3 answers
119 views

Line breaks in booktabs?

How do I fit such a table on a page (so that it's not too wide)? I guess I'd like to have a line break in the name of every column and also line breaks in each cell of the entire first column. How do ...
user avatar
1 vote
1 answer
58 views

LaTeX Demerit When One Line Ends With Comma and the Next Ends with Apostrophe

I know LaTeX has a demerit when two consecutive lines end in discretionary hyphens (\doublehyphendemerits), and I was wondering if there is a way to set a demerit or penalty for ending one line with a ...
user avatar
5 votes
3 answers
294 views

Displaying a Numbered Math Expression Without Creating a New Line

I want to display a numbered math expression without creating a new line. Example: \textbf{Claim}: \begin{equation}\label{fpreservesorder} m,n\in{}\mathbb{Z}\,\,\,\wedge{}\,\,\,...
user avatar
  • 205
1 vote
1 answer
41 views

Forcing a new line in math typing - LYX

When writing a long math sentence, the writing goes beyond the end of the page: When all I write in the file is: Is there an easy way to force a new line without actually go to a new line? Or a way ...
user avatar
0 votes
1 answer
17 views

Listing background color is overflowing margins on broken lines

I'm using the code on Listing, zebra effect and broken lines as a base. However, when lines are indented by either spaces or tabs the margins of the listing are not respected and the background color ...
user avatar
  • 51
5 votes
2 answers
146 views

How to suppress a new line when using multline within enumerate?

I am using enumerate with some long equations. I am breaking the equations into multiple lines using \multline. Example: \begin{enumerate} \item \begin{multline*} m_1,m_2>0\implies{}f(m_1+m_2)= \...
user avatar
  • 205
0 votes
1 answer
78 views

Text keeps compressing or expanding when splitting text with ```\\\\```

I highly doubt that this question hasn't been asked before, but I haven't managed to use the right search words to find it. In case it matters I'm writing in Overleaf and use \documentclass{article}. ...
user avatar
0 votes
0 answers
27 views

How to prevent longtable from tearing apart my text weirdly?

I have the problem, that as a german speaking person, words get rather long. Even with hyphenation tables usually gets torn apart. Is there an option to still have the automatic line-break options ...
user avatar
0 votes
1 answer
53 views

Breaking lines of TikZ pictures

Doing a lot of pictures sequentially with TikZ, I would like a break line behavior, resulting in more uniform lines. But I couldn't. \input{tikz} \def\maxangle{30} \pgfmathsetseed{7} \foreach \...
user avatar
2 votes
3 answers
150 views

Increasing the Gap Produced by \Linebreak within a Small Caps Title

Consider the following code: \documentclass{book} \usepackage{lipsum} \begin{document} \thispagestyle{empty} \large \begin{center} {\scshape{H O W \, T O \, I N C R E A S E \, T H E \, S P A C E\...
user avatar
  • 4,799
0 votes
1 answer
33 views

Linebreak spacing for saved string

I have a string called \subtitle, and that string comes up at multiple locations. This string contains a linebreak, so that it shows up better at the front page. I define this string in main.tex \...
user avatar
0 votes
1 answer
181 views

Skip line without commands in Latex

I would like to know if it is possible to change a line with just a normal skip with "enter" in latex. For example I want the document to recognize a normal line skip with enter as a new ...
user avatar
  • 1
2 votes
1 answer
54 views

What's the cleanest way to set \emergencystretch only for one list item?

Feeding pdflatex with \documentclass{article} \pagestyle{empty} \usepackage[USenglish,latin]{babel} \babelprovide[hyphenrules=nohyphenation]{latin} \usepackage{enumitem}%%% the same problem occurrs ...
user avatar
0 votes
0 answers
26 views

How to avoid runts? [duplicate]

Sometimes, a paragraph will end in a short word that appears all by itself on the last line. I believe that such words are called runts in typography. Other times, a longer word is broken and only one ...
user avatar
  • 271
2 votes
0 answers
34 views

Prevent line breaks before short math expressions globally

Is there a way to globally prevent line breaks before math expression that are a single letter ? For example, in a document I have \begin{lemma} An edge $\lambda_{xy}$ is identifiable in a tree graph $...
user avatar
  • 503
0 votes
0 answers
14 views

Square brackets throw an error while parentheses don't [duplicate]

Why does the following work \documentclass[answers]{exam} \begin{document} \begin{center} \Large\textbf{ \shortstack{ Assignment 1 \...
user avatar
  • 8,759
4 votes
1 answer
80 views

How to prevent word wrap and new lines in table cells?

I have a xltabular table which is filled via script with data, so I don't really know what length the text has that is put into the table cells. Is there a function or method which can just cut off ...
user avatar
  • 311
0 votes
0 answers
32 views

Changes package, no linebreak of long inline comment in other command

I am using changes package to detect the changes of the draft. However, if I put a long inline comment as an option for other commands like highlight or replaced, the linebreak does not occur. \...
user avatar
0 votes
1 answer
51 views

Justify long words

How can I justify text like this by for example automatic hyphenation? (which does not affect the rest of the text? If I use \linebreak it will go to the next line but not justify the prior text. I ...
user avatar
  • 121
1 vote
2 answers
37 views

Line not breaking when combining inline math and \texttt

Sadly, I am not able to recreate a MWE since I'm working on a fairly complex template. I cannot understand how LaTeX decides to break lines, I googled but I couldn't find a clear cut answer. This is ...
user avatar
0 votes
0 answers
23 views

Very long string is getting overflown in the pdf

I am very new to latex/ .tex files. Need some help here please. I am creating a PDF file with some information and in the end of the file there is a placeholder called signature. Signature is a very ...
user avatar
0 votes
1 answer
46 views

\par within \addcontentsline breaks list of frames

This answer provides the indispensable feature to add a list of frames to a beamer presentation. It containts the the line \addcontentsline{lbf}{section}{\protect\makebox[2em][l]{% \protect\...
user avatar
0 votes
0 answers
92 views

Pandoc / Eisvogel template : code blocks in MarkDown with very long lines get cut off when outputting to PDF

here is my problem : I have this code in a code block in my markdown file : $ ./test ...
user avatar
  • 1
1 vote
3 answers
48 views

How to add a newline inside \overset?

Example: $abc \overset{a=1,b=2,c=3}{=} c!$ I'm trying to figure out how to add newlines instead of commas between a=1 and b=2 and b=2 and c=3.
user avatar
  • 437
0 votes
0 answers
34 views

How to determine vertical position of paragraph

I'd like to determine approximately how far down the page TeX's paragraph builder (i.e., tex.linebreak(...) in LuaTex) is when it starts. For example, in \begin{document}A\par B\end{document} when the ...
user avatar
  • 985
0 votes
2 answers
66 views

How to underline text from a macro including a line break?

I'm trying to underline text that spans over more than one line. In principle, the ulem oder the soul package can do the trick when inputting the text directly to the respective command. \ul{some text ...
user avatar
  • 15
0 votes
1 answer
35 views

Auto-replacing words with shorter variants to prevent hanging words

Is there a way to tell latex that certain words can be replaced by a shorter variant if it will prevent a hanging word: eg: this line wraps to a second line. change "second" to "2nd&...
user avatar
  • 103
3 votes
1 answer
87 views

Move whole inline math to new line if it is too long

I have big tex document that was created for a4 paper, I wanted to change a4 to a5. After doing so, latex rendered some inline math in kinda awkward way: Something something x + y + z = f(x). I would ...
user avatar
  • 77
3 votes
1 answer
67 views

Unexpected line break before makebox with expl3 syntax

I want to type some texts as the following. some text:____underline_text_______ I hope the total length of the above texts could be some given length. The length of the underline part depends on the ...
user avatar
  • 395

1
2 3 4 5
53