Questions tagged [colorbox]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
13 views

color box that ignore mutated vowel

Can someone help defining a new command? I have the following to create a colored box around the content that is written in all caps: \documentclass[]{scrreprt} \newcommand{\sect}[1]{ \colorbox{...
2
votes
2answers
34 views

Splitting vbox with Verbatim inside

I have replaced the Verbatim environment to include a vbox and colorbox so that I can apply a background color to it. The problem is that now it does not split at the end of the page. This is a ...
1
vote
0answers
23 views

How print the latex commands in document with line numbers in a coloured box [duplicate]

I want to write the latex commands in the document ina coloured box with line numbers. Much like in here the latex commands display in a gray coloured box. I want that with line numbers. And also i ...
0
votes
1answer
40 views

\colorbox shape – highlight formula

I've seen somewhere such a shape of a highlight. I am trying to repeat this using xcolor package, but I managed to get only rectangular shape of the box. \colorbox{red!10}{$\displaystyle\int xe^{-x}...
0
votes
1answer
47 views

Undesired indentation when using Verbatim inside colorbox inside itemize

I want to place a Verbatim from fvextra package, with a background color, inside a itemize. To accomplish that, I placed the Verbatim inside a colorbox. Unfortunately, there were two problems: there ...
0
votes
2answers
69 views

Using titlesec, Space between titlerule and colorbox

I am using the package titlesec to format the titles in my document. As I don't want to have the titles in a closed box (we could use "frame" as format parameter of \titleformat for that), I use a \...
0
votes
1answer
47 views

Several questions about the question “Attractive Boxed Equations”

I was reading the highest rated answer of the question "Attractive Boxed Equations", I don't understand the main code of the answer. There are two problems for me: what do the commands with ...
0
votes
0answers
25 views

How to break line with colorbox inside a new command

I created a lstdefinelanguage for diff language. For each type of sentence, I want to color background in a different colour. To do this, I created a new command: \newcommand{\lstbg}[3][0pt]{{\...
3
votes
1answer
99 views

Only frame with rounded corners and shadow using attach boxed in `tcolorbox`

I'm trying to get a box style (more or less) like this: But with the rounded edges and shadow (that image is my best effort with Gimp ...) I've been trying to adapt an example of the tcolorbox ...
0
votes
1answer
40 views

Using tikzcd package inside a colorbox

I am trying to use the tikzcd package to make a commutative diagram inside a colorbox. I am having trouble combining these two environments, although the code works outside of the colorbox environment....
3
votes
1answer
95 views

Embossed color box

I need to have embossed colorbox in latex with text within (like the \fcolorbox{border-color}{fill-color}{text} ) the same as the folowing picture? Is it posible? Thanks.
0
votes
1answer
36 views

Listing not fully filling background with escape inside

I made this minimal example to showcase the problem I am having: \documentclass{article} \usepackage{xcolor} \usepackage{listings} \definecolor{background}{HTML}{EEEEEE} \definecolor{xmlOrange}{HTML}{...
4
votes
2answers
127 views

Text colour in empheq for multiline AMS environments

I use the empheq package along with the xcolor package to display equations in coloured boxes. I also wish to change the text colour of the equation. In single-line environments, such as equation, ...
0
votes
0answers
59 views

Text goes outside of colored box - how to fix?

My coloured box should look like this: but here's how it looks: So the fonts are different and the colours are also a bit different. It is described by this LaTeX code. I would appreciate some ...
2
votes
1answer
34 views

Full page coloured box

I would like to create a coloured box that fits the size of its container exactly. To start, I have attempted to create a box that is precisely the size of the page. My first attempt used \colorbox ...
1
vote
2answers
37 views

Section heading with shaded background spanning \textwidth, with uniform baseline

I’m trying to adapt one of the answers to this question so that only the section text, and not the section number, has a coloured background. Unfortunately the use of \parbox seems to result in a non-...
1
vote
2answers
47 views

How to put color boxes on circuits

I would like to put a color box around something basically this time is a circuit, I would also like to put a darker wire. Here es my code: \documentclass{article} \usepackage[utf8]{inputenc} \...
1
vote
1answer
81 views

Prevent colorbox from indenting text

I have a table with entries in the first column to be aligned to the left of the page. I have a colorbox around one of the entries, which is causing the text to be slightly indented. Is there a way to ...
1
vote
2answers
73 views

centering text in a fixed width colorbox

How can I align this text, horizontally, to the center of the box? %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[margin=0mm,border=0]{standalone} \...
1
vote
2answers
59 views

Display colored strings in small font size

I want to display random strings made up of 's' and 'f' such that every s is white on a blue background and every f is white on a red background. I can make it work fine in normal text, but when I ...
1
vote
1answer
61 views

Highlighting of words in table header displaces non-highlighted words

I have a quite simple table (even more reduced for minimum example) with some highlighting. By using \colorbox and \tikz\node (with and without inner sep argument) I create boxes around text, but the ...
1
vote
1answer
63 views

How to change the color of font in all text in '' \declaretheorem "

\documentclass[12pt]{article} \usepackage{lmodern} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage{amsthm} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[...
0
votes
1answer
148 views

Using tcolorbox, but the color is not exactly the right color

I am using the following code \documentclass[oneside]{book} \usepackage[utf8]{inputenc} \usepackage{tcolorbox} \usepackage{xcolor} \newtcolorbox{tbox}[3][] { colframe = #2!25, colback = #...
0
votes
0answers
23 views

break colorbox in lines for lstset inline code

I use this latex code to define icode commadn with which I can write inline codes: \definecolor{lightgray}{gray}{0.9} \lstset { frame=shadowbox, rulecolor=\color{white!80!black}, ...
2
votes
1answer
128 views

How to set a fixed height to a colorbox?

I currently have a simple colorbox, I would like to increase its height. Is there a way to set a fixed height, or maybe a kind of padding? I added \hspace to add some space horizontally, but a \vspace ...
1
vote
2answers
153 views

Add space below a \colorbox

I have created a new command using colorbox as follow: \newcommand{\resheading}[1]{{\small \colorbox{mygrey}{\begin{minipage}{0.975\textwidth}{\textbf{#1 \vphantom{p\^{E}}}}\end{minipage}}}} This is ...
4
votes
3answers
80 views

How to colour a table with opaque colour such that no text and no lines are visible?

I am iterating a latex file and want to colour all the tables green such that no text or no lines are visible. I tried using "transparent" but it fades the colour along with the text. I want the ...
0
votes
0answers
66 views

Latex colours not matching when seen using opencv

I am working on a project where I need to extract each cell in a table in a latex file. So I am coloring each of the cell with different color so that when I parse the png image of the file then I ...
2
votes
1answer
269 views

how can we highlight a long title?

I want to highlight my title with a certain color. My title is long and it lays in 3 lines. How can I create a colorbox for the title? \title{My Desired Title} conflicts with the command \hl.
1
vote
1answer
563 views

CV with timeline

Here you can find a latex template for Cvs. https://www.overleaf.com/articles/satish-kumars-cv/dngwrghdxxqh. I am facing an issue with the timeline environment. The code follows: \newcounter{...
1
vote
1answer
118 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
2answers
712 views

How to get custom section style using titlesec?

I am trying to design a custom section. My desire section will be something like this : But I am unable to get the exact result. This is what I was trying : Horizontal rule will be joined at the ...
1
vote
1answer
313 views

Latex Text Box with colored background that breaks as normal text

I want to define a command, lets say \quote{ This is a .... very long quote } that has a solid colored (in my case light gray) background, and ideally a colored line on the left side. however, it ...
5
votes
3answers
735 views

width of colorbox

I was wondering if there's a way to set the length of a colorbox. For example: As you can see, the right edge of the box is a bit too much (and the left edge too), and I just want the edges to ...
0
votes
1answer
179 views

A label in color box with fix width and height

I want to have a small size color box with a label in it. This color box should have a fix width and length. I have tried with \crule[blue]{24mm}{6mm}, which can have the fixed size but I don't know ...
1
vote
2answers
149 views

How to use several colors in one row in latex table

I need to write very long table (128 rows x 64 columns), with different colors in a rows. Also it have to have "color in color" within one row, so it can be interpreted as one row consists of several ...
3
votes
3answers
130 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 ...
0
votes
1answer
250 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 \...
3
votes
1answer
108 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
155 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
187 views

How do you remove spacing from multiple beamer color boxes on the same line?

I am working on my own Beamer theme for use in presentations. Along the bottom (in the footline) I want to have three color boxes in a row which have different colors. Within my theme.sty file I have ...
4
votes
1answer
472 views

Adjust height of Colorbox

Hello I am looking to improve the equality of these colorboxes. You can see the difference in the dimensions of the shading. I tried the \strut command but it changed the table too much. This is the ...
2
votes
1answer
618 views

Putting definitions in color boxes

I've found a awesome document (doing some research in Model Theory). I would like to know how I can do those color boxes for definitions, theorems and other stuff. Thanks a lot!
2
votes
1answer
452 views

How to reduce colorbox width for text?

Here's the MWE: \documentclass[a4paper, 12pt]{article} \renewcommand{\rmdefault}{ptm} \usepackage[table]{xcolor} \definecolor{tpgray}{gray}{0.90} \newcommand{\tp}[1]{\colorbox{tpgray}{#1}} \begin{...
2
votes
1answer
101 views

Alignment of minipages and colorbox

I have this document which I try to reproduce in Latex. I am using the colorbox and minipage. But I got confused with an alignment. Can I get the expected results with current packages or should I try ...
0
votes
1answer
758 views

Highlight code in lstlisting

I would like to highlight code in a listlisting environment. I tried two techniques: using \usepackage{lstlinebgrd} and using \usepackage{color} (based on this conversation) but none really match what ...
1
vote
1answer
93 views

Lines and colorboxes in background of the text

I am very new at latex and therefore I am not really sure what I am searching for, so maybe I thought someone of you could help me! I want - I am trying to modify some template for a cover letter, ...
9
votes
6answers
820 views

Using background colors in monospaced text

I am trying to generate this in my document: The goal is to have multiple lines that are aligned, which is why I used \texttt{}. But using \colorbox{color}{text} from the xcolor package, this is what ...
2
votes
2answers
137 views

Same font for listing and escaped latex

I'm trying to animate the C code. So I've used a colorbox to highlight the current row (How btw I can highlight the whole row?). My problem is, I'm not that familiar with fonts, so I do not know how ...
0
votes
1answer
138 views

Making framed section heading, using multiple parbox

I'm trying to build custom section headings, which have the text in the top of a coloured box of a specified height, with another coloured box of a specified height beneath. Much like this: The ...