Skip to main content

Questions tagged [colorbox]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
30 views

Lstlisting border gaps

Im trying to highlight a line of code in a a lstlisting with a frame. However, when i render it, there is a tiny gap in the frame \documentclass{report} \usepackage{graphicx} % Required for ...
BluePython's user avatar
1 vote
1 answer
271 views

Colored box paragraph that stays on text grid

Is there any straightforward way to produce this kind of output with the distance between the baseline of the last line before the box and the baseline of the first line within the box as well as the ...
keth-tex's user avatar
  • 452
1 vote
1 answer
72 views

colorbox: how to fill only the inner area of a rectangle (square) with rounded corners

If I have a letter of type "(vertical) rectangle with rounded corners" and put it in a \colorbox{<fillcolor>}{text}, is there a way to set the colorbox-parameters so that exactly the ...
cis's user avatar
  • 8,912
3 votes
3 answers
558 views

How can I make this table?

Consider: I want to duplicate this exact table. I'm stuck. How can I do it? I've tried this code so far: \begin{center} \begin{tabular}{|c|c|c|c|c|} \hline \multicolumn{2}{|c|}{Color} & Numerical ...
Aslı Bilge's user avatar
2 votes
1 answer
40 views

How do I create a text-wide colored box with proper spacing in the footer of a two-sided KOMA-Script document?

Here is the scrbook-class MWE of my current approach: \documentclass[% twoside, DIV=12, headsepline=1.2pt, footheight=30pt ]{scrbook} \usepackage{scrlayer-scrpage} \usepackage{xcolor} ...
Amanuensis Frances's user avatar
0 votes
1 answer
41 views

Creating environtment for equation colored box

