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
2answers
39 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
46 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
215 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
87 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
94 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
100 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
53 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
53 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
53 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
38 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
129 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
149 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
202 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
51 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
279 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
69 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
570 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
50 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
53 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
77 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
47 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
211 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
65 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
70 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
62 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, ...
0
votes
0answers
178 views

Wrapping text in a table and using \colorbox

I am trying to wrap text in a table while colouring in the background. I cannot seem to make it work. I am creating a Tufte book and the table is in a subdocument. This is the code I am using: \...
1
vote
2answers
436 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
343 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
701 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
109 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
314 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
48 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
309 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
234 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
866 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
105 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. \...
3
votes
1answer
141 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 ...
3
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
227 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
291 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
146 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 ...
3
votes
1answer
966 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
150 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
131 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
225 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 ...
1
vote
1answer
167 views

colored columns with colored titles in beamer class

I'm trying to create a 2-column poster using the beamer documentclass. Each column is to be split into several blocks and each of these blocks has its own title. The titles should have a background ...
6
votes
3answers
220 views

About a colored table

I am facing a problem of making a table with colored row. The target picture is as follows: My own tex code about the required colored table is as follows: \documentclass[french]{article} \...
2
votes
1answer
242 views

\parbox inside \colorbox ends up being to wide

Can you tell me why the following code always ends up being to wide (minimal example)? It seems to be independent of the environment so I assume that \colorbox has some additional margin? How can I ...