I do not think a listing inside the box fits very well with the rest of my report.
I created a new post for the issue below, because this post has been solved.
New post:
http://latex-community.org/forum/viewto ... =5&t=26877
I am trying to turn it into a command, but I am having some trouble with this.
My setup is like this:
Code: Select all
\begin{listing}
\begin{tcblisting}{title = {Pseudocode},
fonttitle=\sffamily,
listing only,
listing remove caption=false,
label = lst:json2,
colframe = black,
colback = white,
left=6mm,
bottom=-1mm,
top=0mm,
enhanced,
boxrule=0.5pt,
attach boxed title to top left = {xshift=5mm, yshift=-3mm},
boxed title style={colback=white, colframe=white},
coltitle=black,
sharp corners,
listing options={style=pseudo}}
print "Hello, World!"
\end{tcblisting}
\caption{Example of a pseudocode block}
\end{listing}
And my attempted command is like this:
Code: Select all
\newcommand{\chnInnerListing}[5]
{
\begin{listing}
\begin{tcblisting}{title = {{#1}},
fonttitle=\sffamily,
listing only,
listing remove caption=false,
label = {#3},
colframe = black,
colback = white,
left=6mm,
bottom=-1mm,
top=0mm,
enhanced,
boxrule=0.5pt,
attach boxed title to top left = {xshift=5mm, yshift=-3mm},
boxed title style={colback=white, colframe=white},
coltitle=black,
sharp corners,
listing options={style={#2}}}
{#5}
\end{tcblisting}
\caption{{#4}}
\end{listing}
}
\newcommand{\chnpseudo}[3]
{
\chnInnerListing{Pseudocode}{pseudo}{{#1}}{{#2}}{{#3}}
}
\chnpseudo{lst:pseudo4}{Example of a pseudocode block}{print "Hello, World!"}
Can any of you see what is wrong? I get the error:
File ended while scanning use of \next. \input{chapters/introduction/readingGuide}.
I have tried matching all the {}, and they seem to be right. I have tried removing spaces as well.