Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [colorbox]

The tag has no usage guidance.

0
votes
0answers
32 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 ...
1
vote
1answer
36 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.
0
votes
1answer
40 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
40 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
68 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 ...
0
votes
1answer
95 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
285 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
101 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
103 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
104 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
61 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
59 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
57 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
43 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 ...
3
votes
1answer
174 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 ...
1
vote
1answer
213 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
223 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
58 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
316 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
70 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
611 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
58 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
58 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 ...
0
votes
1answer
89 views

Colorbox alignment in header

Is there way to align the colored box in the header flushright and without the white line between the header and box with the text centered? I was trying something with mdframed, but the box was to ...
1
vote
2answers
51 views

Automated a minipage+fcolorbox with a newenvironment [duplicate]

How could I create a new environment to automated the following code? \noindent\fcolorbox{white}{lightgray}{ \begin{minipage}{0.96\textwidth} some text in here \end{minipage} }
4
votes
2answers
234 views

font-size in colorbox inside psmallmatrix

I use \colorbox to highlight stuff with a background color. In normal text, this works great. I stumbled over an inconsistency of font-sizes when using \colorbox combined with psmallmatrix from the ...
1
vote
1answer
66 views

LaTeX break before box

I have a document involving multiple colorboxes containing 1-3 words each in a single line, separated by ,. Imagine typesetting a couple of boxes in a line, so that there's only 3cm of space to the ...
0
votes
3answers
78 views

Horizontal alignment with colorbox

I am getting quite frustrated trying to center a three-part table \documentclass{article} \usepackage[flushleft]{threeparttable} \usepackage{booktabs,xcolor,siunitx} \definecolor{lightgray}{gray}{0.9}...
2
votes
1answer
65 views

Table inside fancyvrb with continuous colorbox?

So I'm trying to insert a table (with an image) in the middle of a \fancyvrb of R code. The \fancyvrb has a \colorbox around it in gray. Is there a way to get all three parts (verbatim pt1, table, ...
1
vote
2answers
503 views

Baposter: adjust transparency of body of context boxes

I am framing a poster using \baposter and making use of \definecolor{boxcolor} to select the background colour of the body of the content boxes. I am able to adjust the shade and colour of the boxes ...
3
votes
1answer
376 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}...
4
votes
3answers
781 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 ...
0
votes
0answers
115 views

Use \parbox like \empheq

MWE \documentclass[a4paper]{article} \usepackage{geometry} \usepackage[svgnames]{xcolor} \usepackage[listings,skins,breakable,hooks,most]{tcolorbox} \usepackage{empheq} \usepackage[color]{changebar} ...
0
votes
1answer
344 views

Align beamer color box at bottom of frame

due to problems trying to make a footnote without number (the objective is to include the source of an image), I tried using beamercolorbox with a tiny font (maybe is not the most correct option, but ...
0
votes
0answers
51 views

Creating a colored box, specify its placement and wrapping text around it

I'm currently working on a rough template to write RPG modules from scratch and I would like to create a colored box to highlight some details of the module. What I'm currently doing is creating the ...
2
votes
2answers
333 views

Lstlisting with shaded background color adds block on bottom

Currently I have no idea why the shaded box adds this spacing at the bottom of my listing: I'm not sure if the shaded box adds this spacing after the caption or if the listing just adds this extra ...
3
votes
1answer
3k views

Remove border of a framebox

I would like to insert an inline box. I have tried this: \usepackage{color} \definecolor{shadecolor}{rgb}{1,.8,.3} \begin{document} {\setlength{\fboxsep}{0pt} \framebox{\setlength{\fboxsep}{5pt}\...
1
vote
2answers
245 views

How to make a border for my own environment?

\documentclass{book} \title{Introduction to Latex} \author{Me} \date{} \usepackage[dvipsnames]{xcolor} \usepackage{exsheets} \SetupExSheets{counter-within={chapter}} \newenvironment{myquestion} {\...
3
votes
3answers
931 views

How can I put two colored boxes next to each other?

I would like to have text in two colored boxes next to each other. I found \tcbox, but it automatically adds a linebreak. Please note: I can use anything that works with pdflatex. No need for \tcbox, ...
1
vote
0answers
123 views

Add rectangle color box inside align and explain using an arrow [duplicate]

Hi i'm creating a beamer presentation and trying to make my equation beautiful. Is it possible to make color rectangle or circle in align and then write something about that part of the equation. \...
2
votes
1answer
143 views

How to make box sizes consistent and “glue” boxes together (in beamer)?

I have been putting together a new beamer template and cannot solve a few last problems. A minimal working example that highlights these problems is the following (it doesn't look minimal but I feel ...
2
votes
1answer
59 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 ...
2
votes
2answers
2k views

Overlay specification with beamer and '\colorbox'

I use \colorbox in my slides to highlight part of the text (as if it was highlighted with a marker). The command also accepts beamer overlay specifications (e.g. \colorbox<1>{yellow}{Text}). ...
3
votes
1answer
246 views

Specific type of box around equation

When I write notes by hand, if I want to box an equation, I usually do it in the following way. I find the lowest (highest) point of the equation, I go a little bit higher (lower) and take a line, ...
2
votes
2answers
328 views

Adjusting vertical space around equation using \empheq package

I have been using a simple method for adding a framed, colored box around important equations I want to highlight. The empheq package has worked well. However, I am having a lot of trouble figuring ...
0
votes
1answer
160 views

Extending a colorbox on the footnote

In the middle of my book document, I would like to add a page like a title-page. This page is half white and half light blue, with some information in the two halves. Header and footnotes are ...
2
votes
1answer
1k views

How to control the dimensions of \colorbox

I want a long narrow horizontal colored rectangle, something more like a thick line, but I cannot get the height below a certain amount. The best I can come up with is: \documentclass[11pt]{book} \...
1
vote
1answer
157 views

Highlight text in \mtctitle

I would like to produce a title for a table of contents that is highlighted in yellow. However the code \renewcommand{\mtctitle}{\colorbox{yellow}{Contents}} does not seem to work, instead giving ...
2
votes
1answer
153 views

Different definitions of fboxsep in different parts of the code

Is it possible to define one value of \fboxsep to use in an \fbox, for example, and then use another value to use in, say, a \colorbox? Can you define such values locally?
0
votes
0answers
246 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 ...