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} \...
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 ...
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 ...
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 ...
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?
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} ...
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] \...
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 ...
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("...
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 ...
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 ...
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 ...
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 ...