6

I'm trying to create my own class using scrbook as a base class, and biblatex as for my bibliography. Consider this MWE:

\documentclass[bibliography=totoc,fontsize=12]{scrbook}
\usepackage{filecontents}
\begin{filecontents}{refs.bib}
@book{electrodynamics,
    Author={Eringen, A.C. and Maugin, G.A.},
    Title={Electrodynamics of Continua},
    Year={1990}
}
\end{filecontents}

\usepackage{biblatex}

\bibliography{refs}

\begin{document}
\tableofcontents
\nocite{*}
\printbibliography
\end{document}

This works as expected, i.e. the bibliography shows up in the ToC. Now, my seemingly equivalent self-made class

\ProvidesClass{myclass}

\LoadClass[
    bibliography=totoc,
    fontsize=12
    ]{scrbook}

\RequirePackage{biblatex}

used like so

\documentclass{myclass}
\usepackage{filecontents}
\begin{filecontents}{refs.bib}
@book{electrodynamics,
    Author={Eringen, A.C. and Maugin, G.A.},
    Title={Electrodynamics of Continua},
    Year={1990}
}
\end{filecontents}

\bibliography{refs}

\begin{document}
\tableofcontents
\nocite{*}
\printbibliography
\end{document}

does not have a bibliography entry in the ToC. The fontsize option (and almost all the others I've tried) get passed as expected. What's going on?

  • Does it work with the option toc=bibliography (or toc=bib)? – clemens Feb 3 '13 at 14:19
  • No, it doesn't. At least not on my system (current TeXLive 2012 btw). – Psirus Feb 3 '13 at 14:20
  • The global options are those passed to \documentclass, not those passed to \LoadClass. – egreg Feb 3 '13 at 14:35
4

While I don't have a clue why this happens, here's a workaround: change your class to

\ProvidesClass{myclass}

\LoadClass[
    fontsize=12
    ]{scrbook}

\PassOptionsToPackage{bibliography=totoc}{biblatex}

\RequirePackage{biblatex}
  • 2
    Need to look pg 364 source2e.pdf You need to use '\LoadClassWithOptions' or '\PassOptionsToClass'. – Yiannis Lazarides Feb 3 '13 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.