[texhax] [tex-live] Fwd: [OS X TeX] Beamer in MacTeX 2009 vs. 2010

Heiko Oberdiek heiko.oberdiek at googlemail.com
Thu Sep 16 13:17:25 CEST 2010

On Thu, Sep 16, 2010 at 08:31:26AM +0100, Philip Taylor (Webmaster, Ret'd) wrote:

> Heiko Oberdiek wrote:
> >On Thu, Sep 16, 2010 at 08:09:59AM +0100, Philip Taylor (Webmaster, Ret'd) wrote:
> >>Is this really the case, Heiko ?  (I ask as someone who
> >>knows almost nothing about the internals of LaTeX).  For
> >>arbitrary \command [optional parameters] {mandatory
> >>parameters}, does LaTeX always remove all spaces from
> >>[optional parameters] before passing them on ?
> >
> >Yes, via \zap at space all spaces outside braces are removed.
> >Thus the following works:
> >   \usepackage[pdfborder={0 0 0}]{hyperref}
> Oh.  Well, I guess Leslie had a reason for making that way,
> but I've never seen it documented before.  Many thanks for
> the clarification.

The reason is probably that LaTeX doesn't support key value
options. At that time options mostly were simple words
(twocolumn, titlepage, draft, ...) sometime together
with digits (12pt, a4paper). Thus \zap at space removes the
spaces between options:
  \documentclass[final, 12pt, a4paper]{article}
Then the option list "final,12pt,a4paper" is processed further.
Also LaTeX expands the option list, e.g.:

| \xdef\@classoptionlist{\zap at space#2 \@empty}%

Also this is problematic if there are key value options
with fragile values.

xkeyval's xkvltxp.sty of Hendri Adriaens and
my kvoption's kvoptions kvoptions-patch are patching
the LaTeX kernel to prevent expansion and to support
key value options in a better way. Then the following

  \RequirePackage{kvoptions-patch} % or xkvltxp
  \usepackage[pdfborder=0 0 0]{hyperref}

is possible.

The packages differ a little, e.g. in the interpretation of values:

  \documentclass[pdfborder=0 0 1]{article}
  \usepackage[pdfborder=0 0 0]{hyperref}

Result: LaTeX Warning: Unused global option(s): [pdfborder=0 0 1].
Whereas kvoptions-patch interprets this situation in the sense
that key `pdfborder' *is* used but with different value.
For xkvltxp an option is the whole expression (key=value),
for kvoptions-patch it's the key only.

Other difference is the treatment of values:
* xkvltxp expands the options with values,
* kvoptions-patch tries to preserve them as much as possible.


With \foobar as an undefined macro (it might be defined in
the package that is later used and knows the option):
* supported by kvoptions-patch.
* breaks in case of xkvltxp.

Yours sincerely
  Heiko Oberdiek

More information about the texhax mailing list