Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a simple way to allow spaces in the options of a package using pgfopts to process them, which is local to that package i.e. I don't have to include some package in the main document before \documentclass. What I'm trying to do is pass font names to fontspec inside the package using pgfopts.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Basically, the answer here is 'no'. Space-stripping from class (and package) options is carried out by the LaTeX2e kernel before anything is passed to pgfopts or any other keyval-processing package. The two patches which exist for this (xkvltxp and kvoptions-patch) both have to be loaded before any options they 'protect' are used, which means before \documentclass for class options.

You can protect options from space stripping using braces, for example

\documentclass[foo={bar baz}]{mycls}

but this can cause issues as the kernel may choke on these when doing 'duplicate removal'. So in general it's best not to use options containing spaces when loading a package or class: set the options afterwards.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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