Questions tagged [line-breaking]
{line-breaking} is about how (La)TeX breaks paragraphs into lines and how those breaks can be influenced.
2,445
questions
0
votes
1answer
15 views
Break line after item label in list but NOT if it fills line?
I've seen the question (and this one) explaining how to break the line after the list label but sometimes I have labels for my items that fill the whole line in which case I don't want to create an ...
13
votes
3answers
3k views
Optional but encouraged line break + \hfill
How would I write a macro (to be placed immediately before every URL in a bibliography) whose effect is to tell TeX
This is a good place to insert a line break, but breaking the line here is not ...
0
votes
1answer
52 views
Automatic line breaks in tables
I have tried a few different solutions for automatic line breaks within tables in LaTeX. Below is an example of a tabular list using my most elaborate method so far. It looks alright in PDF, but it ...
1
vote
1answer
21 views
Chart Label in two lines
I created the chart below and would like to change the ylabel "Fusionierte Theater" two have each word in one line. Is that possible? I would also like to get "Anstalt" "...
0
votes
1answer
26 views
Biblatex creates big linebreaks if Reference Entry fills whole line
I use biblatex to cite my references. Printing my bibliography works almost as expected. If the entry's last character (in my case a dot) is at the end of a line, a big line break occurs. So a big gap ...
0
votes
3answers
23 views
Line break of table notes after first column in a long table
I am creating a long table using xltabular in landscape format using landscape. I add table notes using the tablenotes environment:
\begin{landscape}
\begin{xltabular}[l]{X X X X}
...
1
vote
1answer
23 views
lstlisting: Unexpected newline/missing background color after trailing space in escape section
I'll start with a minimum failing example:
\documentclass{article}
\usepackage{listings}
\usepackage{color}
\lstdefinelanguage{x}{
escapechar={!}
}
\lstset{language=x,
breaklines=true,
...
1
vote
1answer
41 views
Caption width in xltabular environment
I am creating a Table as follows:
\usepackage{xltabular}
\begin{document}
\begin{xltabular}[l]{\textwidth}{X | X | X | X}
\caption{Here is a long text that does not break and exceeds the page ...
9
votes
2answers
2k views
line break aware custom environment
I have a use-case where I would like to specify some special formatting for the text being input via the \input command. This text is customer's address being printed in some sort of a form. Ideally ...
0
votes
0answers
23 views
Problems with \\ in XeLaTeX when using Mac
I currently faced a problem with a XeTeX file I wrote using Windows 10 when I tried compiling it with MacOS Sierra 10.12.6. I had a .cls file containing following code snippet:
...
\newcommand{\cover}[...
0
votes
1answer
48 views
New line (not new paragraph)
I could not find a (no verbose) solution to differentiate new line from new paragraph.
As far as I know, \\ and \newline both insert a new line. But the first one is often not recommended.
A space ...
2
votes
1answer
24 views
Fixed-width space in math mode that is gobbled at the end of a line
Consider the following example:
\documentclass{article}
\newcommand{\myspace}{\hspace{3em}}
\newcommand{\mycmd}{left\myspace right}
\begin{document}
1:
Lorem ipsum dolor sit amet, consectetur ...
0
votes
0answers
37 views
How to properly left-right justify text
As you can see in the image below some of text falls into the margin for some reason i am using \RequirePackage[none]{hyphenat} this package to prevent hyphenation and i assume this must be causing ...
0
votes
1answer
12 views
How to use \lIf and \lFor in one line for algorithm2e?
I'm using algorithm2e and am familiar with \lIf and \lFor to have no extra lines. But when I use both of them together, an extra blank line gets inserted. Is there a way to avoid that line? MWE ...
0
votes
1answer
41 views
Trying to go to next line in an entry in a cell
I've recently decided to use latex to make my CV. I've therefore used an overleaf template:
https://www.overleaf.com/latex/templates/modernfancycv/bkjntytgpcmq
The last thing I want to do now is to ...
2
votes
0answers
58 views
luaoftload v3.17 with HarfBuzz does awful line breaking with Garamond
I have this long document which I've been maintaining for years now, which I use Adobe's Garamond Premier Pro font for typesetting, and the whole document is fine-tuned to avoid overfull boxes and ...
0
votes
1answer
248 views
How to display JavaScript and HTML code in latex
I am trying to insert sections of HTML and JavaScript code in my latex document in overleaf but the lstlisting does not work as my code spans longer than the page width. I have tried various different ...
0
votes
2answers
43 views
word not getting broken to new line
In the first paragraph of the following document, the word mathematical is not getting broken across lines and this produces a misalignment with a wrong justification of the text. I know I can force ...
1
vote
0answers
25 views
Need an alternative for \usepackage[none]hyphenat
I have a problem. When i want to use hyphenat package, the breaklines=true on mmacells package will not working. But it will work if i delete the hyphenat package. And i don't want to delete my ...
1
vote
3answers
22 views
split argument of newcommand that goes into a multicolumn element across multiple lines
I have modified the following function coming from a CV template:
\newcommand{\ressubheading}[4]{
\begin{tabularx}{6in}{l@{\cftdotfill{\cftsecdotsep}\extracolsep{\fill}}r}
\textbf{#1} & #2 ...
2
votes
2answers
59 views
How to align displayed, multi-line computations
I work in a field of mathematics where long, multi-line computations are bread and butter, and I mostly use align* (and its siblings) from the amsmath package to display them. However, I have not ...
1
vote
1answer
63 views
Fixing hbox overflow by breaking \href?
Similar to the URL problem: Forcing linebreaks in \url and URL latex linebreak
My links do cause an hbox overflow.
However, I have an \href with a local link. Can I force line breaks at any char there,...
2
votes
1answer
56 views
Break lines in multicolumn in a table
In the following,
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{xcolor,colortbl}
%\usepackage{wasysym}
\usepackage{...
16
votes
4answers
7k 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
...
0
votes
3answers
29 views
Line break text in \text{} in math mode without splitting math formula
I wrote the following equation with text inside:
\begin{equation*}
\text{$\Gamma$ schedulabile con RM in presenza di preemption} \quad \Leftrightarrow \quad \sum_{i = 1}^{n} \frac{C_i}{T_i} \leq n \, \...
1
vote
1answer
289 views
Overleaf editor automatically inserts an inconvenient line break in the middle of a word or sentence after apostrophes and accents
I have a problem which I believe to be linked to the Overleaf editor. I am writing a document in book format, in French. As I usually write articles in English, I copy here the beginning of the ...
20
votes
4answers
10k views
Line break in texttt
I would like latex to break long text inside \texttt{} that does not contain any whitespaces.
Currently the text just runs off the page.
The latex document is generated from a reStructureText ...
1
vote
1answer
26 views
Combining Wrapping \texttt{} with Sections and TOC - Improper alphabetic constant
Was working on getting line wrapping working for code, and came across a solution which was working for me - until I tried to add a table of contents to my code. The issue seems to be with using the ...
34
votes
9answers
24k views
paragraph style - how to force line break? \paragraph{} \\ - make paragraph a header?
I want to format paragraph to work as a regular title
\paragraph{title} text goes here
output of that is:
title text goes here
how can I change the output to force line break and use the usal ...
0
votes
1answer
49 views
Last Word not break avoid automatically
I have need to avoid last word break. It must print in PDF before the line or break with previous word.
My MWE IS:
\documentclass{book}
\doublehyphendemerits=100000
\frenchspacing
\usepackage{...
2
votes
1answer
73 views
Forbid latex to split a sentence with a float
My publisher recommends that my text is not split by floats. More precisely, a sentence should end before the float and a new sentence should start after the float. The float is allowed to be moved ...
1
vote
1answer
65 views
Break Line unless it is Empty
I'm trying to write a macro that finishes a group with a horizontal line. If the line is non-empty, it should add a line break and the horizontal line. If the line is empty, e.g. the group ended in an ...
3
votes
1answer
56 views
How can I break the text in one cell of system of equations?
I'm new to Latex and encountered this problem.
I need your help to write the equation in the picture but cannot break the line in the 2nd cell of the 2nd row.
Here is my code:
\begin{equation}
\...
1
vote
2answers
65 views
How to make Three figures in one horizontal Line in Latex?
I am trying to make these three figures in one horizontal line using overleaf latex but it is not giving me the desired results, here is the example code
\begin{figure*}[!t]
\centering
\subfigure[]...
3
votes
2answers
6k views
Linebreak in equations
I have a very simple LaTeX problem with the following LaTeX fragment:
The function computes:
\[
e \leftarrow (((x||a) + (y||b)) \oplus y,\\
r \leftarrow x + y
\]
The result should then be in two ...
19
votes
2answers
42k views
Theorem environment - line break after label [duplicate]
Possible Duplicate:
ntheorem environment with indentation
Skipping line after “Proof” in proof environment
\begin{theorem}[label]
The theorem text.
\end{theorem}
I want to have ...
0
votes
0answers
14 views
Why using X in tabularx inserts new line [duplicate]
Why newline is inserted in the first row and why \noindent fixes it in the second row?
\documentclass{book}
\usepackage{colortbl}
\usepackage{tabularx}
\usepackage{xcolor}
\begin{document}
\...
3
votes
1answer
57 views
Why does this DOI end up on a new line when there is lots and lots of room left?
So, David's answer appeared to work for a long time, but recently I found some citations, such as the top one here, the DOI move to the next line, despite lots and lots of room left.
Example:
\...
0
votes
1answer
41 views
newline with `\\` does not work
to compile Tex, I use latex/pdftex version of LaTex. Here are some details
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
...
14
votes
1answer
549 views
Macro to capture until end-of-line as argument
Is it possible to capture the contents to the end-of-line as a macro argument?
For example, consider the following naive visualization:
\documentclass{article}
\newenvironment{myitemize}
{\def\...
2
votes
1answer
74 views
Why is line breaking output with STEP different in pdfTeX vs. XeTeX/LuaTeX?
\documentclass[12pt]{article}
\usepackage[LY1]{fontenc}\usepackage[]{step}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}
This gives different placement depending on engine, for some ...
0
votes
1answer
62 views
List of Terms/Definitions Text off Page
new to TeX...Most of my document was provided to me as a template but there's something I can't get correct. Trying to make a list of definitions / terms, and on each line it should be like this:
...
0
votes
1answer
37 views
\lstset does not respect line breaks and indents with Cyrillic symbols
I'm trying to output some code along with translated comments but the listing does not respect indentation and line breaks if first symbol in a line is Cyrillic:
\documentclass{book}
\usepackage{...
0
votes
1answer
44 views
Line breaks for items while wrapping images with a list
I am trying to create a list with figure on the right side in beamer but the sentence breaks at unusual places.
\begin{frame}{Protocol}
\begin{wrapfigure}{R}{0.2\textwidth}
...
13
votes
3answers
1k views
Avoid Three Consecutive Hyphens
I need to suppress occurrences of 3 consecutive lines of text that end in hyphenated words. How to solve this?
My LaTeX Source Code is:
\documentclass{book}
\usepackage{luacode}
\begin{document}
\...
39
votes
8answers
52k views
How to allow line break in a long hyperlink in a PDF compiled by latex-dvips-ps2pdf?
I am using latex-dvips-ps2pdf steps with -Ppdf option passed to dvips. The following code snippet
\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage{breakurl}
\hypersetup{...
0
votes
0answers
334 views
Underfull \hbox (badness 10000) in paragraph in bbl bibliography
Just after the word resonance it is getting the above error. underfull. I have tried using \smallskip \bigskip but it does not work. In texstudio the author name until the word resonance in one line. ...
1
vote
1answer
24 views
How to break long citations on a multirow tabular environment?
so I have the following table which I intend to show a summary of some research papers:
\documentclass[qualidr]{ppgco}
%Não altere o comando seguinte. O título de seu trabalho será especificado mais ...
2
votes
1answer
58 views
How to avoid a word to break in the last line of a paragraph [duplicate]
is any penalty value available to avoid a word break in a last line of a paragraph like below?
0
votes
2answers
34 views
Enumeration and line break tabularx
I try to do an enumeration / line break in my chart but I am not able to do it. Could you help me to find the right tool?
For the row Advantages I try to get
no genomic integration (no frameshift, or ...