Questions tagged [line-breaking]

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

1
vote
1answer
24 views

Wrap Text in Table / Text Extends Past Page Margins

I would like to know who to wrap text in a table, and also to keep text from off the page of the document. Below is the code I have written so far. I am trying to wrap the text under 'Relevant ...
0
votes
1answer
33 views

How to calculate “badness” for ragged right margins?

In TeXbook (p.30) it is said: When \raggedright has been specified, badness reflects the amount of space at the right margin, instead of the spacing between words. That is, in ragged-right case, ...
2
votes
1answer
56 views

Squeeze paragraph such that lines have similar width

I would like to format a paragraph of text such that the width of the paragraph shrinks until the last line in the paragraph is about the same width as all the others. Here is an example of what I ...
2
votes
1answer
22 views

Underful \hbox in template

I like to use this template:https://www.latextemplates.com/template/journal-article I am using it in Overleaf and it compiles however I am shown in the logs that the \hboxes seem to be underfull? ...
0
votes
1answer
19 views

longtable: won't linebreak while underlined or bold + multirow doesn't center vertically next to a figure

I am trying to create a landscaped longtable: there should be 2 rows with one containing a headline and the other an image, while a multirow is vertically centered next to the image and it's headline. ...
2
votes
2answers
92 views

How to get the same output as in TUGBoat article “Tracing paragraphs”?

Recently I began to read a very interesting TUGBoat article "Tracing paragraphs" by Udo Wermuth. There is the example-1 from the article (with header and footer added by logic considerations): \...
1
vote
0answers
32 views

Why adding \hsize0pt creates extra line?

Consider the following test: \showboxbreadth=\maxdimen \setbox0=\vbox{\hfuzz10000pt \hskip0pt a-b} \showbox0 \setbox0=\vbox{\hsize0pt \hfuzz10000pt \hskip0pt a-b} \showbox0 \end The first \showbox ...
-1
votes
1answer
57 views

Spacing of \newline and \\

