Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id v71EbkdF015014 for ; Tue, 1 Aug 2017 16:37:47 +0200 Received: from relay2.uni-heidelberg.de ([129.206.119.212]) by mx-ha.gmx.net (mxgmx112 [212.227.17.5]) with ESMTPS (Nemesis) id 0MVr5o-1e9e2O3vB2-00X4d2 for ; Tue, 01 Aug 2017 16:37:41 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.15.2/8.15.2) with ESMTP id v71EbbYg003698; Tue, 1 Aug 2017 16:37:37 +0200 Received: from listserv (localhost [127.0.0.1]) by listserv.uni-heidelberg.de (Postfix) with ESMTP id EB607125EE1; Tue, 1 Aug 2017 16:37:36 +0200 (CEST) Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 19674492 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 1 Aug 2017 16:37:36 +0200 Delivered-To: LATEX-L@listserv.uni-heidelberg.de Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.119.212]) by listserv.uni-heidelberg.de (Postfix) with ESMTP id DAEA4125EE0 for ; Tue, 1 Aug 2017 16:37:36 +0200 (CEST) Received: from comedy.dante.de (comedy.dante.de [176.28.54.184]) by relay2.uni-heidelberg.de (8.15.2/8.15.2) with ESMTPS id v71EbVnu003658 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 1 Aug 2017 16:37:34 +0200 Received: from Franks-MacBookPro.fritz.box (p200300752E10160038BCF1A1B91CF17B.dip0.t-ipconnect.de [IPv6:2003:75:2e10:1600:38bc:f1a1:b91c:f17b]) (authenticated bits=0) by comedy.dante.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id v71EbTDm010112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Tue, 1 Aug 2017 16:37:30 +0200 References: <20170731.162337.688577912214660894.wl@gnu.org> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-DANTE-Spam-Score: -1.899 () BAYES_00,SPF_FAIL X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 X-Scanned-By: MIMEDefang 2.71 on IPv6:2a01:488:67:1000:b01c:36b8:0:1 Message-ID: <63285c18-e1f1-11b7-8876-dab4c8ea661a@latex-project.org> Date: Tue, 1 Aug 2017 16:37:29 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Frank Mittelbach Subject: Re: \usepackage problem with LaTeX 3 To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <20170731.162337.688577912214660894.wl@gnu.org> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-MIME-Autoconverted: from 8bit to quoted-printable by relay2.uni-heidelberg.de id v71EbbYg003698 Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-UI-Filterresults: notjunk:1;V01:K0:Rzjg8Ff0vyE=:WLve5aJONrqD5Nt9FAQKDEfCdp BCLo5D7hwf5gFNsTaDb7xa1dKKCTcYP9NXl0q7yAsftR9fRFGg3SKnlvVbe5vMaUJ6khiYdxS oiGLS8/efUk4H4mtykEFLqI/1uR+LbWpViPzcp4sO/8f7cQWdhyEUxl7oeKfMX4roz0XQNXFB VTa+dqT8j+4qqUPVLKtDKDmdLlQL2yYqYufR+zEJeS57XprXXstn0q54wXdrQz677q+ydoSae 7nmYfeE6Q7uyYPKhELJuB5ZVq7Z78tfK83ubYjApcHG7viWMxQs1m/vKeETXr2ObfS+kW24NI MKVHarDxhnIjhfLIPnwf9eHtWNe7LuEaUCd17uiBpfRvvFSAvG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TuCaPFFYaZ5KHdcH9mYYJcN0cU4T8J9b7qrvnz+NSX Wto9114Zt4Crq1Xv1MhJeQO49CKpx98zbm97UHRsackL7iERyCGlczf329Kd8zuwGnneHAjgU OoZCb0cWHVlGCp7u57ctZ8gxgz+ZcX+qDeJELAwRDjKzUohqj82nzdFxQfDUkgeKeUovrTzEh 78i2JT5jRAqhXvs/dMr4hJhCUIQ7Ca5Y5V25cUFJeyGYo40ijXUb/JuGTAZcvo438GN/ZyJNx nU= X-UI-Loop:V01:HvgGnpXhXBw=:ZP0eBDv5IOPfMpt59oVyizhprf0AtHQZDAtdbTg9+Xc= X-UI-Out-Filterresults: notjunk:1;V01:K0:Z/V5RV3ecec=:xxfNj+cNEixgl0Krmm7ptE VXd2wFNcMZZfcEhnJL6jdK0NOB9n5eKnSCnf7u7dJtb7p7qg+xfJ1VFavnE2cyU2Ohkl+P9Ck uf9DEpqa4JXa1RzmUWfRK51n2kqFh+KHz5MQTHrdPG2+EfFUB5q1CksucTcX9BjUFs04DThBq W4iCgIYhtq00UeE4QmfMLk6uSDgWtzMjC1C5/IJS3mjRjPe4zak2g61JEBmWy8ZrbNE9Ovah+ 6tPrzwhwVUl5icPX62m72oxlqMVM3VDSvDDPrhlo2laPPBHOFn61uwGc5htgn/ituMXa7qmq5 dueLFy+iQDCPEpgA4MEoJ7Ip0n1ny3nsyVEhX8RdHDUzW23Yf/sJG6LY8vCwqFmUbbCGHoF7n 4B9dybJgyvnoFtj7o8wUwpxFf7nWFQzVvUmMfo6SmtFk62mMf8zOkH6Jhd38BYwTkfoQHeBcq rx3ME9F5lWJntsePAOmtMBbvmO6QeJo= Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by h1439878.stratoserver.net id v71EbkdF015014 Status: R X-Status: X-Keywords: X-UID: 7989 Hi Werner > > [Not sure whether this is a generic LaTeX 3 problem or specific to > `fontspec' – however, I guess this question is of greater importance, > thus writing to this list.] I think it is neither but rather a general issue with TeX code, but as you say it is important the issue is that you can't execute code twice that is not meant to be executed twice. So if you clone some code that contains such material and you execute both the original and the new code (clone) you get errors, either subtle ones or simple ones like "not allowed" examples are from plain TeX things like \newwif from 2e stuff like \newcommand and in l3 anything _new:... typically checks like \newcommand if that is actually defining a free name so running any such code twice gives you error messages and if it is because of a newcommand then it will look like a 2e error and if it is necause if \newif like a plain TeX error and if it happens to be due to an expl3 construct like \bool_new:N then surprise :-) an L3 style error but effectively they all say the same: you asked me to generate something new but I see this is already there The way packages guard against this problem is simply by making sure that \usepackage or \RequirePackage will execute the external code only once. This means you can't load a package with different option sets (and we know that causes sometimes grief too) but on the whole that works fairly well. Of course it doesn't work if two different packages define the same constructs and both use \newcommand or something similar then the second package will bomb and if you change the order of loading the other one will. And normally this is a Good Thing (TM) as it signals that something incompatible is happening Now with the cloned code under a new name the situation is like that only here package A is supposed to be replaced by package A-clone So one way to achieve that is as Will pointed out to tell the world that once package A-clone was loaded package A was loaded too. And the mechanism for this is fairly simple: the loader looks in \csname ver@\endcsname and if that is \relax the it loads the file. Otherwise it expects that this holds the "version" or rather the date of the file (there are some macros dealing with different actions depending on package dates). So with \def\ver@fontenc.sty{2016/01/01} you would claim that that package from that date was now loaded. Thus libertine would not try to load it again. It is in fact enough to make it anything other than \relax the date is only useful if downstream there is any code that goes "do something special if fontspec is older than X" Maybe we should have a declaration \ThisCodeReplacesPackage{foo}{date} for the above but we don't (yet) Note that all this is only necessary if it is likely that package A is used inside other packages; with most packages that isn't really the case so that variants may coexist nicely even if they can never be loaded both (guess caption caption2/3/whathaveyou would be examples of this) ----------------- what else could you do? depending on how much change/extension there is you could simply write a package \usepackage{fontspec-extended-WL} and have the latter do - require fontspec % now it is definitely loaded - check if we are on xetex - if so update the xetex related code as needed - if not do nothing or complain that this is really for xetex and otherwise not needed I don't really see the need to clone fontspec and fontspec-xetex especially given that fontspec does so little and you aren't really changing it. cheers frank