Quantcast
Channel: Problem with \mintinline{latex} and ToC - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

Problem with \mintinline{latex} and ToC

$
0
0

I'd like to use code highlighting for LaTeX in my sectional titles. In the titles themselves it works, but the it does not in the Table of Contents. Here a minimal example:

\documentclass{scrartcl}\usepackage{minted}\begin{document}\tableofcontents\section{\mintinline{python}{print ``this''}}\mintinline{python}{print ``this''}\section{\mintinline{latex}{\documentclass[]{}}}\mintinline{latex}{\documentclass[]{}}\end{document}

and the corresponding output:

enter image description here

The complete error from the .toc file reads:

\GenericError { }{LaTeX Error: Can be used only in preamble}{See the LaTeX manual or LaTeX Companion for explanation.}{Your command was ignored.\MessageBreak Type I <command> <return> to replace it with another command,\MessageBreak or <return> to continue without it.

Any ideas how to allow \mintedinline in the ToC entries?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>