LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Fri, 17 Sep 2010 20:03:04 +0200
Content-Disposition:
inline
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
MIME-Version:
1.0
Message-ID:
In-Reply-To:
Content-Type:
text/plain; charset=us-ascii
From:
Heiko Oberdiek <[log in to unmask]>
Parts/Attachments:
text/plain (69 lines)
On Fri, Sep 17, 2010 at 06:24:00PM +0100, Joseph Wright wrote:

> I've had a bug for siunitx about option parsing, which seems to be a
> kernel issue.  There is a difference in handling between
> 
>   \usepackage[%
>     output-decimal-marker ={,}
>   ]{siunitx}
> 
> and
> 
>   \usepackage[%
>     output-decimal-marker = {,}
>   ]{siunitx}
> 
> with the later (with an extra space) failing. Is this a kernel bug
> or a 'feature' of LaTeX2e?

LaTeX2e uses \zap@space to remove the spaces in the option lists.
As a side effect \zap@space also removes the braces around the
comma, because the group is followed immediately after a space:

  \zap@space #1 #2->#1\ifx #2\@empty \else \expandafter \zap@space \fi #2
  #1<-output-decimal-marker
  #2<-=

  \zap@space #1 #2->#1\ifx #2\@empty \else \expandafter \zap@space \fi #2
  #1<-=
  #2<-,

  \zap@space #1 #2->#1\ifx #2\@empty \else \expandafter \zap@space \fi #2
  #1<-,
  #2<-\@empty 

Then the comma becomes part of the syntax and is interpreted as
option separator.

For curiosity I have again compared the two packages kvoptions-patch
and xkvltxp:

\documentclass{article}
\usepackage{kvoptions-patch}
%\usepackage{xkvltxp}
\usepackage[
  output-decimal-marker = {,}
]{a}
\begin{document}
\end{document}

and a.sty:

\ProvidesPackage{a}
\DeclareOption*{\typeout{[\CurrentOption]}}
\ProcessOptions\relax
\endinput

Result:
* xkvltxp:
    [ output-decimal-marker = {,} ]
  It doesn't remove spaces.
* kvoptions-patch:
    [output-decimal-marker={,}]
  It removes the spaces before, after and around the equals sign.

Both left the braces intact.

Yours sincerely
  Heiko <[log in to unmask]>

ATOM RSS1 RSS2