Questions tagged [colorbox]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7
votes
1answer
13k views

highlighting math

The issue of breakable highlighting was addressed in Cool Text Highlighting in LaTeX But how, in latex, do I highlight text involving math, something like which, right now, I do with a succession of ...
11
votes
2answers
6k views

Colorbox does not linebreak

I'm new here, so I'm sorry for any mistakes or error in from my part. I am trying to make colored textboxes that refer to colored blocks in a figure. My problem is that the colored box does not ...
4
votes
1answer
508 views

\colorbox height too long

\documentclass{article} \usepackage[utf8]{inputenc} \usepackage{xcolor} \usepackage{minted} \usepackage{parskip} \definecolor{codegray}{gray}{0.9} \newcommand{\code}[1]{\colorbox{codegray}{\texttt{#1}...
2
votes
1answer
3k views

Breakable \colorbox? [duplicate]

Given a phrase in the middle of which TeX will place a return carriage, if we place this phrase within a \colorbox, TeX no longer places the return carriage and the phrase protrudes in the margin. Is ...
4
votes
3answers
1k views

How to force a \colorbox to be \pagewidth

I am wanting to make a band of color that stretches across the entire page that will have contact information inside of it. I am attempting this using the color package, and \colorbox. I can not seem ...
3
votes
3answers
114 views

Redefine `\uline` so `\colorbox` is locally defined to have underlined text, too

Initial problem: I want to underline the text with a continuous line with the following code: \uline{No underlining for \colorbox{lightgray}{everything} inside the colorbox.} Workaround: A ...
3
votes
1answer
84 views

How can I wrap `\colorbox` around `\Verb[commandchars=\\\{\}]` by only changing the preamble?

This is a follow-up question to How can I use `\renewcommand` to wrap `\colorbox` around `\Verb`? I have TeX files which contain code like: \Verb|print("Hello World", end="")| The \Verb content ...
2
votes
1answer
98 views

How can I use `\renewcommand` to wrap `\colorbox` around `\Verb` by only changing the preamble?

What works: I have TeX files which contain code like: I want \texttt{this text} to have a background color. I want the \texttt to have a background color: I want \colorbox{lightgray}{\texttt{this ...
2
votes
1answer
68 views

Is it possible to add colored text (spaces, or colored boxes) to a headrule?

I intend to use small colored boxes in front of sections in order to identify at which heading level the text is located, and I'd want my reader to quickly reference the heading level by color. My ...
1
vote
3answers
355 views

How to make \colorbox fill the color between underline and overline of a text?

I want the \colorbox to fill the content between underline and overline of a text. How can i achieve this? Currently, i use $\overline{\underline{\colorbox{light-gray}{\makebox [\textwidth][l]{\...
0
votes
1answer
128 views

How can I use `\uline` from the `ulem` package to underline text inside a `\colorbox`?

Screenshot: I have the following code: \uline{No underlining for \colorbox{lightgray}{everything} inside the colorbox.} Which looks like this: How can I get a continuous line for the text inside \...