Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [colorbox]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
27 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
45 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
15 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
51 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
77 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
70 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
43 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
70 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
143 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
62 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
179 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
176 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
392 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
126 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
109 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
109 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
77 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
76 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
74 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

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
254 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
285 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
299 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
72 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
404 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
75 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
669 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
79 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
86 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
150 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
57 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
288 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
81 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
91 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
77 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
600 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
457 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
940 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
127 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
404 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
54 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
397 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
4k 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
284 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
1k 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
143 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
160 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
64 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
270 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, ...