I was looking on the internet how to put equation in a colored box and found this: \usepackage{xcolor} \usepackage[overload2]{empheq} \newcommand*\mybox[1]{% \colorbox{gray!10}{\hspace{1em}#1\...
crvenikupus's user avatar
1 vote
1 answer
73 views

How to impose the color's title in a tcolorbox

Is there a way to specify the color of title section of a \tcolorbox to be the same as the main color of the box itself ? For example I am running this script : \documentclass{article} \usepackage[...
Waxler's user avatar
  • 860
-1 votes
2 answers
85 views

How do you get a black-colored border around a bounding box? [closed]

Below, we see an example of the \bbox command. $$ \bbox[5px,border:2px solid red] { e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n \qquad (2) } $$ Note that the color for the borders of the ...
IdleCustard's user avatar
  • 1,250
1 vote
1 answer
51 views

How to draw arrows between boxed coefficients in a formula in beamer?

I am trying to draw an arrow to link two terms in a matrix multiplication just like in the picture below. I managed to create the coloured boxes but not the arrow to link both "c" terms. I ...
José's user avatar
  • 697
0 votes
0 answers
24 views

Figure and colorbox position [duplicate]

sorry cause I know it's a current trouble but I cannot find a reliable source to solve my problem: I'm using LaTeX and my figures are going all over the place even when I'm using [h], it looks like ...
gaby8gaby's user avatar
0 votes
1 answer
49 views

Define Colorbox while Error Message: "Missing number, treated as zero."

I'm trying to create a new colorbox like this: And I copied the code : % -----formula \newtcolorbox{formula}[][]{breakable,enhanced, colback=goldenyellow!5,colframe=goldenyellow,coltitle=black,...
ToadetteK's user avatar
0 votes
2 answers
83 views

is there a way to 'breakeline' a newcommand? (to modify only \textbf color)

i made changes in my tex files, so I am looking for a textbf gray. Now the new command created do not breake lines at the end of the document. (same problem as \colorbox{}{}) I found this: (from: ...
ddavb's user avatar
  • 3
0 votes
0 answers
25 views

How to preserve minted's foreground color while highlighting code sections with \colorbox

I'm currently working on highlighting specific sections of code snippets in my LaTeX document. To achieve this, I followed the example provided in the documentation for the minted package, ...
Átila Gama Silva's user avatar
0 votes
2 answers
78 views

Make colorbox show vertically centered characters when using \strut

The context The problem The question The context I know that it is possible to show text in colored boxes by using \colorbox. Because the characters have different sizes, the height of the boxes is ...
Rodrigo Morales's user avatar
2 votes
1 answer
168 views

Change font size of a paragraph and make all colorbox have equal height

The context I know that it is possible to enclose text in colored boxes by using \colorbox. \documentclass{standalone} \usepackage{xcolor} \begin{document} \colorbox{red}{This} \colorbox{green}{is} ...
Rodrigo Morales's user avatar
0 votes
0 answers
57 views

Exam class & solution box: incompatible color warning when printing answers

The following code uses printanswers and %printanswers (commented out) commands (h/t @simondispa) The code compiles without error using %printanswers. But when I printanswers the following log warning ...
Siuslaw Math's user avatar
1 vote
0 answers
49 views

How to define a colorbox command which can treat other user-defined commands in its argument?

I would like to highlight text including user-defined commands with linebreaks. I found a solution for linebreaks (Colorbox does not linebreak), but the \ctext{} command cannot treat other commands in ...
TobiR's user avatar
  • 614
0 votes
1 answer
644 views

tcolorbox breakable through pages

I've tried to realize a breakable tcolorbox like this: \usepackage{geometry} \usepackage{lipsum} \usepackage[skins,breakable]{tcolorbox} \newtcolorbox{cvbox}[2][]{ blanker, %leftupper=4cm, ...
fede1602's user avatar
1 vote
2 answers
65 views

Text is not centered with colorbox

I would like to perfectly center the yellow box with the text in abstract. Here's the code I attempted so far: \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{blindtext} \usepackage[...
dvd's user avatar
  • 25
1 vote
0 answers
59 views

How to preserve vertical colour gradient in breakable tcolorbox

I am currently trying to write a document where I have breakable tcolorboxes with a vertical gradient, as in the code below. However, I am facing an issue where the color gradient resets each time ...
Dan qwerty's user avatar
0 votes
1 answer
521 views

How to put a gray box around text that splits at page break

Is there a way to create a gray box around text that will split upon a page break? For example, using tcolorbox I can get the following: However, it will shift onto the next page if it does not fit ...
user avatar
1 vote
2 answers
162 views

Custom colorful definition

My MWE: \documentclass[a4paper]{article} \usepackage[most]{tcolorbox} \usepackage{xcolor, soul} \usepackage{amsthm} \definecolor{columbiablue}{rgb}{0.61, 0.87, 1.0} \newcommand{\highlight}[1]{\...
WinnieNotThePooh's user avatar
0 votes
1 answer
118 views

Defining a new environment/command to encapsulate a colorbox

I have the following working MWE file: \documentclass{article} \usepackage[rgb,dvipsnames,svgnames,table]{xcolor} \usepackage{array} \usepackage{booktabs} % \begin{document} \begin{table}[!hbt] \...
chandra's user avatar
  • 3,104
1 vote
1 answer
122 views

How to make background of note in 'tabularray' can be broken with 'xelatex' in LaTeX?

As I write the article that contains Chinese characters, so I need to use xelatex engine, even lualatex engine sometimes will not work. I also insert some tables by tabularray package which has a lot ...
Y. zeng's user avatar
  • 2,105
1 vote
1 answer
1k views

Specifying RGB color in a colorbox - tcolorbox package

I tried to specify a RGB color in a color box in this way, but it doesn't recognize RGB, only rgb that is a different thing. How can I specify a RGB color in a color box? \documentclass{article} \...
Gennaro Arguzzi's user avatar
0 votes
1 answer
109 views

force line breaks in long character strings that contain highlighted text (seqsplit does not work here)

I have a long string of characters containing highlighted text by way of a colorbox. Inside it, \seqsplit is ignored. How can I force line breaks within the highlighted text? Please note: \seqsplit ...
C.Carl's user avatar
  • 728
2 votes
1 answer
90 views

Effecting a Shift of an FCOLORBOX within a Simple Lettrine

Consider the code \documentclass{book} \usepackage{type1cm,lettrine} \usepackage{xcolor} %\usepackage{lipsum} \usepackage[tracking=true]{microtype} \begin{document} \thispagestyle{empty} \large \...
DDS's user avatar
  • 9,768
1 vote
1 answer
123 views

Adding a Colored Frame to a Do-It-Yourself Lettrine

This question is an extension of the one posed a while back in Adding a Letter to an Image in a Do-It-Yourself Lettrine Consider the MWE \documentclass{book} \usepackage{lettrine} \usepackage{xcolor} ...
DDS's user avatar
  • 9,768
1 vote
1 answer
117 views

How can I patch `minted` to use `soul`s higlighting

I'd like to highlight code with a gray background like StackExchange does. I know that I can set bgcolor in minted to put a solid background color on inline code. However, this makes minted use ...
Eric's user avatar
  • 683
0 votes
1 answer
220 views

How do i align colorbox with my text?

I am trying to insert colored boxes into my caption like below. But my code below does not align the colored boxes with the text. How can I automatically align them with the text? \documentclass{...
Kong's user avatar
  • 2,471
0 votes
1 answer
132 views

Width of parbox inside colorbox

I want to insert a colorbox into a margin paragraph. parbox is used to keep the line breaks. What value should I pass to \parbox's width so it doesn't get too wide as it does now? \documentclass{book}...
tush's user avatar
  • 1,147
7 votes
3 answers
364 views

Centering an Initfamily Letter within a Colorbox and Sizing It for Use as a Two-Color Lettrine

Consider the code \documentclass{book} \usepackage{lettrine} \usepackage{lmodern} \usepackage{xcolor} \usepackage{scalefnt} \usepackage[tracking=true]{microtype} \input GoudyIn.fd \newcommand*\...
DDS's user avatar
  • 9,768
0 votes
2 answers
131 views

\newenvironment with defined colorbox

Sorry if this has been asked before, but I couldn't find an answer, that fits my situation. I want to create a \newenvironment that produces a box, with a predefined color, and can have text inside. I ...
Mads Sahl Torjusen's user avatar
0 votes
1 answer
687 views

Color box with yellow border

How can I modify to produce something like this? I tried this code for colorbox but I can't see the yellow border \newtcolorbox{colorbox}[1]{ breakable, title=#1, colback=white, ...
주성우's user avatar
  • 133
2 votes
1 answer
109 views

Highlight source code keeping spacing intact

I try to highlight some lines of a code using colorbox in listings. \documentclass[12pt,a4paper]{report} \usepackage{xcolor} \usepackage{listings} \begin{document} \lstdefinestyle{data}{ ...
Theo's user avatar
  • 518
3 votes
1 answer
507 views

Verbatim/Lstlisting environment with background color highlighting

Use case: Currently we are reporting security findings using MS Word. These findings contain large parts of code snippets, command outputs and HTML code. We highlight relevant parts of this code so ...
Jan-Jaap Korpershoek's user avatar
1 vote
1 answer
58 views

Some problem about the frame

I have made a box and I have a few problems. The first one is that, no matter how I change the toptitle or the bottomtitle, the spacing between the box and the article below is still unchanged. How ...
Hưng Trần's user avatar
1 vote
1 answer
476 views

colorbox for a multi paragraph text

I adapt the solution in Set the width of a fcolorbox for a multiparagraph statement - there should be a uniform colour box encompassing multiple paragraphs: \documentclass{beamer} \usepackage{xcolor} \...
Viesturs's user avatar
  • 8,095
0 votes
2 answers
927 views

Highlighting code snippet in lstlisting with colorbox changes the character and breaks the border

I am using Texstudio with texlive 2021. To highlight some lines of the following code snippet in lstlisting, I am using colorbox \begin{lstlisting}[style=listing1] |\colorbox{yellow}{...
sepideha's user avatar
  • 179
2 votes
3 answers
1k views

How to colour the background of a Theorem

How to colour the background like the following picture in LaTeX
GameDev Rony's user avatar
0 votes
0 answers
197 views

Theorem Styles with \ref and \colorbox [duplicate]

Yesterday I publicated a question, link: Theorem styles with emph. But I still have other problems. My code: \documentclass{book} \usepackage[italian]{babel} \usepackage[utf8]{inputenc} \usepackage[...
Puck's user avatar
  • 1,212
0 votes
2 answers
640 views

\fcolorbox in \begin{equation}

Good evening I do not understand why Overleaf tells me that there is an error in this code \begin{equation}\fcolorbox{black}{gray!30}{$\color{blue}{\displaystyle{\lim_{n\longrightarrow+\infty}\dfrac{n!...
Puck's user avatar
  • 1,212
1 vote
2 answers
497 views

Color box with multiple lines and underlined text (within a paragraph)

In a paragraph, I want to highlight some part of the text (not the whole paragraph!) with a colorbox and also underline the text within that colorbox. This would be the result that I am looking for: ...
mar's user avatar
  • 11
3 votes
1 answer
443 views

Transparent colorbox with no text

This is related to Vary transparency of colorbox in a sentence I would like to have a transparent colorbox for some overlay and this attempt is not working \documentclass{article} \usepackage{soul,...
Ruth Lazkoz's user avatar
1 vote
2 answers
346 views

Color background of table using colorbox

I want to set a lightgray color behind my table, using colorbox. Following this solution, I created the following MWE: \begin{table}[H] \renewcommand{\arraystretch}{1.5} \centering \begingroup\...
NickG's user avatar
  • 193
2 votes
1 answer
170 views

Consecutive colorbox items does not line break in a table

I want to create a table with the long text content. Each word in the text is color boxed. But when this is done, the text does not wrap and there is no line break. Below is sample code: \begin{table}[...
Foshiba's user avatar
  • 123
2 votes
1 answer
226 views

one-column abstract is moved to next page when I use tcolorbox

I'm making a two-column document, but I need a one-column abstract with background-color for that I am using tcolorbox, if the content of the abstract is too long then the abstract content is moved to ...
Shalu's user avatar
  • 319
1 vote
0 answers
75 views

ntheorem and psframebox - bad box splitting

I am having some troubles with the typesetting of boxed theorems. I use ntheorem to typeset theorems in a colored frame, defining them via the \newshadedtheorem macro. The problem is that sometimes, ...
Manlio's user avatar
  • 492
2 votes
0 answers
109 views

Extending hline within a colorbox environment

I am trying to extend the hlines of the following table such that they span the entire width of the colorbox, but can't seem to figure out how. The current Latex code looks like this: \documentclass[...
user236014's user avatar
1 vote
0 answers
87 views

Left and right colour box equation

I'm looking for solution to get colour boxes for equations below (with optional box in one of them) - one for the right and one for the left - as on the picture below. Is it possible to get dialog ...
Delfina's user avatar
  • 11