Skip to main content

Questions tagged [tcblisting]

The `tcblisting` environment combines features of `tcolorbox` and `listings` or `minted`.

Filter by
Sorted by
Tagged with
1 vote
1 answer
46 views

Custom \newtcblisting with "listing and listing" option?

From the manual, I see there is "listing and comment" option as seen in the following example. Update: with full code \documentclass{standalone} \usepackage{xcolor} \usepackage[most]{...
user2501235's user avatar
0 votes
0 answers
34 views

Adjust spacing within tcb theorem and between paragraphs

For reference this is my current tcbtheorem block \newtcbtheorem[number within=section, list inside = theoremlist, list type = thrm]{thrm}{Theorem}% {enhanced, breakable, colback=r!7, colbacktitle=r!...
xyz04's user avatar
  • 137
1 vote
2 answers
40 views

How to ignore some indentations or not to display indentation symbols in showexpl LTXexample?

Sorry for the basic question. I'm practicing how to use circuitikz, meanwhile I want to show the process of code and output. For the elegant of LaTeX source code in pdf what I want to do is to ignore ...
Jason Haynes's user avatar
2 votes
1 answer
61 views

Subtitle formatting in tcblisting [duplicate]

I tried to use \tcbsubtitle in a tcblisting environment. It worked such that it produced the subtitle bar; however, the subtitle has a listing format. Demo: \documentclass{beamer} \usepackage{...
Daniel Langr's user avatar
0 votes
0 answers
64 views

How to make an environment created with newtcblisting behave the same as one created by the minted environment?

I have declared a new envrionment in a class file like this (the complete file exists here): \renewcommand{\theFancyVerbLine}{\parbox{10pt}{\centering\footnotesize\arabic{FancyVerbLine}}} \...
Sujal Singh's user avatar
2 votes
1 answer
45 views

Compile error when using scrartcl with \newtcbinputlisting

I get the error: \cl@chapter ->\cl@chapter @elt {pythoncode} l.239 listing file={#3},#1} when using the scrartcl documentclass with the \newtcbinputlisting. Can you tell me how I can go ...
Joe's user avatar
  • 9,080
2 votes
2 answers
148 views

Side by side minipage and tcblisting environment

I would like to use a configuration similar to the following, so that the width of the minipage automatically adapts to that of the tcblisting, but I don't know how to get the width of varwidth (noted ...
MB4E's user avatar
  • 1,106
1 vote
1 answer
30 views

Issues with making lstnumber two-digit with hyperref and tcolorbox

I'm trying to use tcolorbox and make all lstnumbers two digit. It seems like there is an error with hyperref. I've attached a working example below. \documentclass{scrartcl} \usepackage[utf8]{...
user41177's user avatar
  • 375
1 vote
1 answer
79 views

How to add a second overlay to a tcolorbox?

I have the following MWE (inspired by inspired by this and this)... \documentclass{article} \usepackage[most]{tcolorbox} \tcbuselibrary{listings, breakable, skins} \usepackage{lipsum} \usepackage{...
user41177's user avatar
  • 375
0 votes
1 answer
82 views

How can I restyle the listings caption to a tcblistings environment?

I am trying to define a tcblistings environment that should work under the following syntax... \begin{code}{TITLE}{LANG}{CAPTION}{OPTS} code here \end{code} Everything but the language should be ...
user41177's user avatar
  • 375
0 votes
0 answers
66 views

Why does a `tcolorbox` code listing box using `listing above text` not keep the output with the code?

I'm trying to use a tcolorbox to list code above output in a document with 2 geometries. My attempt is failing utterly and I can't figure out why. Here's the problem: The box is being split into two, ...
cfr's user avatar
  • 208k
0 votes
1 answer
76 views

Argument of \verbatim@ has an extra } error while placing a tcolorbox inside a node

Trying to place a macOS style Terminal inside a node: \documentclass[a4paper,openany,14pt,oneside,]{extbook} \usepackage{tikz} \usetikzlibrary{positioning} \usepackage{tcolorbox} \tcbuselibrary{skins,...
Lars Malmsteen's user avatar
0 votes
1 answer
22 views

In list of the Listings show without "Listing X:" part

I have my Latex document that uses tcblistings. I generate a list of the Listings with: \begingroup \parskip=0pt \tcblistof[\chapter]{codes}{Listings} \endgroup Which result in the following Listings:...
Frederik's user avatar
  • 103
0 votes
1 answer
82 views

How can I modify my tcblisting to show input code and the expected output side-by-side?

I have a code listing and tcblisting defined as follows. \lstdefinelanguage{MyScheme}{ basewidth=0.5em, morekeywords=[1]{define, cond, lambda, else}, alsodigit=!\$\%&*+-./:<=>?@^_~, ...
TheProgrammer's user avatar
0 votes
1 answer
143 views

How to quickly change spacing of lstlisting to use two spaces instead of four?

I'm working on some LaTeX code listings and have decided to change my spacing from four to two. The problem is that there are a ton of listings in my document (which is ~500 pages)... is there any way ...
TheProgrammer's user avatar
0 votes
0 answers
51 views

Pass a listing as an argument to a command?

I have a custom listing defined as follows: \newtcblisting[auto counter, number within=chapter]{MyCListing}[2][]{% enhanced, frame hidden, breakable, borderline north = {0.5pt}{0pt}{...
TheProgrammer's user avatar
2 votes
1 answer
125 views

How do I use a section counter inside a tcblisting?

I'd like to add the current figure/section number to the title of a tcblisting. Right now, my hacky solution is to just use the section number and increment it manually every time I want to use my ...
TheProgrammer's user avatar
0 votes
0 answers
96 views

finalizecache and cachedir undefined when using minted with tcblisting

I am using minted to display python code and I need to use finalizecache and cachedir to be able to submit my code somewhere else and compile without using --shell-escape, which is disabled for ...
Fabio's user avatar
  • 11
0 votes
1 answer
21 views

Extra text below listing with name "keywordstyle keywordstyle"

I have defined the following listing for Python Code: \newtcblisting[use counter from=sqlCode, list inside=codes]{pythonCode}[2][]{% listing only, breakable, top=0.25pt, bottom=0.25pt, right=...
Frederik's user avatar
  • 103
2 votes
1 answer
67 views

Remove thin black frame around standalone image

My MWE: \documentclass[12pt]{article} \usepackage[most]{tcolorbox} \tcbset{ sidebyside, listing options={ basicstyle=\small\ttfamily, breaklines=true, postbreak=\mbox{\textcolor{red}{$...
WinnieNotThePooh's user avatar
2 votes
1 answer
214 views

Break lines in tcblisting

Here is my MWE: \documentclass[12pt]{article} \usepackage[most]{tcolorbox} \tcbset{sidebyside, breaklines=true, postbreak=\mbox{\textcolor{red{$\hookrightarrow$}\space}}} \begin{document} \...
WinnieNotThePooh's user avatar
1 vote
1 answer
76 views

standalone inside

The code \documentclass[12pt]{article} \usepackage[most]{tcolorbox} \usepackage{mathtools} \usepackage{chemmacros} \tcbset{sidebyside} \begin{document} \begin{tcblisting}{ comment and listing,...
WinnieNotThePooh's user avatar
0 votes
1 answer
85 views

tcolorbox dispExample in Beamer

I used the @egreg's answer in beamer, but it doesn't work. How to handle it?
kalakay's user avatar
  • 2,469
0 votes
0 answers
108 views

tcblisting box w/ minted shows incorrect listings

When using one of the tcblisting boxes for code and comments with minted, I often have problems getting the code snippets to show up. Previously, I used listings and had no problems, but the second I ...
Revise's user avatar
  • 365
0 votes
1 answer
353 views

Adding colon along with custom title to tcolorbox

Sorry that the question description isn't great, but what I mean is how can you update the settings to support having either a title that's just default from the tcbcounter like Example 1.1 or ...
Revise's user avatar
  • 365
1 vote
1 answer
596 views

tcolorbox with theorem and lstlisting

In some of my notes, I want to include an example question as well as code listings on how to carry out the function in one tcolorbox, something like the following image all included inside a box ...
Revise's user avatar
  • 365
2 votes
1 answer
43 views

how to remove this incompatibility between tikz, bodegraph and tcblisting

Hello I want to plot some code examples of using the Bodegraph package with tcblisting. The code below works fine if I put the semilog {} ... command in a scope environment, on the other hand if I put ...
rpapa's user avatar
  • 12.4k
0 votes
1 answer
74 views

Shadow of a frame remains

The setup below leaves a shadow of a frame around the input. How can I make the box blend totally with the background? \documentclass{article} \usepackage{tcolorbox} \tcbuselibrary{listings, breakable}...
Erwann's user avatar
  • 2,130
0 votes
1 answer
93 views

How to add a tikzpicture to the tcblisting title?

I want to add this tikzture with the three coloured circles \definecolor{Button1}{RGB}{254,94,86} \definecolor{Button2}{RGB}{254,188,45} \definecolor{Button3}{RGB}{38,202,59} \begin{tikzpicture} \...
ikreb's user avatar
  • 491
4 votes
3 answers
136 views

Show math macros and result in a table

I'm writing some documentation about some macros I've made up. (I know there will probably be comments about the macros too, but that's not what I'm asking about.) Ideally, I'd like to make a sort of ...
tgkolda's user avatar
  • 758
0 votes
1 answer
290 views

Adding program code to the listing

I want to make a nice headline. So that it does not stick out, but is exactly with the frame. How do I set the width and height of the gray header? Can be this can be done automatically? And still, ...
Антон's user avatar
1 vote
1 answer
113 views

Using listings linerange in tcolorbox breaks formatting

When using listings's linerange or firstline/lastline, the tcolorbox shows extra top and bottom padding, and the font is different. Is there a way to fix this, or is this a bug with tcolorbox that ...
TakingItCasual's user avatar
0 votes
1 answer
328 views

Cannot use unicode box drawing chars inside tcolorbox listing

I am trying to use unicode box drawing characters inside a tcblisting. First I used the pmboxdraw library to define what those characters should be mapped to, so that they could be drawn. I was able ...
Miguel Angelo's user avatar
2 votes
2 answers
454 views

How can create marking exam with tcolorbox

In order to make an exam, I used the tabular environment, but it still boring, i want to make the something with the nice template tcolorbox, how can use it: \documentclass[11pt,a4paper]{article} \...
moradov's user avatar
  • 427
1 vote
0 answers
402 views

Centering \newtcblisting [closed]

Continuing with my book in xelatex, I could't solve how to center a tcblisting. Here is my (i hope this time), MWE: % !TEX encoding = UTF-8 % !TEX program = xelatex % !TEX spellcheck = es_ES % !TEX ...
Pablo Niklas's user avatar
0 votes
0 answers
45 views

Problem with the extension of the file which is used to save listings [duplicate]

I want to display a snippet of Python code as a colored framed box in a beamer presentation. Besides, I'd like to save the snippet in a file. The code below gets the job done: \documentclass{beamer} ...
Tonechas's user avatar
  • 976
1 vote
0 answers
228 views

Change or ignore ponctually the escaping characters of a `tcblisting`

In the MWE below, where $default^{ok}$ is typeset by LaTeX, I define escaping characters. Is it possible to modify this setting every time I would need to use pipelines in my code ? Can I simply turn ...
projetmbc's user avatar
  • 13.4k
1 vote
1 answer
134 views

Decorate minted listing inside a tcolorobox [Merly done...]

I would like to decorate some listings just for pedagogical reasons. Here is a starting code where I can draw a line but I still fail to produce a frame. How can I do that ? \documentclass[12pt,...
projetmbc's user avatar
  • 13.4k
3 votes
1 answer
231 views

tcolorbox adds fragments of listing to list of listings

I'm writing a report due to tomorrow night but I have a problem that I can not resolve. The code is the following, the problem is that in the list of listing appears also a fragment of the listing ...
Nicola Vianello's user avatar
5 votes
1 answer
455 views

How to replace the "space symbol" (squat-u) in listings?

Instead of this output with a "squat-u" space symbol I would like to replace it with e.g. $\cdot$. It is no problem to replace the default symbol for tabs but not for spaces?? \documentclass{article}...
lukascbossert's user avatar
4 votes
0 answers
258 views

How to remove lines and characters from listings / tcolorbox?

Consider this MWE \documentclass{ltxdoc} \PassOptionsToPackage{final}{listings} \usepackage[% ,listings ]{tcolorbox} \lstdefinestyle{mystyle}{% style = {mystyledef}, } \lstdefinestyle{...
lukascbossert's user avatar
6 votes
1 answer
2k 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 ...
Kenneth E. Bellock's user avatar
1 vote
1 answer
385 views

tcblisting apparently not a verbatim environment

MWE % arara: pdflatex \documentclass{article} \usepackage{tcolorbox} \tcbuselibrary{listings} \begin{document} \begin{tcblisting}{listing options={language=ruby}} "hello #{world}" \end{tcblisting} \...
Sean Allred's user avatar
  • 27.5k
6 votes
2 answers
548 views

Using tikzpicture along with tcblisting

I am trying to use tikzpicture along with tcblisting. Basically, I am trying to design a figure to show the use of Java compiler, which converts Java source code into bytecode. See below the code ...
ravi's user avatar
  • 1,618
4 votes
2 answers
934 views

tcolorbox: TikZ picture option of "tikz lower"?

Package tcolorbox has defined a style called "tikz lower". The package manual introduces it as follows: /tcb/tikz lower=options This style adds a centered tikzpicture environment to the start ...
wklchris's user avatar
  • 511
0 votes
1 answer
381 views

how break the page between the 2 parts of tcblisting

As soon as the latex code is too long, the second frame is not displayed correctly. How to cut the box of tcblisting so that the listing on the one hand and its execution is in two separate frames \...
rpapa's user avatar
  • 12.4k
1 vote
1 answer
242 views

Label inside of \newtcbinputlisting giving incorrect ref number

In the code below, I am trying to reference some matlab code that is written using a \newtcbinputlisting environment. When I attach a label to the code, the reference number come in as "1" or "a)" or ...
Joe's user avatar
  • 9,080
2 votes
1 answer
221 views

Have new tcblisting TOC match up current TOCs

In the code below, I am trying to match up the format and font of a new \tcblistof to my other TOCs My new \tcblistof looks like this where it is missing the figure number 1.1: and I want this to ...
Joe's user avatar
  • 9,080
1 vote
1 answer
838 views

Change font type in \newtcbox to \texttt

I wanted to change the font type to \texttt inside of the LIB box: This code is found here: \documentclass{article} \usepackage[many]{tcolorbox} \newtcbox{\mylib}{enhanced,nobeforeafter,tcbox raise ...
Joe's user avatar
  • 9,080
4 votes
4 answers
656 views

Is it possible to have a tcblisting environment within an \ifthenelse?

I would like to choose which code to print according to a boolean flag. If I use my \ifthenelse with plain text it works perfectly, but if I put a tcblisting environment instead of the plain text, it ...
CarLaTeX's user avatar
  • 64.7k