Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [line-breaking]

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

1
vote
2answers
47 views

Line break with longtable and multicolumn

I am trying to write up the following table. However, I cannot get a line break to work (needed for Branches and Results column's) and as such the table runs off the side of the page. My attempt is ...
4
votes
3answers
189 views

Auto line break with very long word within table

I am trying to break a very very long number, 128 in length, to fit into a table cell so it won't go over the page. I've looked up methods using longtabu, tabular with p{5cm} commend, \makecell, \...
0
votes
1answer
22 views

remove automatic spacing to fill row

I'm writing my thesis, but I have a problem that I can not solve. Latex when there are few words in a stripe, adds spaces to completely fill the line. How can I remove the spaces to fill the line? NB:...
0
votes
1answer
33 views

Section title running into margin

In the below MWE one can see that the section title runs into the margin of the page. This is due to the use of the \mbox{...}, but the \mbox is unfortunately in the normal case, automatically ...
1
vote
1answer
19 views

Word wrap 64 character hexadecimal strings in verbatim JSON

I'd like to document example requests/replies in our protocol per How to write narrative documentation. We're using the texlive-latex-base on Ubuntu for our documentation, and I'm linting with lacheck ...
7
votes
2answers
86 views

Problem with my understanding of expandafter and newcommand with arguments and sout

I've tried for days to get my head around the expansion of code. Sadly, I don't get it. I try to pass a command with arguments as an argument to sout. \documentclass{article} \usepackage{ulem,lipsum}...
3
votes
1answer
46 views

Line break without page break using `poetry` package

The poetry package overrides \\*, which means that I can't use that to prevent page breaks in the middle of a stanza. Is there another way to create a line break while forbidding a page break at the ...
1
vote
1answer
25 views

Editor breaks line within lstlisting

I'm using an editor that breaks lines after a line length of 80 characters. Whenever I use a long lstinline at the end of a line and the editor continues in a new line I get the error message Package ...
0
votes
0answers
25 views

New lines in hyperref argument

I was wondering if there is a way to make hyperref behave nicely when its argument spans more than one line. Here's a MWE of what I mean. \documentclass{memoir} \usepackage{amsmath, hyperref} \begin{...
2
votes
1answer
44 views

Line breaks in theorem heads are removed by showkeys package

There are a couple of other questions [1|2] about theorem heads not wrapping properly. I've run across another situation where this happens: \documentclass{article} \usepackage{amsthm} \usepackage{...
4
votes
1answer
43 views

Change default value of the optional argument of \\, also in tikz nodes

I use a lot of \\ in my beamer presentations to force line breaks at nice places, and more often than not, I use \\[5pt] instead of the default value (which feels too cramped). Some trial and error ...
0
votes
0answers
23 views

centering caption not working

I'm using this to insert a new line inside of my caption \caption[caption]{This is the caption\\\hspace{\textwidth}This is the second line} When I try to use the \captionsetup{justification=...
1
vote
1answer
36 views

The output of formulas in the latex format with two columns style

I am writing a paper for a springier journal. The latex style of this journal is based on the two columns format. I have some equations in my paper and I want to write these equations in paragraphs ...
1
vote
1answer
41 views

line break in subfigure caption with proper “hang” alignment

I want to insert a manual line break in the subfigures captions. I have achieved this with either \protect\\ or \newline. However, the second lines do not align properly. I want them to start at the ...
2
votes
1answer
20 views

Linebreak composed term with Registered sign and slash

Consider this example: \documentclass{scrreprt} \newcommand{\smlnk}{Simulink\textsuperscript{\textregistered}}% \newcommand{\mtlb}{MATLAB\textsuperscript{\textregistered}}% \newcommand{\...
1
vote
1answer
38 views

Is there a way to insert paragraph breaks inside of \texttt block?

The following source code compiles just fine: \documentclass{minimal} \begin{document} \texttt{ Lorem ipsum dolor sit amet Lorem Lorem } \end{document} However, the following ...
0
votes
1answer
20 views

Listings Package causes normal text to hyphenate at forward slashes

MWE: \documentclass{article} \usepackage{listings} \begin{document} IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII hardware/software \end{document} This results in this ...
0
votes
0answers
32 views

Overfull hbox within an R output

I'm using Sweave to work with R in a LaTeX document and when I compile my script I get the following badbox, as showed in the log file: Overfull \hbox (14.62822pt too wide) in paragraph at lines 127--...
0
votes
0answers
24 views

reledmac: skip newline in eledsection

I am trying to skip the newline in a \eledsection but both \usepackage{titlesec} \titleformat{\section}[runin]{}{}{}{}[] and \RedeclareSectionCommand[beforeskip=-.5\baselineskip,afterskip=-1em]{...
0
votes
1answer
43 views

How can we conditionally insert a line-break at the beginning of some text?

The Short Story If some text won't all fit on the current line, we want all of that text moved to the next line instead. How can we do this? The Medium-Length Story Suppose we have a string of text,...
1
vote
1answer
43 views

How sticky or non-sticky is \nolinebreak?

If you already know what sticky and non-sticky commands are, skip down to the header REAL QUESTION A sticky command remains in effect until you explicitly turn it off. For example, $ to enter math ...
2
votes
1answer
41 views

What can you pass as arguments to `\nolinebreak` and what affect do they have?

I would like to know what happens in terms of what the output document looks like. Some example strings would be nice, and a description of what happens to the string in the exported pdf. A ...
1
vote
3answers
54 views

Where can I find documentation for the \nolinebreak command?

Where can I find documentation on how to use the \nolinebreak command? The Guide to LaTeX2e for Authors at latex-project.org never makes mention of \nolinebreak The source code guide states that \...
1
vote
1answer
22 views

Line breaks not appearing in optimal location

For some reason, despite using the microtype package, I cannot fix some overfilling in a paragraph, as can be seen in the image below. I would prefer a line break immediately after the open bracket ...
5
votes
1answer
116 views

What is the cleanest way to ensure that a string all appears on the same line, unless it is too long?

In the following text we want all instances of "BACON" to appear on the same line. Lorem ipsum dolor sit amet, BACON BACON BACON BACON. Mauris sit amet laoreet ante. That is, we want to ...
0
votes
1answer
35 views

How to display horizontally aligned images with caption?

I'm looking for an advice how to display high amount of images horizontally aligned with caption: there are hundreds or even thousands images in the gallery dimensions of images are unknown, their ...
1
vote
1answer
39 views

~/cite : Is the Tie Actully Recommended? [duplicate]

When making citations, I've seen both styles: with the tie/non-breaking space (~\cite{refnm}) and without it (\cite{refnm}). There are a few questions & answers on this topic in the more general ...
3
votes
1answer
23 views

How to automatically leave lines for translation

I would like to enter a paragraph within a command and, each time it would go onto a new line, leave space and horizontal lines for translation. I can't for the life of me figure out how to do this ...
5
votes
3answers
101 views

'Uneven' breaks in long URLs (\url)

I'm struggling with hyphenation of long URLs (using command \url{}). Line breaking works fine in cases when URL is just part of line which doesn't fit to text area width. That means URL is hyphenated ...
1
vote
1answer
37 views

How do I get indentation after automatic line break?

Some lines are too long to fit in its column and gets split into two. But to make it clear that it still one line, like in a song, I'd to have an indentation after the automatic line break. \...
5
votes
3answers
89 views

Too long line in Bibliography, not URL, line break needed

I'm trying to solve this problem. The first reference has a strange "page number". Unfortunately, it protrudes beyond the edge of the page. I would rather have a page break happen before that. All ...
6
votes
2answers
222 views

Unwanted line break after beginning of solution environment in exam class

Question update: Ulrich's answer (and its iterations) largely achieves the desired behavior: An answer environment (ans is the answer environment in the new MWE provided below) where the end is ...
6
votes
2answers
174 views

BibLaTeX long URL extending into border despite using biburllcpenalty

MWE: test.tex: % !TeX program = xelatex \documentclass[paper=A4,fontsize=12pt]{scrartcl} \usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry} \usepackage{fontspec} \usepackage[backend=...
0
votes
2answers
55 views

I have an override for \texttt to prevent line breaks and add a box, but it still breaking up the word

I have the following override: % override the inline code styling to show a gray highlight box \let\oldTexttt\texttt \renewcommand{\texttt}[1]{% \begin{RaggedRight}% \sethlcolor{codegray}% \...
4
votes
2answers
74 views

Auto Detect Last Paragraph and Pass to Macro

The MWE below produces the desired results: via the \ProcessLastPara{} which applies a desired \parshape to the given (last) paragraph. Questions: The MWE below required me to manually identify ...
3
votes
1answer
33 views

Listings does not break at pure hyphen lines

I have the issue, that I need listings package to break at a hyphen (-). I will give a MWE below. According to https://tex.stackexchange.com/a/140725/7166 the hyphen is a character of type "other", ...
0
votes
1answer
30 views

Don't replace new line with space

Is there a way to prevent TeX from replacing new lines with spaces? This example text second example text results in this but what I want this Any help is greatly appreciated.
2
votes
0answers
73 views

Correct line breaking for Japanese using Babel

MWE \documentclass{article} \usepackage{xeCJK} \usepackage[japanese]{babel} \begin{document} \selectlanguage{japanese} 日本語をををををををををををををををををををををををををををかいぎょうします。 \end{document} In some ...
1
vote
2answers
41 views

Inline list: How to insert a non-stretching but line-breaking thin space?

This is a follow-up to How to insert a non-stretching but line-breaking thin space?, but in reference to an inline list. The MWE below attempts to use each of the solutions mentioned there, but the ...
5
votes
3answers
185 views

lettrines, explicit linebreaks and hanging indents

I need to combine lettrines, explicit linebreaks and hanging indents for whatever chunk of text ends up being longer than one typeset line. For the sake of semiautomatic text-production I'd very much ...
0
votes
2answers
96 views

Overfull hbox in a section title

Every now and then I get this error and I don't know how to solve it. From what I understand reading other posts, it's because LaTeX doesn't know how to hyphenate some sentences and finds no good way ...
2
votes
0answers
59 views

embrac package allows for line breaking immediately before closing parenthesis (closing parenthesis starts new line)

I have started using the embrac package and found that in some lines of my text the package allows for a line break between the last parenthetically enclosed character and the closing parenthesis; i.e....
1
vote
0answers
31 views

full justification not worked in tex studio [closed]

I want to write down this document in latex. It is a book type document. I am using this packages \documentclass[11pt]{book} \parindent0pt \parskip10pt \raggedright ...
1
vote
1answer
43 views

Custom line-breaks in minted environment

I'm using the minted package for my code listings. I'd like to customize the line-breaks instead of using the breaklines option that does the line-breaking automatically. Unfortunately I haven't found ...
2
votes
1answer
106 views

How to set hard line breaks in Texstudio

I am using Texstudio in Ubuntu 18.04 as a Latex editor. I need to set hard line breaks. Can't find any way. The main issue I'm having is that in my editor, I see the soft line breaks (i..e., a new ...
1
vote
1answer
34 views

Optimize space usage of paragraphs

I have sometimes encountered the problem in TeX, that a paragraph does not fit on one single page and is therefore splitted over two pages. This behavior makes of course sense. However, I noticed ...
4
votes
2answers
325 views

How to break the email-address in behind the @-symbol (scrlttr2)

I like to write a letter in latex, it all works fine so far, i just find that the sender information on the top rightis kind of "ugly". This results from the long email-address pushing the entire ...
1
vote
0answers
56 views

Insert LaTeX code at line break (follow up)

This is a follow-up question to David Carlisle's answer here (Insert LaTeX code at line break). In addition to glyph nodes, is there a way to insert (almost) arbitrary LaTeX commands with the help of ...
1
vote
1answer
18 views

Normal text should be separated from caption title

I need to know how normal text can be separated from caption title. \documentclass{article} \usepackage{amsmath,mathtools,amssymb,array,arydshln} \usepackage[german]{babel} \usepackage[latin1]{...
1
vote
1answer
19 views

Prevent line break caused by \part in article class

I'm trying to prevent the line break caused by the \part command. In a second step, I'd also like to get rid of the word 'Part' in the output. Hence, what I'd like to have is: I ABC But I'm stuck ...