Hello,
New to tcolorbox and struggling.
Thanks to help from Paul Rubin I've defined a color box for displaying computer code as follows:
New Color Box Type cBoxA2colback=gray!25!white, colbacktitle=black, colframe=black!75!black,fonttitle=\bfseries, title=\listno\,comment, width=\textwidth
It mostly works except for two issues. Here I'll only inquire about the first issue:
Issue 1:
\listno\ is a macro I've defined to display chapter number:listing number: e.g. "Listing 2.1". That works. But rather than the hard-coded "comment," I need to insert the comment as a parameter in each new listing: e.g. Listing 2.1 <comment specific to this listing>.
But despite hours of Google search and study of tcolorbox manual, I can't figure out how to do it.
Can some kind soul point the way?
Many thanks,
Lloyd R. Prentice
Graphics, Figures & Tables ⇒ Title parameter in tcolorbox
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10321
- Joined: Mon Mar 10, 2008 9:44 pm
Title parameter in tcolorbox
Hi Lloyd,
welcome to the forum!
Do you have some code that we can compile and test? (
minimal working example)
Stefan
welcome to the forum!
Do you have some code that we can compile and test? (

Stefan
LaTeX.org admin
Title parameter in tcolorbox
Hi, I am also struggling with this.
Is there a way to override the title or allow it to be defined when it is used?
The code I have is
then later on it the document I use it as follows
As fast I know I need the title as I want it to be in the top left and so it requires a value, but I cannot override it or allow it be entered later.
Anyone have any ideas?
Thanks,
Darryl
Is there a way to override the title or allow it to be defined when it is used?
The code I have is
Code: Select all
\newtcolorbox{mytcolorbox}{colback=green!10,enhanced,title=Areas to Consider are, attach boxed title to top left={xshift=-4mm}, fonttitle=\bfseries}
Code: Select all
\begin{mytcolorbox}
\begin{itemize}
\item[\S] - list 1
\item[\S] - list 2
\end{itemize}
\end{mytcolorbox}
Anyone have any ideas?
Thanks,
Darryl
Last edited by Stefan Kottwitz on Mon Dec 12, 2022 5:03 pm, edited 1 time in total.
Reason: code marked
Reason: code marked