Graphics, Figures & Tables ⇒ Title parameter in tcolorbox
-
- Posts: 7
- Joined: Mon Feb 26, 2018 9:05 pm
Title parameter in tcolorbox
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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Title parameter in tcolorbox
welcome to the forum!
Do you have some code that we can compile and test? (

Stefan
Title parameter in tcolorbox
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
Reason: code marked