Linked Questions

1
vote
1answer
56 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} \...
1
vote
0answers
73 views

How can I highlight text in the middle of sentences [closed]

I want to be able to present short code in the middle of a sentence. How can I highlight text in the middle of sentences in Latex so it they appear as code. Consider this example For this purpose ...
0
votes
0answers
263 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 ...
7
votes
1answer
1k 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 ...
0
votes
0answers
74 views

How to highlight few sentences in a paragraph? [duplicate]

I would like to get a simple result, as the following Is it possible?
0
votes
0answers
283 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} ...
18
votes
3answers
2k 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] \...
3
votes
1answer
2k 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 ...
2
votes
1answer
4k 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("...
7
votes
3answers
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 ...
8
votes
1answer
2k 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 ...
20
votes
2answers
6k 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 ...
15
votes
1answer
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 ...
27
votes
7answers
19k 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 ...
21
votes
5answers
4k 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 ...

15 30 50 per page