Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id t2UCmnHD028241 for ; Mon, 30 Mar 2015 14:48:50 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx006) with ESMTPS (Nemesis) id 0M7CjO-1ZQh0E0u86-00x1FB for ; Mon, 30 Mar 2015 14:48:44 +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 t2UCl8aj006868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Mar 2015 14:47:08 +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 t2UBp0wZ012558; Mon, 30 Mar 2015 14:47:08 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 12046325 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 30 Mar 2015 14:47:08 +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 t2UCl8dN013042 for ; Mon, 30 Mar 2015 14:47:08 +0200 Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0110.outbound.protection.outlook.com [157.55.234.110]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id t2UCkwGq016255 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL) for ; Mon, 30 Mar 2015 14:47:01 +0200 Received: from [192.156.217.146] (62.254.111.82) by VI1PR05MB1247.eurprd05.prod.outlook.com (25.162.16.13) with Microsoft SMTP Server (TLS) id 15.1.118.21; Mon, 30 Mar 2015 12:46:57 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 References: <42f7dnwoca7b$.dlg@nililand.de> Content-Type: text/plain; charset="windows-1252"; format=flowed X-Originating-IP: [62.254.111.82] X-ClientProxiedBy: DB4PR01CA0055.eurprd01.prod.exchangelabs.com (10.242.152.45) To VI1PR05MB1247.eurprd05.prod.outlook.com (25.162.16.13) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR05MB1247; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10019020)(6049001)(6009001)(479174004)(51704005)(24454002)(76176999)(2950100001)(450100001)(62966003)(99136001)(33656002)(87976001)(74826001)(42186005)(74482002)(46102003)(65816999)(77156002)(50986999)(50466002)(107886001)(122386002)(40100003)(59896002)(36756003)(66066001)(65956001)(47776003)(92566002)(54356999)(87266999)(83506001);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR05MB1247;H:[192.156.217.146];FPR:;SPF:None;MLV:sfv;LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:VI1PR05MB1247;BCL:0;PCL:0;RULEID:;SRVR:VI1PR05MB1247; X-Forefront-PRVS: 05315CBE52 X-OriginatorOrg: nag.co.uk X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2015 12:46:57.3877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1247 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id t2UCl8dN013043 Message-ID: <551945BC.5050603@nag.co.uk> Date: Mon, 30 Mar 2015 13:46:52 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: David Carlisle Subject: Re: key-val syntax in class and package options To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <42f7dnwoca7b$.dlg@nililand.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:dDn+f58nTJA=:Fy9WbYH884ogS4YOF/ks2Dp36/ oMq72arXNscU58GkK/v2cBweb+jHRx9noMj/JJq0HKpeF9A18DGkP1rzoUHIJGExZMEH+hoQK K9meZ0YmAKztkl9njwQ827qedFQCvSatIJO80yaWq6RqTGZaFuYEtYib+6jYfheFNE49sD4er cNBpJ4fLn1S2BCdSltF9fUXVHd1NSqn9zkRhih5sP8es4RjB/ohmvl5UMyIQx3bm66+eS4+S4 w6Hu25bZWs4n1/klcY78aPTXcD/ff03rMCNndD2hSPQ3nBT7OBiM8ST0Xn3Q+HpOCH7isjCQq n9Ms91nqXbpasKnvP6z9PnADnVfz+PYyaCg1HBdVBSbQLQ8l57ERgIADcfMjZgbI2VkrhGS0e 3KT5xn94o1qE+lLv7t/CB8GxrHLEqV5/kgVEM2G1LYeQqp5ah1U6zWjBEhSTe4g4eR+lBWdg9 Q0vrcB+6t9ZfyonPDS2PCdpJFTAG7QWtJXzPtuHD8YfzRjAv7m3CLDsdlr9OheljnQTnJZi0D cNbeETosSvl9+OdFqarykOh0jUdxmPG41R46iHrLbMzhtmSzaaTqW/KMLEEeZzsFHAio/RyC1 Tq9iU77T49e2DpBbXZGoWkZb5ae0tw4p6O9IvcsjaLScGXLcmPQ/nVww9CQ+JMt8E26cZvWU1 neXVFw19vXVfG2sEq4GgtTeruiYURjVhw1urq7NSCGIIy/UmACCtWdczjmDgry85ZB8T1DZlR jXJ5dLm1K9QWlbmYErtM0Tn+yxR4XJbKkXc6f64Tp4iD7dWr4eQk/qAIIEFCqjpfE9ZeMlDt0 ZCfSs3nyfEPH71SCy8VBQzfRJ5XQ6dFj3q/JKozZ2OdTLt+TBGGeSRAbtmxaBtEiyztNAASHj zNnGogzYeaMnOLOqR1NpqS+T4NfKnDMUt2E9vQzVX8JQsQbocjaqb7ppTARsb683XgFG0lUa+ 9jYMBa9XCFTs9TtCYbE3wVV1mlnio8pTfiUKG0DOf3n66N+dVmzhkLJW1hG0LFsdYxwbjbu9Y MXQsQaeSGhmKjCG/NbWFdQ8jSPjkeSUOlIuabyP63+8gfEIyLPec/9ACYNeBw4gxzkzWNyXL1 SutGwuxgi8Crd6jkavt4V/ihwL/2g5UJ+hnQ14Va6P8IGUzECbrjuF/1zu2AA6y7sbn2g2ebf KQWaRimz5Tk1rAQgh4Bnu1TS9u6egnTi6lnAFBwicEYeKDOXbus0l40cNwquTt4gdM0EpOB4m wHnQOmh071vkCbqkV2Gp/hnrpebyiPiFEh1FnPn+IIxfgZdT4HXQEC+1DrNGmNLMmJBOlxo/P mFF32RILDZHgVy/baM9MkfHzN6VWRdfSHHwK5dc1HNnmsXiUGFZnPpOrpI7DjWgniXY5q8dbi 3NHdI34guZ5UNCPNUF0wuj7Dz45MMryS+JVW1akfI+nO38TwqLxuUqVcYXKv0xrdou+frXez/ vDeyRyW5IwgudiwK88GGgT7zSAwaYycdfZaGFa3mZm7qfo9g0gxEE05d1OjoLvBFN2kXagLA= = X-UI-Loop:V01:0AA51ObR4eQ=:GVZA+XTKSc+bqQH1HqFrM3fBj0y+MfL/x66yuu6r3V4= 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: 7693 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. David The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Microsoft Office 365.