Is there a way to set the spacing of the commands of \newline and \\ for the whole document? (I am aware that I shouldn't use them, unless it is really necessary.)
1
vote
1answer
50 views

Overfull message not yet clarified

I have found a shift in the left margin of my document signalled by the error message Overfull \hbox (12.87598pt too wide) in paragraph at lines 56--57 The following is an extract from my document: ...
0
votes
0answers
30 views

Start line with `\eqref`

My collaborator highlighted all lines starting with an eqref and asked me to avoid this by placing a ~ between the reference and the preceding word. For example, he suggested replacing it follows from ...
0
votes
0answers
22 views

Inline DeclareTotalTCBox Using tColorBox

My goal is to have inline code embedded in text using \DeclareTotalTCBox. The problem is that the box is not breakable (even though I used the breakable option). I looked at the manual (v 4.20) page ...
3
votes
3answers
49 views

How to enable in-word breaking without a hyphen? [duplicate]

Consider the following ridiculous example: \documentclass{article} \begin{document} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \end{...
0
votes
1answer
18 views

Multicol doesn't break formulas

When trying to create a 3-column document (with tight-spaced page paddings), the text is in place, however, the formulas are not adapted to the column width: \documentclass[12pt,a4paper,landscape]{...
5
votes
2answers
354 views

Geometry affects line breaking

This one has me stumped. The idea is to pack boxes (in this case, \rule) together tightly while allowing them to break at the end of a line. It works without geometry, but not with. Another package ...
2
votes
1answer
22 views

How to hyphenate in a \synt{} with the syntax package?

Consider the following example: \documentclass[draft]{article} \usepackage{syntax} \begin{document} blah blah blah blah blah blah blah blah blah blah blah blah blah \synt{blahblah-blahblah} blah. ...
0
votes
0answers
14 views

\right not working in beamer [duplicate]

\documentclass{beamer} \usepackage{graphics} \mode<presentation> { \usepackage{breqn} \usetheme{Frankfurt} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \begin{align*} ...
2
votes
2answers
30 views

text not aligned on the right in article

I'm writing in article mode and some lines in certain paragraphs stick out on the right. I read online that LaTeX by default aligns text on both left and right - but it doesn't seem to be the case? ...
2
votes
2answers
47 views

Drawing a horizontal \rule through the middle of a line

How can I do something like \noindent\rule{\linewidth}{0.25mm} but in a way that doesn't leave a big gap before it? Currently it's kind of like \bottomrule, almost as if it skips a line. I want it to ...
2
votes
1answer
25 views

Can I teach \censor to break on lines?

This is similar to Censor text spanning multiple lines, but I'd like to keep using the censor package if possible. Its \StopCensoring/ \RestartCensoring macros and actual style of censoring (big ole' ...
0
votes
1answer
41 views

Tikz \foreach to work with the aligned environment

I am trying to use the \foreach command to create something with the same effect as: \begin{align*} 1 \\ 2 \end{align*} The following code fails to work: \begin{align*} \foreach \x in {1,2} ...
0
votes
1answer
40 views

CV with timeline

Here you can find a latex template for Cvs. https://www.overleaf.com/articles/satish-kumars-cv/dngwrghdxxqh. I am facing an issue with the timeline environment. The code follows: \newcounter{...
0
votes
1answer
34 views

How to make word breaking work, and have a straight line on the right?

I am new to Latex, I apologize for the very basic question in advance. I just cannot make Latex breake the words correctly, or adjust the spacement of words properly so that I have a straight line at ...
3
votes
2answers
277 views

Break long word (not long text!) in longtable cell

How to break VERY long word in latex? For example: \begin{center} \begin{longtable}{|p{8cm}|p{3cm}|p{3cm}|p{3cm}|} \hline 1 & 2 & 3 \\ \hline ...
2
votes
1answer
26 views

Line break in starred ntheorem header

I came across this question that was posted before and have been using the solution for a while. However, I can't seem to get the same thing to work with starred environments. I am aware that long ...
0
votes
0answers
44 views

Bibliography is out of the border

I have one reference with long url. It goes from abroad. The bibliography style is IEEEtran. This is the code for it \bibliographystyle{./IEEEtran} \bibliography{./IEEEabrv,./IEEEexample} ... @...
2
votes
3answers
49 views

Linebreak in multicolumn cell using tabularx environment

I have the following sidewaystable, in which the headers and the last cell need to be across two columns with line breaks, else the table is not readable. The "specs" columns are just necessary in the ...
1
vote
1answer
31 views

Ligatures and line breaks in OT2

I am trying to write a paper in Cyrillic using OT2, but the ligatures (nj-њ, lj-љ, dj-ђ) get broken in line breaks. Here's an example: \documentclass{memoir} \usepackage[utf8]{inputenc} \usepackage[...
0
votes
0answers
8 views

Purpose of the optional argument of \linebreak[] [duplicate]

What is the purpose of the optional argument of \linebreak? What is the difference between \linebreak and \linebreak[1]? MWE: \documentclass{article} \begin{document} test\linebreak test test\...
1
vote
2answers
50 views

How to influence line breaks in lstlistings?

Latex breaks lines at odd positions in code listings, for example, before a comma or after opening quotation marks. Is there any way to influence the line breaking strategy or to suggest where a line ...
0
votes
0answers
27 views

How to put texts on a newline in an algorithm (in a nested for-loop)?

I am making an algorithm with a nested for loop, and there are multiple in the loop. They are presented on the same line, but I want them to start on a newline. Any ideas how I can do this? This is ...
0
votes
1answer
62 views

Line Break in \url in the footnote

There are many Posts about this Topic URL linebreak in footnote Line breaking of URLs at "-" I tried it by myself but it doesn't work oon my Tex-File. I added this in my Code for the url-...
0
votes
1answer
19 views

Avoid breaking inline math insertions [duplicate]

It is not a good idea to break mathematical insertions in text. It happens in this example: \documentclass{report} \begin{document} dfasfsd asdfsdafds asdfsdfds gdsds sfsdd ssfsd wwer sfdsf ggfh dh ...
3
votes
3answers
38 views

How to stack frameboxes one next to another filling all available horizontal space

I'm writting a "cheat sheet" where I put a bunch of formulas and ideas inside frameboxes, stacked one after another. The issue is that paragraph indentation, the framebox separator and the framebox ...
1
vote
2answers
42 views

Beamer: Onslides messes up tcbraster

I have issues with my beamer presentation: I want to have 3 boxes next to each other, they should first appear all at the same time and then I would specify when the boxes should appear. Without \...
0
votes
1answer
43 views

newline begins with dash

Consider this example: \documentclass{report} %\hyphenation{ENCODE} \begin{document} All data used for this study are analysed with a different release of ENCODE \textendash\ the collection of ...
0
votes
1answer
39 views

Break line of long header with pagestyle fancy

I have a class where I define headers and footers with a makemargins command: \newcommand{\makemargins}{ \makenomenclature \pagestyle{fancy} \fancyheadoffset{1cm} \setlength{\headheight}{2cm} \lhead{\...
0
votes
1answer
30 views

protect hyphenated word from breaking

Consider this example: \documentclass{report} \begin{document} bbbb bbbb bbbb ddf hdfhdf hdfhfd hdfhdf ddfgdfg dgdfg ert we Cabibbo-Kobayashi-Maskawa matrix is equal to 1 \end{document} The output ...
6
votes
1answer
99 views

Dropping separator at line break in an inline list

I have created a new inline list style with enumitem that has no bullets and separates each item with a middle dot: \documentclass{article} \newcommand{\middot}{~\textperiodcentered~} \usepackage[...
2
votes
1answer
30 views

Allow words containing forwards slashes to be broken over lines at the point where the forward slash occurs

Does anyone know how to use the hyphenat package in pdflatex to create an automatic hyphenation rule whereby forwards slashes may be used to break words over lines, or as hyphenation points? I've read ...
2
votes
1answer
47 views

how do i get an empty line in my flashcard

\documentclass[frontgrid,backgrid,a4paper,11pt]{flacards} \usepackage{etoolbox}<br> \pretocmd{\card}{\def\curhint{#1}}{}{}<br> \pagesetup{2}{4} \usepackage{xeCJK}<br> % \...
1
vote
1answer
43 views

How to retain actual input newline/end-of-line (hex 0x0a) in macro definition

I am using filecontents package and want to include it in a macro in order to factorize some complex processing. The problem is that \begin{filecontents} needs be followed by nothing except spaces and ...
1
vote
2answers
49 views

How can I hyphenate words with dots in a \texttt environment in LaTeX?

There is a bunch of discussions online how to enable (or disable) hyphenation in \texttt environments. I found both the options \usepackage[htt]{hyphenat} and \DeclareTextFontCommand{\mytexttt}{\...
2
votes
1answer
37 views

Do line breaks help synctex at indexing?

Do line breaks help synctex? Does it for example help to add hard line breaks after 80 characters instead of writing a paragraph per line?
1
vote
0answers
31 views

Get little endian paragraph title shape

As you can see in the MWE, I customize the chapter titles to be displayed in the center of the page with: \usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\huge\bfseries\centering}{\...
0
votes
1answer
140 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
44 views

Problem with Big Curly Brackets in Overleaf

I am trying to make open a big curly bracket with 3 rows and 2 columns in it. This will be used in a Conference Paper that has 2 columns per page, so logically the wideness of each column is ...
0
votes
0answers
46 views

New lines after \ in lstlisting

I have very simple bash listing \begin{lstlisting} $ docker create --name my-nginx \ --network host \ --publish 8080:80 \ nginx:latest \end{lstlisting} It looks fine in PDF, but once I try to ...
0
votes
0answers
18 views

How to break the lines within the list of figures - endfloat package

I am using the package endfloat to provide the tables, the figures and the list of figures at the end of my document. Unfortunately, the figures' captions are longer that just one line, but the ...
0
votes
1answer
141 views

Figure captions line breaks

So I'm working on a TeX document and everything's fine until at some point I realize the captions are doing something weird: whenever the caption spans over multiple lines the new lines start after ...
0
votes
1answer
32 views

Unwanted Line Break after product symbol

I wrote an equation with 3 products involved and it doesn't seem that they want to be written in one line (pic related). My code looks like this: \begin{center} $\psi$ = $$\prod_{i=1}^{x}$$ $\...