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}
printbibliographyis 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:38\DeclareOption{ay}{ \PassOptionsToPackage{style=authoryear}{biblatex} } \ProcessOptions\relax \LoadClass{article} \RequirePackage{biblatex}and then\documentclass[ay]{myclass}? You could create your own options that way. (Though I agree with the now-deleted comment that loadingbiblatexoptions in the documentclass is probably not ideal.) – jon Oct 18 '16 at 21:08biblatex=style=authoryearwhich would then passstyle=authoryearto biblatex, but it's not ideal. It's somewhat off topic from this post, but ways to format a bibliography independent of ref manager would also be interesting. It may be worth making a separate post about that. – Erik Oct 18 '16 at 22:50biblatexobviously 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 ofbiblatexoptions, there is not much gain over just letting people loadbiblatexhowever 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 01:05biblatexin 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 06:21biblatexhas a special way to treat certain options, I can only assume that that way is incompatible with swooping up global options. – moewe Oct 19 '16 at 07:17keyvalet al.). Unfortunately, I don't know anything about that, though. – moewe Mar 05 '17 at 15:56