For some reason biblatex
doesn't seem to be reading global options. The following tex file produces a single citation, but not in the authoryear
style. If I uncomment the PassOptionsToPackage
line, it works appropriately, but I'd like to pass the options directly in the class definition. Is there a reason for why the style
option isn't getting read by biblatex
? biblatex
does seem to be processing the backend=biber
option, because it doesn't produce a warning indicating that no backend was specified, which it does when that option is removed.
\RequirePackage{filecontents}
\begin{filecontents}{myclass.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}[2016/10/18 1.0 current]
\LoadClass{article}
\RequirePackage{biblatex}
\end{filecontents}
\begin{filecontents}{references.bib}
@article{hello,
title={Hello World},
author={Bar, Foo},
journal={Baz},
year=2016,
}
\end{filecontents}
%\PassOptionsToPackage{style=authoryear}{biblatex}
\documentclass[backend=biber,style=authoryear]{myclass}
\bibliography{references}
\begin{document}
\textcite{hello}
\printbibliography
\end{document}
printbibliography
is easy to override this seemed like the obvious direction to go, but it does leave a lot to be desired. – Erik Oct 18 '16 at 20:38biblatex
obviously isn't set up to read these supposedly global options. As for your second and third comments, the 'reason' for your needs are unclear, so it's hard to suggest solutions. Obviously (or so I would say) if the class is meant to be able to load any combination ofbiblatex
options, there is not much gain over just letting people loadbiblatex
however they want. (And I'd say class-writing is meant to be tedious so document-writing is not -- one should invest the time to do it correctly.) And what is 'ref manager' in your third comment? – jon Oct 19 '16 at 1:05biblatex
in the class. Same forhyperref
. On the other hand, if you want to force something special, it is not the user who has the right to decide. – Johannes_B Oct 19 '16 at 6:21