Skip to content

Doc for /tcb/compilable listing #349

@muzimuzhi

Description

@muzimuzhi

Doc for /tcb/compilable listing says it

Sets /tcb/listing file to \jobname-listing-⟨counter⟩.

leaving the ⟨counter⟩ unexplained.

According to the implementation, this ⟨counter⟩ is the \arabic form of tcblisting, a counter used to give each \tcbinputlisting or tcblisting env an unique number.

compilable listing/.style={listing file={\jobname-listing-\thetcblistingcount.tex}},

\newcounter{tcblisting}
\newenvironment{tcblisting}[1]{%
\stepcounter{tcblisting}\edef\thetcblistingcount{\thetcblisting}%
\tcb@layer@pushup%
\tcb@apply@box@options{capture=minipage,#1}%
\begingroup\tcbverbatimwrite{\kvtcb@listingfile}%
}{\endtcbverbatimwrite\endgroup%
\tcbinputlisting@core%
}
\long\def\tcbinputlisting#1{%
\begingroup%
\stepcounter{tcblisting}\edef\thetcblistingcount{\thetcblisting}%
\tcb@layer@pushup%
\tcb@apply@box@options{capture=minipage,#1}%
\tcbinputlisting@core%
\endgroup%
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions