Linked Questions
19 questions linked to/from wrapping inline long lines and adding background color
87
votes
6
answers
85k
views
How to get long \texttt sections to break
I often format path names with \texttt which can be very long. Usually Tex will not break this text. The line will just create a hbox overflow. It looks like this:
................
...C:\documents ...
30
votes
7
answers
26k
views
Highlight text in code listing while also keeping syntax highlighting
I’m using the listings package for code listings. Now I try to highlight some part of the code using \hl from the soul package.
Here’s an example of a resulting query where the injected part of a SQL ...
22
votes
5
answers
7k
views
Wrapping long lines that contain no spaces
I need to format extremely long strings of text. I would like to be able to specify their width, and have them wrap, with or without some special symbol to indicate that the line is wrapped. The ...
19
votes
3
answers
3k
views
Rounded box around placeholder text that supports line breaking
I want to draw a rounded box around a piece of text like that:
The left and right borders should be half circles and line breaking should be supported.
This my code so far:
\setuppapersize[A7]
\...
23
votes
2
answers
8k
views
Colored background in inline listings
I would like to make inline code more distinguishable from the text surrounding it, and I thought that using a background might work (like it is done on the stackexchange pages.)
Since I use the ...
16
votes
1
answer
13k
views
How to make inline listings wrap nicely?
Does anyone know how to make inline listings wrap nicely? Take a look at the screenshot that I attached below. The code example in the second line goes outside the text margin.
Also, any ideas why ...
7
votes
3
answers
2k
views
Different background colors for lstinline
In the following code, I've decided to use the code from Colored background in inline listings so as to redefine \verb to have the possibility to use colors for the text and the background of the ...
9
votes
1
answer
4k
views
make soul highlight span lines
The \hl command from the soul package highlights spans of text with a backround color when color is loaded. When used on longer spans of text, some inter-line spacing remains uncolored, which is ...
8
votes
1
answer
3k
views
How to redefine \lstinline to automatically highlight or draw frames around all inline code snippets?
How to redefine \lstinline to automatically highlight or draw frames around all inline code snippets? E.g. using \bh and \eh commands from Highlight text in code listing while also keeping syntax ...
2
votes
1
answer
5k
views
Long code that needs to wrap
How would I enter this text on an 8.5x11 worksheet with 1.25inch margins all around so wraps around and does not extend onto the margins? Using normalsize text.
SolverAdd CellRef:=Worksheets("...
6
votes
1
answer
4k
views
Background color in inline code listings with linebreak
I want to highlight code inline with a gray background. Preferably with listings.
This question is related to Colored background in inline listings.
But as my MWE shows it doesn't work with line ...
1
vote
0
answers
1k
views
Allow line breaks in highlighted text [duplicate]
When I highlight a bit of text using \colorbox, it prevents line breaking. How does one give tex permission to break lines?
Example:
\documentclass{article}
\usepackage{color}
\begin{document}
...
0
votes
0
answers
546
views
Inline colorbox & linebreaks
First and foremost, I have found some solutions here, here, and there but they seem overly complicated for what I am trying to accomplish.
Problem
I am trying to somewhat reproduce the code ...
1
vote
1
answer
293
views
Adjusting perimeter of colorbox to fit text
Consider this MWE:
\documentclass[11pt]{article}
\usepackage[left=1.5cm,top=2.5cm,right=3.5cm,bottom=3.2cm,a4paper]{geometry}
\usepackage{xcolor}
\usepackage{adjustbox}
\usepackage{setspace}
\...
0
votes
0
answers
288
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 ...