Questions tagged [line-breaking]
{line-breaking} is about how (La)TeX breaks paragraphs into lines and how those breaks can be influenced.
2,621
questions
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&...
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 ...
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 ...
1
vote
1
answer
38
views
Preserving line breaks and paragraph ends when pasting to LyX
When pasting (Ctrl+V) text in LyX all line endings are removed.
When pasting as special text (Ctrl+Shift+V) all line endings are replace by paragraph ends. I have text that has both paragraphs and ...
1
vote
1
answer
29
views
Place two images next to each other within a given class
For a paper, I am using the following class:
\documentclass[utf8]{frontiersSCNS}
Within this class, I would like to place two images next to each other. None of these answers work for me.
The code ...
0
votes
1
answer
34
views
Wrap lstlisting in minipage and start on new line
I don't want page-breaks inside my listings, so using \lstnewenvironment I wrap my listings inside a minipage.
\documentclass{article}
\usepackage{listings}
\lstnewenvironment{snippet}[1][]{%
\...
1
vote
1
answer
39
views
How to add a line break in a tabularx cell with \addlinespace
Im trying to create a simple table using tabularx. I would like to distanciate the lines in the right cell. I've written the code below that seems to work properly (in the sense I've the expected ...
1
vote
2
answers
48
views
Force sentence to start at next page if content also starts at new page
For my homework, I use this enviroment:
\newcounter{exercise}
\renewcommand{\theexercise}{\arabic{exercise}}
\newenvironment{exercise}[1]
{\smallskip\refstepcounter{exercise}\textbf{Solution to ...
1
vote
1
answer
42
views
Formatting long Relational Algebraic expressions
I have the following in LaTeX
\begin{multline*}
\Pi_{SNAME}(\sigma_{(COLOUR = 'SCREW' \wedge STATUS > 20 \wedge SUPPLIERNUM = SNUM \wedge PARTNUM = PNUM)}\\ ((\rho (SNUM, SUPPLIERNUM) (SUPPLIER)) \...
1
vote
0
answers
50
views
Avoid linebreak in natbib citation [closed]
Using natbib I get a linebreak and one parenthesis stays on the upper line. I am using the
\cite{} command.
Can I change this so that (2014) stays together on one line?
\RequirePackage[sort&...
0
votes
0
answers
31
views
A modification in an environment
I wanna type some lengthy formulae. It's clear that using align would be a good option. When latex complies with a lengthy formula, it puts all of the equations on a page. Since there are some texts ...
1
vote
1
answer
84
views
Change line number only after \; in algorithm2e
How can I have the regular behaviour of some paragraphs placed together, without changing line number in the algorithm after one paragraph ends?
I want that line number changes only after a \; appears ...
2
votes
1
answer
69
views
Is there a better way to force a bit of whitespace on the last line of a paragraph?
I'm new to latex (XeTeX). My justified, 5-mm indented text is long; and at several places, the last line of a paragraph flushes completely right—creating possible irritation for the reader. To fix ...
2
votes
1
answer
83
views
Automatic text wrapping in Tikz bar charts?
I am trying to get multiple bar charts (4 per page) in a LaTeX document. The issue is with the title and label text of some charts. It's showing results of a survey, some questions had long text and ...
0
votes
1
answer
29
views
How to prevent completely empty rows when using \dotfill?
In the code below, I'm using multicol with longtable and it works quite good.
There is one thing I don't like: when a column has minimal overfill but the overfill is not problematic like the column ...
1
vote
3
answers
44
views
two-column flushed-right aligned-left text with linebreak
I want my text in title (executor and supervisor fields) to be flushed right and aligned left. Also I need to have line breaks in it. For now, I've made it using flushright, tabular and parbox
\...
0
votes
1
answer
31
views
Force line break on url in listings
I want to list some python code in a file, but I have the problem, that url's are not getting split properly, line break does not seem to work for them. Also, how can I remove the word 'file' from ...
6
votes
2
answers
160
views
Unexpected newline (catcode magic)
I am playing with Tex catcodes and hboxes. The following code should produce three lines of output:
A...1...
B...2...
C...3...
However, for some reason it makes a line break between A and ...1..., ...
3
votes
2
answers
86
views
Using \seqsplit with \input
Given a long line stored in an external file, I would like to \input it and then use \seqsplit to allow it to break as necessary.
a.txt:
...
1
vote
0
answers
27
views
Automatic text breaking in \text{} doesn't work. Neither do newline now breakline, text is written into boundaries
%%English is not my main language, this might be a german problem but google didn't help here.The text in \text{} in written into the set boundary.It doesn't break into a new line and just disappears. ...
1
vote
1
answer
47
views
Line break inside curly braces
I know it's rather a simple problem but i can't find solution to it. I want to put line break in this place:
\begin{center}
\begin{tabular}{l}
{\sc \Large
FIRST LINE HERE \\ SECOND LINE}
\par\vspace{...
0
votes
3
answers
57
views
How to place an optional break with second line flushed to right?
I wrote a table of the \advance operator.
If the line is too long, I want a break, and the second line flushed to right.
I tried to get inspiration from the macro \signed presented in the TeXbook, ...
0
votes
0
answers
50
views
How to remove extra space of one line
I am not much familiar with Latex, and I am struggling with one extra line that is left behind after the Project title, as shown in the figure after the Face Mask title.
How shall I get rid of it?
...
1
vote
1
answer
38
views
Sometimes wrapping is not working as expected
I am using TeXworks and the documentclass article but sometimes the word wrapping is not as expected.
How can I fix this?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\...
2
votes
1
answer
140
views
I want to write the institute name in two lines. However, when I try to use "\\", the whole alignment has been changed
I want to write the institute name in two lines. However, when I try to use "\\", the whole alignment has been changed.
I want to keep " Department of Computer Science" in first ...
1
vote
0
answers
56
views
Automatic line break in \mbox
I needed to define a macro with text in a \mbox-environment. However, now the text doesn't habe automatic line breaks in the mbox. Would there be some workaround such that the lines break for the text ...
4
votes
1
answer
71
views
Why text color affects the line breaking algorithm?
I have the following snippet,
% !TeX program = xelatex
% !TeX spellcheck = en_US
% !TeX encoding = UTF-8
\documentclass{book}
\usepackage{ctex}
\usepackage{xcolor}
\newcommand{\testtext}{補\sm{史記}的\...
2
votes
2
answers
43
views
Breaking lines/linebreaks in chemformula names
In the process of writing an inorganic nomenclature lecture, I would like to put centered multi-line text in the name function of chemformula.
As far as I've tried, creating a new line with \\ does ...
-2
votes
1
answer
42
views
Define text blocks on a static page
I am looking for a way to write own static pages with latex. For this I am mixing environments and commands. Right now I have a very easy Title page which is not working out really good.
It should ...
0
votes
2
answers
144
views
Is there a way have breakable framed boxes?
Here is a command I have:
\newcommand{\numbox}[2]{$^{\circled{#1}}${\fbox{#2}}}
What it does is boxing and numbering a text. However I for the box to break nicely across lines. In command \fbox{text} ...
0
votes
0
answers
15
views
How to modify plainnat.bst to force linebreak and make indentation within a reference?
I'm using natbib with an already slightly modified .bst file (so that authors' surname appears first followed by first name initials). Regarding the reference list, I'd like to do some further changes ...
0
votes
0
answers
57
views
Minted language "text" doesn't obey to breaklines
I'm trying to render code inline using minted.
Given that it can be any code, I'm using the text language.
However, I've realized it doesn't obey to line breaks, as other language do.
\documentclass[]{...
2
votes
2
answers
127
views
Automatic line-breaking in table with tabularx doesn't work
I followed this post to make the following code:
\begin{table}[h!]
\centering
\begin{tabularx}{\textwidth}{|c|c|c|c|c|c|}
\hline A & B & C & D & E & F \\ \hline ...
2
votes
1
answer
42
views
Line Break in Tikz Arrow Label
My goal is that, in the image shown below, that the label below appear on the line below above;, directly under above;. I've used \\ (and some other ideas) to try to achieve this (as shown in the ...
0
votes
3
answers
75
views
Combining obeylines and obeyspaces
The combination of \obeyspaces and \obeylines does not seem to work. In particular, spaces are not obeyed at the beginning of a line:
\documentclass{article}
\begin{document}
\obeyspaces
\begin{...
0
votes
1
answer
48
views
after \paragraph{} return to main text
I was wondering whether after a \paragraph{paragraph_title} environment I might return to the main text. If so, how can I properly do it in latex?
Example:
\section{Why does the Sun shine?}
main text
...
0
votes
0
answers
37
views
DNA sequence break line [duplicate]
I am writing the appendix of my dissertation. Here I have to put the looooong sequence of many DNA fragments. There are no empty spaces in a fragment, so Latex does not know how to break the lines. So ...
2
votes
1
answer
172
views
! LaTeX Error: Something's wrong--perhaps a missing \item. On table
when compiling it gave me this error:
! LaTeX Error: Something's wrong--perhaps a missing \item.
my code :
\scalebox{0.8}{\begin{table}[]
\begin{tabular}{|l|l|l|}
\hline
...
1
vote
1
answer
40
views
Line breaking for authors of a theorem
I want to cite a theorem of 7 authors. The theorem enivornment I use does not break lines, so the last name is way off the margin. Anyone knows how to deal with this?
Here is the beginning of the ...
2
votes
1
answer
34
views
How to get the first word after linebreak and change it if nessasry
I want to get the first word after automatic line break, then check it and change it when needed. This is needed in traditional Arabic Spelling for some words.
for example when foo comes after auto ...
1
vote
1
answer
48
views
Preventing a Verse Linebreak within a Multicolumn Environment
I am trying to include a stanza of poetry with a multicolumn environment such that there is no break in the lines of the poem.
I had hoped that
\settowidth{\versewidth}{}
\begin{verse}[\versewidth]
...
1
vote
1
answer
41
views
How to keep section numbering and title in same line?
I am working to modify this Latex template from stackexchange to use for my homework. Namely, the template currently splits the title of a subsection from its numbering, like so:
And, as mentioned in ...
0
votes
1
answer
49
views
(Done!) Chapter Uppercase | indentation in section numbering
I'm editing this book >>
https://www.overleaf.com/read/dntbyngmsfzs
and I'm having 3 problems:
The top summary I can't get down to 2.5 cm
The chapter is not capitalized (uppercase) and IS NOT ...
0
votes
1
answer
88
views
Non-breaking space not working in Overleaf
I am trying to insert a non-breaking space because one of the lines in my text ends with an a, namely introduces the problem and proposes ~a (cont. in the next line). However, the tilde operator does ...
0
votes
1
answer
51
views
How to break a line in text caption with Tikz package [duplicate]
I’m currently designing a chart using the following LaTeX structure:
\begin{center}
\begin{tikzpicture}
\draw (0,0) grid[xstep=20,ystep=1] (10.8,6);
\draw [line width=6mm, color=blue!50] plot [ycomb] ...
1
vote
1
answer
71
views
Table in two column - line breaking
I would like to have breaks in in that table. Could you please help me out?
\documentclass[11pt,twocolumn,conference]{IEEEtran}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage[latin9]{...
0
votes
0
answers
33
views
Add automatic word wrap in acronym package
I am using the acronym package and currently, I have the problem that one abbreviation goes too far over the right sight instead of a line break.
Is there a way to add a line break for the ...
4
votes
1
answer
183
views
Why an \hskip Command Following the Standard Linebreak Command \\ Does Not Work
Could someone explain why something like \\ \hskip 15pt would result in a linebreak with no indentation?
I know that one could use \par (seeting the indentation at 15pt), or even \vskip 0pt \hskip ...
1
vote
1
answer
49
views
Large space between texts after inserting a wrapfigure
I am currently having a problem with using latex, as when I insert a wrapfigure, some of my text gets extended. For example, it becomes like this:
How can I solve this problem?
Thank you!
Edit:
\[ x_{...
1
vote
0
answers
34
views
How to force a linebreak in a theorem title?
(This is a follow-up question to this one.)
Consider following code:
\documentclass{article}
\usepackage{amsmath}
\newtheorem{fruit}{Definition of a kind of fruit}
\begin{document}
Let's define ...