Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id t2UDwetk029583 for ; Mon, 30 Mar 2015 15:58:41 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx013) with ESMTPS (Nemesis) id 0LwEqk-1ZXJjx0yje-01829x for ; Mon, 30 Mar 2015 15:58:35 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t2UDu0Vs001676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Mar 2015 15:56:00 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t2UDInMl012566; Mon, 30 Mar 2015 15:56:00 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 12051857 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 30 Mar 2015 15:56:00 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t2UDu0TY028626 for ; Mon, 30 Mar 2015 15:56:00 +0200 Received: from ix.urz.uni-heidelberg.de (cyrus-portal01.urz.uni-heidelberg.de [129.206.100.97]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id t2UDtx7q010371 for ; Mon, 30 Mar 2015 15:56:00 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by ix.urz.uni-heidelberg.de (Postfix) with ESMTPS id AE3EC223F2FA for ; Mon, 30 Mar 2015 15:55:59 +0200 (CEST) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t2UDtq1A001549 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Mon, 30 Mar 2015 15:55:55 +0200 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YcaA7-0006Vk-Vt for LATEX-L@URZ.UNI-HEIDELBERG.DE; Mon, 30 Mar 2015 15:55:32 +0200 Received: from p5b391023.dip0.t-ipconnect.de ([91.57.16.35]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Mar 2015 15:55:31 +0200 Received: from news3 by p5b391023.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 30 Mar 2015 15:55:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Lines: 91 References: <42f7dnwoca7b$.dlg@nililand.de> <551945BC.5050603@nag.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b391023.dip0.t-ipconnect.de User-Agent: 40tude_Dialog/2.0.15.41de X-Spam-Level: X-Spam-Flag: No X-Envelope-From: X-Spam-Status: No, hits=-3.40 required=6 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS, URIBL_RHS_AHBL Message-ID: <1kyxkadepot6w.dlg@nililand.de> Date: Mon, 30 Mar 2015 15:54:59 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Ulrike Fischer Subject: Re: key-val syntax in class and package options To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:uhc2Uxk5NA0=:Yy4CSqoLdOp8qICa0nnVBoW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gxstCsgU9FCEQKHK/ ltB5+7zVynrvRJvxbbbIeZW1KrQcWRFavW9SiRO6HL1gXaO+urGfNGvNdHNSioeBBp/WD6Kcn i12GRoyK++hw+a5y4c1bW+G5doEvHS4C3Zq+tcQJVX0Mu9CrT6ZJ29kCKPnw+2x8lusVL/5Kd 03vlNdvD9kBhW5i0HO/pitAuFBg1o5VKH+cKFosHyb1ZbnBKmwt8S6IipV48j73vHzgGYNJMH O4PZPuLTR2W7G1r2eJftjm380fW2FalwQG6WVl44HKvqiephAugXO6HwQguacMnH9O9OJbFcb 0ddWCV3sBWe5/0kDeoc3yItrWPRpEMXMk9P955B1gRFvYpBMHWnFLiDYCl5bzcPiBYO87qpoK Sq4ocHSZL0ARLPA8OynXpXvKMhqKQmgiFWleBafJmZRZmcI20T X-UI-Loop:V01:YXlbEsJrNGY=:KeBFfASID6Fj0RM7oo0q0bdSDv29gRuvJ+t8CxOT0NA= X-UI-Out-Filterresults: notjunk:1; X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7694 Am Mon, 30 Mar 2015 13:46:52 +0100 schrieb David Carlisle: > On 30/03/2015 13:11, Ulrike Fischer wrote: >> The expanding use of key-val syntax in class and package options >> means that packages can break due to unknown values. I just tumble >> over this example in a real document: >> >> \documentclass[index=totoc]{scrbook} \usepackage{acro} >> \begin{document} \end{document} >> >> >> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! LaTeX error: >> "kernel/boolean-values-only" ! ! Key 'index' accepts boolean values >> only. >> >> >> It is easy to provoke a similar error with e.g. siunitx: >> >> w \usepackage{siunitx} \begin{document} blub \end{document} >> >> >> I'm wondering what could/should be done to avoid such situations. >> Should package authors avoid package options altogether and use setup >> commands? Or can they (how?) parse the keys in the option list in a >> way which doesn't gives errors but imply ignores unknown values? >> Should the documentclass filter the options? How? >> >> >> > > Ulrike, good question:-) > > I know you know most of the answer below already but stating the obvious > seemed a good place to start:-) > > The standard option processing processes options from both the > \usepackage and \documentclass commands, but in different modes > so that unknown keys only generate an error if used directly > on the package. > > for KV options the problems seem to be > > 1) There's no support in the kernel (possibly we could do something > about that, but looked at it before but it's tricky, this code's a bit > delicate and used in every latex document. There is a big incentive not > to change it:-) > > 2) there are two levels corresponding to "unknown option" > the key not being known at all, or the value not being known > for this key when handled by the package. > > > (1) means there are several different package kv handlers around > (directly in the file, as in hyperref, or versions for xkeyval, or > kvoptions or l3keys .... > > > It seems that currently typically unkown keys are being ignored but > unknown values of "known" keys are generating an error. > > Probably most compatible thing to do would be to process the > documentclass options in a mode that both unknown keys and values > were silently ignored, although there's an argument to say that > once you start getting richer syntax like this, packages should stop > handling the documentclass options, as weird effects will happen > if the keys just happen to have the same name or compatible values. Good summary ;-) Imho packages in general would like to ignore 99% of all global options anyway. So I'm inclined to say that this is the way package authors should use. With l3keys2e you can do it with \ProcessKeysPackageOptions, kvoptions are \ProcessLocalKeyvalOptions. But there remains a small number of options where propagation is wanted: draft, final, language names comes to my mind. draft and final are probably easy to catch, but language names are an open list. On the side the syntax is starting to diverge here too. Looking at babel options like "latin.medieval,main=english" or polyglossia setting \setmainlanguage[spelling = new]{german} package authors wouldn't have much joy with class options anyway and should better use a combination of \languagename and own package options to set languages. -- Ulrike Fischer http://www.troubleshooting-tex.de/