14

Is there any possibility to load a package with different options depending on the version of the package?

The command

\@ifpackagelater{package}{date}{true}{false}

only works if the package is already loaded and the options cannot be changed anymore.

To be precise, I want to load the biblatex package with different options depending on its version, since some options are not available in former versions.

10

While I don't know how to conditionally invoke package options at load time, in the case of biblatex most options (except style specifications, compatibility options and choosing the backend) can also bet set afterwards using \ExecuteBibliographyOptions. For example, the url option (which was introduced in biblatex v0.9) could be conditionally disabled using

\makeatletter
\@ifpackagelater{biblatex}{2010/02/14}{\ExecuteBibliographyOptions{url=false}}{}
\makeatother
2

The question isn't clear. If you're the author of the document, you know the options that shipped with the latest version of the package. They're in the package documentation (and in the source or .sty file, if you can read them).

The biblatex package has load-time and preamble options. For load-time options, it is advisable to call the latest options that you need and are available at the time you're loading the package. You can use the optional version argument (eg, [2011/07/29] below) to insist on the version (or a newer one) of the package you need.

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=authortitle-icomp]{biblatex}[2011/07/29]
\usepackage{hyperref}
\addbibresource{biblatex-examples.bib}

lockstep has indicated how preamble options may be invoked.

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.