Hello,

I'm attempting to format code listings in a shaded box. The heading would look like "Listing CN.LN Example code," CN is chapter number, LN is listing number, and "Example code" is in italic. I also need to highlight code fragments in bold.

It looks like the tcolorbox package can do what I need. But when I attempt to use it and compile to PDF I get an error.

Can some kind soul show the way to success?

Here's what I have so far:

Document class: KOMA Script Book
Module: Fancy Colored Boxes

Lyx source code:

% Preview source code

%% LyX 2.2.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[oneside,english]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[latin9]{luainputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{tcolorbox}
\usepackage{babel}
\begin{document}
\begin{cBoxD}{}
The quick brown fox
\end{cBoxD}

\end{document}

Error:

 \begin{cBoxD}
                  {}
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

All the best,

Lloyd R. Prentice
Writersglen Publications



Reply via email to