# LaTeX packages minted and scrhack

I'd like to use the minted package and the scrhack package in the same LaTeX document, that is:

\usepackage{scrhack}
\usepackage{minted}


However, I get the following error:

/usr/local/texlive/2013/texmf-dist/tex/latex/minted/minted.sty:215: Package scrhack Error: extension lol' already in use. [...t{listing}{h}{lol}[\minted@float@within]}]


Edit: The problem was that I used the package classicthesis and included both, listing and minted. I cannot completely replicate the error, but this MWE has a very similar error message:

\documentclass{scrreprt}

\usepackage{scrhack}
\usepackage{minted}
\usepackage{listings}

\begin{document}

Hello, World!

\end{document}


The error message is:

There were errors in your LaTeX source

/usr/local/texlive/2013/texmf-dist/tex/latex/koma-script/listings.hak:136: Package tocbasic Error: file extension lol' cannot be used twice . [}]


Now, I removed listings (and all related parts) in the classicthesis-config.tex file and everything works fine. I don't think, that I'll need both packages, so my problem is solved.

• Welcome to TeX.sx! Could you post a minimal working example (MWE), please? It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – clemens Jan 27 '14 at 19:37
• Thank you! I didn't realize that the error seems to be caused by another part, so I'm trying to create a MWE now. Additionally, I should mention, that the error occurred by using the 'classicthesis' package. – Pold Jan 27 '14 at 20:11
• The original error reappears if you put the \usepackage{listings} above the others. – bodo Jan 27 '14 at 21:01

The package scrhack redefines macros of other packages. It should be loaded at the very end. Luckily the following then already compiles without errors:

\documentclass{scrreprt}

\usepackage{listings}
\usepackage{minted}
\usepackage{scrhack}

\begin{document}
Hello, World!
\end{document}


If you really need to include scrhack somewhere else, you could use the \AtEndPreamble hook provided by the etoolbox package.