2

Here is a MWE:

\documentclass[draft]{article}
\usepackage[most]{tcolorbox}

\newtcblisting{roughsketch}{listing only}

\begin{document}
\tcbinterruptdraftmode
\begin{roughsketch}
  Proof sketch.
\end{roughsketch}
\end{document}

This is what's rendered: Empty box

Question: In my attempt to "deactivate" draft mode, I used \tcpinterruptdraftmode above, but it had no impact, and so did draftmode=false on the box. How can I keep using the class's draft mode but still have my boxes display their content?

0

1 Answer 1

4

When you pass draft to the document class, it also forwards it to the listings package (loaded by the most option of tcolorbox) which suppresses the printing of all listings. You can get around this by passing final to the listings package.

\documentclass[draft]{article}
\PassOptionsToPackage{final}{listings} % test by commenting this out
\usepackage[most]{tcolorbox}

\newtcblisting{roughsketch}{listing only}

\begin{document}

\begin{roughsketch}
  Proof sketch.
\end{roughsketch}

\begin{lstlisting}
  Proof sketch.
\end{lstlisting}

\end{document}

listings

Note this has nothing to do with \tcbinterruptdraftmode, which temporarily stops tcolorbox's "draft mode" that's started with \tcbstartdraftmode.

1
  • 1
    Fantastic, thanks! And this points to another possible solution: \newtcblisting{roughsketch}{listing only,listing options=print} which passes the print option to the listing, forcing it to appear (see tex.stackexchange.com/questions/246057/…). Thanks!
    – Michaël
    Commented Aug 9, 2023 at 20:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .