Questions tagged [colorbox]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
19 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 ...
user avatar
  • 669
2 votes
1 answer
63 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 \...
user avatar
  • 5,285
1 vote
1 answer
73 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} ...
user avatar
  • 5,285
0 votes
1 answer
38 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 ...
user avatar
  • 415
0 votes
1 answer
44 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{...
user avatar
  • 1,548
0 votes
1 answer
36 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}...
user avatar
  • 232
7 votes
3 answers
266 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*\...
user avatar
  • 5,285
0 votes
2 answers
50 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 ...
user avatar
0 votes
1 answer
85 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, ...
user avatar
  • 133
2 votes
1 answer
53 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}{ ...
user avatar
  • 498
2 votes
1 answer
109 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 ...
user avatar
0 votes
1 answer
47 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 ...
user avatar
1 vote
1 answer
92 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} \...
user avatar
  • 6,883
0 votes
2 answers
119 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}{...
user avatar
  • 139
0 votes
3 answers
104 views

How to colour the background of a Theorem

How to colour the background like the following picture in LaTeX
user avatar
0 votes
0 answers
73 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[...
user avatar
  • 847
0 votes
2 answers
133 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!...
user avatar
  • 847
0 votes
1 answer
173 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: ...
user avatar
  • 1
3 votes
1 answer
150 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,...
user avatar
1 vote
2 answers
75 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\...
user avatar
  • 193
2 votes
1 answer
47 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}[...
user avatar
  • 123
2 votes
1 answer
128 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 ...
user avatar
  • 299
1 vote
0 answers
26 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, ...
user avatar
  • 480
2 votes
0 answers
56 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[...
user avatar
1 vote
0 answers
40 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 ...
user avatar
  • 11
1 vote
1 answer
73 views

How can I fill green the chapter in table of contents

How can I fill green the chapter in table of contents like this: I have read many place (for example Using colors in LaTeX document, Generate a table of contents,...) but I could not found any ideas ...
user avatar
  • 199
1 vote
2 answers
68 views

Exact size of makebox

I am trying to create a page layout, where the page number is shown on the right margin in a white textcolor on a black background. \documentclass[parskip=full]{scrreprt} \usepackage[left=2cm,right=...
user avatar
  • 43
2 votes
3 answers
169 views

Overful hbox when using \colorbox in math mode

I got pretty long math formulas in my LaTeX document. Now I want to color the background of those formulas. However, if I use \colorbox{}{} the linebreak doesn't work anymore. Note: the gray bar at ...
user avatar
1 vote
2 answers
272 views

How to colorbox an entire section?

I want the last section of a chapter to have a colour background. I want to create a Summary section that needs to be differentiated. I already tried using colorbox (xcolor package): \colorbox{...
user avatar
  • 156
3 votes
2 answers
322 views

Highlighting only the bottom half of a word

I would like to define a command for highlighting in the following style. Some people do this on paper and I would like to mimic that on a particular document. How could I achieve this? I thought of ...
user avatar
  • 77
1 vote
2 answers
142 views

How can I increase the font and sidebar size?

I would like to add increase the size of the sidebar to 2.5cm and increase the size of the text proportionally. At the bottom I would like to create a box taking the entire length of the frame. The ...
user avatar
1 vote
2 answers
105 views

How to add borders with shaded environment (from the framed package)

I defined a shaded environement using the framed package (\usepackage{framed}) and I would like to add borders to the shaded area, how could I do it? For instance, how could I add borders in this ...
user avatar
0 votes
1 answer
253 views

How to make a colour box in these 3 different ways

I want to put a text in a colour box in these 3 different ways. See the pictures below 1. Pic 1:- 2. Pic 2:- 3. Pic 3:- Please tell me.
user avatar
0 votes
0 answers
26 views

alternate background color for biblatex [duplicate]

I am trying to get alternate background color for bibliography, with AtBeginBebliography, as shown(Please note, \IF_COUNTER_IS_ODD does not have any meaning, it is just to show, I want orange \...
user avatar
  • 2,019
0 votes
1 answer
133 views

How to put text inside chronoperiode timeline-bar?

How can I put text inside the bar instead of over the bar? Thank you in advance for your help! \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{chronosys} \begin{document} %--------...
user avatar
1 vote
2 answers
180 views

How do I make a colored box around chemfig

How do I expand the box over both molecules (centered and middle space adjustable), but the borders within the enumerate environment? The image is what I want to make. I attempted to do the following, ...
user avatar
1 vote
1 answer
56 views

How to remove the section numbers while colouring the whole section line using \colorbox?

I have used the following piece of code for colouring the text written in the section. The only problem which I am facing is that after adding this code my section is getting numbered which I don't ...
user avatar
1 vote
1 answer
21 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{...
user avatar
  • 93
2 votes
2 answers
78 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 ...
user avatar
1 vote
0 answers
26 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 ...
user avatar
0 votes
1 answer
301 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}...
user avatar
  • 2,345
0 votes
2 answers
260 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 ...
user avatar
0 votes
2 answers
357 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 \...
user avatar
1 vote
1 answer
57 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 ...
user avatar
3 votes
1 answer
327 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 ...
user avatar
0 votes
1 answer
143 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....
user avatar
  • 239
3 votes
1 answer
180 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.
user avatar
0 votes
1 answer
101 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}{...
user avatar
4 votes
2 answers
285 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, ...
user avatar
0 votes
0 answers
111 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 ...
user avatar
  • 197