Stack Exchange Network

Stack Exchange network consists of 174 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 [tcolorbox]

{tcolorbox} provides an environment for colored and framed text boxes with a heading line. Optionally, such a box can be split in an upper and a lower part. The package can be used for the setting of LaTeX examples where one part of the box displays the source code and the other part shows the output. Another common use case is the setting of theorems. The package supports saving and reuse of source code and text parts.

1
vote
2answers
48 views

Fix some problems with a nice frame using tcolorbox

For my book I'm using this code (I have 4 with similar aspect) to put the important definitions, notes, and other. Here there is my MWE: \documentclass{article} \usepackage[most]{tcolorbox} \...
1
vote
1answer
22 views

Tcolorbox:: Background color in title - not working

\documentclass[10pt]{beamer} \definecolor{beige}{RGB}{227,244,227} \definecolor{mediumseagreen}{RGB}{84,180,73} \usepackage[most]{tcolorbox} \newtcolorbox{tipbox}{ enhanced, fonttitle=\sffamily\...
1
vote
1answer
48 views

tcolorbox not centering in absolute positioning tikz node

Alright people, I've stumped myself again. It appears (to me at least) that tcolorbox has some outside margins or padding that I don't know how to control. I use tikz absolute positioning to format ...
1
vote
1answer
55 views

Font types in tcolorbox environment

Is there a way to specify different fonts for both typing and math mode in the tcolorbox environment. I want to use the default Computer Modern for most of my document, but use Concrete Fonts and ...
0
votes
1answer
28 views

Call/insert variable of Array for tcolorbox

Thank Tex community & Stack Exchange. Hi friends, With supporting of Mr @marmot, i can create "variable Array" in file myarrays.tex. Link topic: Global variable Array Now i want call/insert ...
3
votes
2answers
74 views

Consecutive numbering and labels in tcolorbox

Those days I write a book, and I use framed boxes tcolorbox. Have a look: \documentclass[12pt,a4paper]{book} \usepackage[utf8]{inputenc} \usepackage{amsmath,amsthm,amsfonts,amssymb,mathtools} \...
0
votes
0answers
30 views

tcolorbox tcblinputlisting unexpected behavior when filenames have spaces and/or underscores

I'm not a Latex expert, so I reached the limit of my knowledge in the tracking down of this problem. If someone can shed some light into this problem I think it would be very useful. The Problem ...
3
votes
1answer
37 views

Dynamic change text with different Definition

I must print my PDF file often with 2 options: A or B. When I change contents of file, it's often error-prone when so much positions in document must be changed. Now I want use dynamic change: ...
3
votes
1answer
52 views

Runaway Argument in \tcbtheorem [duplicate]

The following MWE \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[many]{tcolorbox} \newtcbtheorem{defbox}{Definition}% { enhanced, arc=0mm, interior style={white}, ...
4
votes
1answer
45 views

Auto append prefix to tcolorbox's title

I would like to have a tcolorbox environment that appends the prefix "Note:" to the given title. Thus, using the option title={My Title} to this environment would produce a title of Note: My ...
3
votes
1answer
36 views

Extend breakable tcolorbox over footer on page break

I've defined a tcolorboxenvironment thusly: \newtcolorbox{cajita}[1]{ boxrule=2pt, breakable, enhanced, arc=3mm, colback=Orange!15, colframe=Orange!70, colbacktitle=Orange!35, coltitle=...
3
votes
2answers
42 views

How do I center a single line of text in a tcolorbox?

This one is really stumping and it seems like it should be so simple. I'm attempting to center lines at the end of a tcolorbox. This is what I have: \documentclass[A4]{letter} \usepackage{graphicx} \...
2
votes
1answer
43 views

How to configure tcblisting with minted to allow copy/paste from listing with whitespace characters?

This answer from a similar question gets very close to a final copy/paste solution, but does not work for me as it does not select whitespace. I am asking a new question as the linked one is several ...
4
votes
1answer
52 views

expand width of tcolorbox for dynamic section titles in memoir latex

I am looking to use tcolorbox for styling dynamic section titles. My problem is that I want the box to span the entire width of the paragraph bellow it and have the text centred if possible. I've done ...
5
votes
4answers
148 views

How to have two optional parameters in a tcolorbox?

I wrote a red course summary box. This box contains the code given in the following answer. It uses \NewTColorBox and xparse (which I don't understand much about). I would like to be able to make ...
3
votes
1answer
54 views

Using pgfopts to set up a tcolorbox style

Consider a package file eqbox.sty: % Preamble \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{eqbox}[2018/01/01 Boxed Equations] % Packages \RequirePackage{xcolor} \RequirePackage{pgfopts} \...
2
votes
1answer
156 views

How to calculate the current school year in a tcolorbox?

I have created a personal package that contains the definition of a summary box. This box has an optional argument that is the current school year (highlighted in yellow in the screenshot below). I ...
1
vote
2answers
69 views

How to index each tcolorbox box by a number/total fraction?

To create a course summary, I created a tcolorbox that I call for each new page. There is therefore only 1 box per summary page. This summary is indexed by 1/2 (first page on a total of 2) 2/2 (...
2
votes
1answer
46 views

Bullet corner frame using tcolorbox

Here I am using tcolorbox package, I want to set the bullet/dot need to expand based upon the box spanning as per requirement. Here I attached the screen shot and highlight the area in red color which ...
1
vote
0answers
49 views

tcolorbox, tikz [duplicate]

Please help us below code that right side of arrow not spanned based on height and and help us how to set auto width: \documentclass{book} \usepackage{tikz} \usepackage{tcolorbox} \makeatletter \...
12
votes
2answers
193 views

tabularx inside tcolorbox not centered properly

I am trying to put a tabularx inside a tcolorbox but it's not centered properly, it's shifted slightly to the right. Here is the code I am using. I am using figure environment for the caption. Is ...
1
vote
0answers
55 views

Breakable tcolorbox in beamer does not break automatically, and following questions

I have encountered several problems when using a breakable tcolorbox with beamer class. For some of them, although workarounds are found, I still wonder if there exist more automatic and elegant ...
1
vote
2answers
51 views

Linebreaking inside TCBOX

I'm currently trying to achieve the following inside a tcolorbox: I'm running into trouble with the way I'm currently doing it, but I don't think the way I'm doing it is right in the first place. I ...
0
votes
0answers
45 views

decorating / redefining tcboxmath

I can use \newtcolorbox to add my own decorations to tcolorboxes but is there anything analogous for \tcboxmath? Thanks.
8
votes
2answers
145 views

Auto width tcolorbox around equation

I am using tcolorbox to draw boxes around equations. Since the box widths are equal to the equation widths, long titles are often shrunk, hence looking ugly, as shown here: Is there any way to draw a ...
5
votes
1answer
212 views

TiKZ drawing output

Please help us how to draw attached images as with TiKZ, PSTricks or tcolorbox.
2
votes
1answer
101 views

Font size in listing

How to set a font size in listing when I have these settings in the preamble? \documentclass[12pt,a4paper]{report} \usepackage[most]{tcolorbox} \newtcbinputlisting[auto counter,list inside=lol,list ...
0
votes
1answer
27 views

Using footmisc package in tcolorbox environment [duplicate]

I am trying to create a footnote symbol * in a tcolorbox environment and the result is not the symbol nor at the bottom of the page instead within the box! \usepackage[most]{tcolorbox} \usepackage[...
0
votes
1answer
44 views

Setting space and font in tcbinputlisting [duplicate]

How to set a space above the \mylisting and is the fontsize set fine? Thank you \documentclass[12pt,a4paper]{report} \usepackage[most]{tcolorbox} \newtcbinputlisting[auto counter,list inside=lol,...
3
votes
0answers
63 views

How to scale horizontally every character in listings code?

I want to scale horizuntally every character in listings code, making it narrower. The basewidth option is not what I want, since it doesn't scale characters. Any way to achieve this? \documentclass{...
3
votes
2answers
61 views

List of listings - how to add

I have defined listings. How to create a list of listings? I mean something similar to \listoftables. Thank you \documentclass[12pt,a4paper]{report} \usepackage{xcolor} \usepackage{listings} \...
3
votes
1answer
46 views

tcolorbox: parbox=false AND hyphenationfix=true

I want the text in a {tcolorbox} to exhibit the same paragraph style as the main body. As far as I know (as per the first reference) this requires using \RestoreParskip: \newcommand*{\RestoreParskip}{...
1
vote
1answer
50 views

How to increase box shadow size using tcolorbox

Here I faced the challenge to fix the drop shadow size. Default it comes into smaller shadow. But I want more shadow thickness. Please provide better solution to solve this. MWE: \documentclass{book}...
0
votes
0answers
47 views

Environments nested in fullwidth

I'm struggling to find a way to set up some fullwidth text in my memoir document. This is an extract of my preamble: \documentclass[10pt]{memoir} %document class \setstocksize{...
5
votes
2answers
217 views

How to do calculations with a LaTeX counter in a newtcolorbox environment?

I created a course summary box. In order to distinguish the summaries by school year, I have put an optional argument that displays the latter in the upper left corner (highlighted in yellow on the ...
1
vote
1answer
50 views

Same counter for different tcolorbox theorems

I have two different types of tcbtheorems: theorem and lemma, defined as below. \newtcbtheorem[number within=section]{theorem}{Theorem}{some config options}{thm} \newtcbtheorem[number within=section]{...
3
votes
1answer
66 views

Problems with textcolor in tcolorboxes with page breaks

When I use colored text (textcolor) in a - breakable - tcolorbox the color is restored to black after a page break. What must be changed to have, say, blue text within the whole tcolorbox? \...
1
vote
1answer
28 views

Figures allowed in amsthm environments but not tcolorbox theorem environments

I can see that figures work without any error within theorem environments defined with the amsthm package, but it does not work in tcolorbox theorem environments. Rather, it throws the error "! LaTeX ...
1
vote
1answer
29 views

Caption alignement in a sidebyside tcolorbox

In the following pictures How to get the two captions horizontally aligned while keeping the top alignment of the two figures unchanged ? \documentclass[draft]{article} \usepackage{tcolorbox,...
2
votes
1answer
71 views

Framing a colored box with an image

I have a color box (made with tcolorbox) that holds text, and I want to frame it. Unfortunately, I'm copying a style so I can't use a normal border. The border I want is only on the sides of the box ...
1
vote
1answer
94 views

Fix space between running head and box using tcolorbox

Good day! Here I am trying to fix the space between running head last page of the breaking box. Here I am using enlarge top at break by=10pt because as per style continue should come at the top of the ...
1
vote
1answer
50 views

Resize the box in relation to the text contained inside

Two questions: How can I reduce the size of the box? How I can reduce the box in relation to the text contained in the box? Here my MWE. \documentclass[12pt,a4paper,oneside]{book} \usepackage[...
1
vote
1answer
46 views

A visible box on the right hand side of the document

How can I get a small box at the right hand side of the document as in the figure below: My initial attempt failed: \begin{flushright} \begin{tcolorbox} \textbf{Date:11/12/2018}\\ \textbf{Time: 2:...
3
votes
2answers
64 views

Customize counter using tcolorbox?

By now I've spend a lot of hours to find a way to customize the "Counter" inside tcolorbox package. I wanted to put a definition in a tcolorbox as below. In order to get this formation for ...
2
votes
1answer
44 views

Algorithm inside a tcolorbox: how to put a label to the algorithm but the caption as title of tcolorbox?

This question comes after a question about algorithms inside tcolorboxes. Before the question, is better to explain what I have now. I have a file with the algorithm that is q-learning.tex. \...
1
vote
0answers
46 views

tcolorbox listing in XeLaTex compiler

I want to write a document whose main language is Arabic with listings by using the package \usepackage{polyglossia} \documentclass[14pt]{extarticle} \usepackage[listings,minted,breakable,skins]{...
2
votes
0answers
33 views

Shade text background without affecting mdframeds or tcolorboxes

I have some text with tcolorboxes interspersed with normal paragraphs. Everything looks lovely so far, even when the tcolorboxes have to break across pages (using the breakable option). However, I ...
1
vote
1answer
38 views

In memoir and XeLaTeX, I attempted to control the environment of minted to break across pages, but the codes did not work

I use the class memoir and the packages minted and compile in XeLaTeX. Based on the questions How to let minted break across pages but keep the caption together with the end of listing? and Breaking ...
0
votes
1answer
46 views

Error in tcolorbox Missing \endcsname inserted

I am trying to a fancy theorem type for my notes. I like tcolorbox examples. But the one that I like most is giving me an error. Missing \endcsname inserted. This one is on page 360 of the ...
1
vote
0answers
40 views

Tcbtheorem with crosslinking

I had created a document with problems. Some feature I implemented is a click on the problem number, which leads to the answer at the end of the document and vice versa (look MWE). My ...