Graphics, Figures & Tables ⇒ Title parameter in tcolorbox
-
lrPrentice
- 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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- 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