summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-05-31 03:01:06 +0000
committerNorbert Preining <norbert@preining.info>2020-05-31 03:01:06 +0000
commitdc6f1342c9b1e7c060d0409dfe0e64ff691003b6 (patch)
treef1954359c4e36d4bb66d06f296d9a8f3283b70bd /macros
parent58ef6a84ad11cea92cd3d886b5a95810cc4ea88c (diff)
CTAN sync 202005310301
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/LICENSE621
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/README.md252
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamercolorthemepureminimalistic.sty78
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerfontthemepureminimalistic.sty87
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerinnerthemepureminimalistic.sty96
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerouterthemepureminimalistic.sty125
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamertheme-pure-minimalistic-demo.pdfbin0 -> 234100 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamertheme-pure-minimalistic-demo.tex293
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerthemepureminimalistic.sty57
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/demo_bib.bib11
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/header_logo.pngbin0 -> 51087 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/header_logo_darkmode.pngbin0 -> 43275 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/institute_logo.pngbin0 -> 7351 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/institute_logo_darkmode.pngbin0 -> 23791 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdfbin224606 -> 224598 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdfbin66410 -> 66621 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex8
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa6-test.pdfbin110080 -> 0 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa6.pdfbin92893 -> 0 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx165
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx2
-rw-r--r--macros/latex/contrib/semantex/README.md30
-rw-r--r--macros/latex/contrib/semantex/semantex.pdfbin0 -> 221498 bytes
-rw-r--r--macros/latex/contrib/semantex/semantex.sty3101
-rw-r--r--macros/latex/contrib/semantex/semantex.tex1882
50 files changed, 6784 insertions, 74 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/LICENSE b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/LICENSE
new file mode 100644
index 0000000000..ed990f8cd2
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/LICENSE
@@ -0,0 +1,621 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/README.md b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/README.md
new file mode 100644
index 0000000000..816c008057
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/README.md
@@ -0,0 +1,252 @@
+<div align="center">
+
+![Pure Minimalistic Theme](logos/institute_logo_darkmode.png)
+[![Release](https://badgen.net/github/release/kai-tub/latex_beamer_pure_minimalistic/)](https://github.com/kai-tub/latex_beamer_pure_minimalistic/releases)
+[![GitHub license](https://badgen.net/github/license/kai-tub/latex_beamer_pure_minimalistic/)](https://github.com/kai-tub/latex_beamer_pure_minimalistic/blob/master/LICENSE)
+[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?color=blue)](CODE_OF_CONDUCT.md)
+[![Auto Release](https://img.shields.io/badge/release-auto.svg?colorA=888888&colorB=9B065A&label=auto&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAACzElEQVR4AYXBW2iVBQAA4O+/nLlLO9NM7JSXasko2ASZMaKyhRKEDH2ohxHVWy6EiIiiLOgiZG9CtdgG0VNQoJEXRogVgZYylI1skiKVITPTTtnv3M7+v8UvnG3M+r7APLIRxStn69qzqeBBrMYyBDiL4SD0VeFmRwtrkrI5IjP0F7rjzrSjvbTqwubiLZffySrhRrSghBJa8EBYY0NyLJt8bDBOtzbEY72TldQ1kRm6otana8JK3/kzN/3V/NBPU6HsNnNlZAz/ukOalb0RBJKeQnykd7LiX5Fp/YXuQlfUuhXbg8Di5GL9jbXFq/tLa86PpxPhAPrwCYaiorS8L/uuPJh1hZFbcR8mewrx0d7JShr3F7pNW4vX0GRakKWVk7taDq7uPvFWw8YkMcPVb+vfvfRZ1i7zqFwjtmFouL72y6C/0L0Ie3GvaQXRyYVB3YZNE32/+A/D9bVLcRB3yw3hkRCdaDUtFl6Ykr20aaLvKoqIXUdbMj6GFzAmdxfWx9iIRrkDr1f27cFONGMUo/gRI/jNbIMYxJOoR1cY0OGaVPb5z9mlKbyJP/EsdmIXvsFmM7Ql42nEblX3xI1BbYbTkXCqRnxUbgzPo4T7sQBNeBG7zbAiDI8nWfZDhQWYCG4PFr+HMBQ6l5VPJybeRyJXwsdYJ/cRnlJV0yB4ZlUYtFQIkMZnst8fRrPcKezHCblz2IInMIkPzbbyb9mW42nWInc2xmE0y61AJ06oGsXL5rcOK1UdCbEXiVwNXsEy/6+EbaiVG8eeEAfxvaoSBnCH61uOD7BS1Ul8ESHBKWxCrdyd6EYNKihgEVrwOAbQruoytuBYIFfAc3gVN6iawhjKyNCEpYhVJXgbOzARyaU4hCtYizq5EI1YgiUoIlT1B7ZjByqmRWYbwtdYjoWoN7+LOIQefIqKawLzK6ID69GGpQgwhhEcwGGUzfEPAiPqsCXadFsAAAAASUVORK5CYII=)](https://github.com/intuit/auto)
+
+![Build and Release](https://github.com/kai-tub/latex-beamer-pure-minimalistic/workflows/Build%20and%20Release/badge.svg)
+![Upload Assets](https://github.com/kai-tub/latex-beamer-pure-minimalistic/workflows/Upload%20Assets/badge.svg)
+
+A presentation theme for LaTeX-Beamer that is truly
+minimalistic, so that the focus is on the presenter and
+not on the slides.
+
+Requires the packages [fira](https://ctan.org/pkg/fira) and
+[silence](https://ctan.org/pkg/silence)
+to be installed on your system.
+To build the [beamertheme-pure-minimalistic-demo.tex](beamertheme-pure-minimalistic-demo.tex) file,
+[PGF/TikZ](https://ctan.org/pkg/pgf),
+[appendixnumberbeamer](https://ctan.org/pkg/appendixnumberbeamer),
+[fontaxes](https://ctan.org/pkg/fontaxes), and
+[mwe](https://ctan.org/pkg/mwe) are also required.
+
+</div>
+
+**Table of contents:**
+- [Main goals](#main-goals)
+- [Demo](#demo)
+- [Comparison](#comparison)
+ - [Dark mode](#dark-mode)
+ - [Light mode](#light-mode)
+- [Download](#download)
+- [Instructions](#instructions)
+- [Customize](#customize)
+ - [Customize Logos](#customize-logos)
+ - [Color](#color)
+ - [Fonts](#fonts)
+ - [Footer options](#footer-options)
+- [Release status](#release-status)
+- [License](#license)
+- [Contributing](#contributing)
+- [Contact](#contact)
+
+# Main goals
+- The theme produces no warnings
+- It should be looking *good* in a 4:3 and 16:9 aspect ratio, without the need to change anything.
+- Provides an environment for vertical-spaced items
+- Easy option to either use light- or dark-mode
+- Is designed to be purely minimalistic without any distractions
+- Easily use own logos
+
+# Demo
+A sample document can be seen in the
+[beamertheme-pure-minimalistic-demo.pdf](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/demo.pdf),
+produced from [beamertheme-pure-minimalistic-demo.tex](beamertheme-pure-minimalistic-beamertheme-pure-minimalistic-demo.tex).
+The document shows all of the
+design decisions, as well as some packages and commands that
+work well for presentations. For example, starting the
+frame counter after the *Table of Contents* section does not
+include backup slides to the total frame counter.
+Please use [beamertheme-pure-minimalistic-demo.tex](beamertheme-pure-minimalistic-demo.tex)
+as a starting point, as exhaustive comments
+were added for a smooth start.
+
+[Here](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/beamertheme-pure-minimalistic-demo.png)
+a short *inline teaser* version of the [beamertheme-pure-minimalistic-demo.pdf](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/beamertheme-pure-minimalistic-demo.pdf) can be seen.
+
+![beamertheme-pure-minimalistic-demo.png](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/beamertheme-pure-minimalistic-demo.png)
+
+Please look at the [PDF](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/beamertheme-pure-minimalistic-demo.pdf) version for high-resolution images. :)
+
+I highly recommend [pympress](https://github.com/Cimbali/pympress) to add videos to the presentation.
+This presentation tool works perfectly with
+Beamer presentations and is available on all major OS!
+
+# Comparison
+To show some differences between the default LaTeX beamer
+theme and the pure minimalistic beamer theme
+(inspired by the [auriga beamer theme](https://github.com/anishathalye/auriga)):
+
+## Dark mode
+On the [left](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/compare_examples/comparison_dark.png)
+is the pure minimalistic theme in dark mode,
+and on the [right](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/compare_examples/comparison_dark.png) is the default beamer theme.
+![comparison-dark](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/compare_examples/comparison_dark.png)
+
+## Light mode
+On the [left](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/compare_examples/comparison_light.png) is the pure minimalistic theme in light mode,
+and on the [right](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/compare_examples/comparison_light.png) is the default beamer theme.
+
+![comparison-light](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/compare_examples/comparison_light.png)
+
+# Download
+Download the latest release by going to the [release page](https://github.com/kai-tub/latex_beamer_pure_minimalistic/releases).
+
+# Instructions
+After downloading, copy the files named
+beamer*pureminimalistic.sty into the same folder as your
+LaTeX source file. Then include the theme by writing:
+```latex
+\documentclass[aspectratio=169]{beamer}
+
+\usetheme[]{pureminimalistic}
+```
+
+# Customize
+
+All options and commands are also described in detail in the
+[beamertheme-pure-minimalistic-demo.pdf](https://github.com/kai-tub/latex-beamer-pure-minimalistic/wiki/beamertheme-pure-minimalistic-demo.pdf).
+
+## Customize Logos
+By default, the theme expects the logos to be present in a
+folder `logos` relative to the `.sty` file with the names:
+`header_logo`, `header_logo_darkmode`,
+`institute_logo`, and `institute_logo_darkmode`.
+
+But you can easily change the logos used.
+There are 3 commands used to define which logos
+are used and how they are formatted:
+- `\logotitle` – Command used for title page. Here `\linewidth`
+ corresponds to the entire paper width.
+- `\logoheader` – Command used for the header. Here `\linewidth`
+ corresponds to a smaller box, as the horizontal space is
+ shared with the title.
+- `\logofooter` – Command used for the footer. Here `\linewidth`
+ corresponds to a smaller box, as the horizontal space is
+ shared with the footer text.
+
+To load your own logos for the title, header, and footer set them
+with:
+
+```latex
+\renewcommand{\logotitle}{\includegraphics%
+ [width=.2\linewidth]{alternative_logo/gameboy.png}}
+\renewcommand{\logoheader}{\includegraphics%
+ [width=.5\linewidth]{alternative_logo/gameboy.png}}
+\renewcommand{\logofooter}{\includegraphics%
+ [width=.15\linewidth]{alternative_logo/console.png}}
+```
+
+![alternative-title-logo](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/alternative_title_logo.png)
+
+![alternative-header-footer-logo](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/alternative_header_footer_logo.png)
+
+## Color
+The theme includes two default color options.
+The default color theme is light.
+The alternative color theme is the dark color theme, enabled with:
+
+```latex
+\usetheme[darkmode]{pureminimalistic}
+```
+
+The themes color commands can be redefined to
+customize the appearance.
+
+Please set these *after* loading the theme
+and *before* `\begin{document}` for the changes to take effect.
+
+The following theme color commands exist:
+- `\beamertextcolor`
+- `\beamerbgcolor`
+- `\beamerfootertextcolor`
+- `\beamertitlecolor`
+
+To redefine the background, for example, the following commands
+could be used:
+```latex
+\usetheme{pureminimalistic}
+\definecolor{textcolor}{RGB}{0, 0, 120}
+\definecolor{title}{RGB}{0, 0, 0}
+\definecolor{footercolor}{RGB}{133, 133, 133}
+\definecolor{bg}{RGB}{25, 116, 210}
+
+\renewcommand{\beamertextcolor}{textcolor}
+\renewcommand{\beamerbgcolor}{bg}
+\renewcommand{\beamerfootertextcolor}{footercolor}
+\renewcommand{\beamertitlecolor}{title}
+```
+
+![custom-color](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/custom_color.png)
+
+## Fonts
+The default fonts are the [Fira Fonts](https://bboxtype.com/typefaces/FiraSans/#!layout=specimen).
+This decision was inspired by another awesome beamer theme,
+the [Focus beamer theme](https://github.com/elauksap/focus-beamertheme).
+
+![fira-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/fira_font.png)
+
+Some dislike the Fira Fonts. As an alternative, this
+theme also integrates the *Helvetica* fonts.
+The Helvetica fonts are a classical font choice for presentations.
+
+To use the Helvetica fonts:
+
+```latex
+\usetheme[helvetica, darkmode]{pureminimalistic}
+```
+
+![helvetica-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/helvetica_font.png)
+
+If you prefer the default fonts, disable the Fira Fonts with:
+
+```latex
+\usetheme[nofirafonts, darkmode]{pureminimalistic}
+```
+
+![helvetica-fonts](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/default_font.png)
+
+## Footer options
+
+**Show max slide numbers**
+
+To show the maximum number of slides, enable the
+`showmaxslides` option:
+
+```latex
+\usetheme[showmaxslides, darkmode]{pureminimalistic}
+```
+
+![show-max-slides](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/show_max_slides.png)
+
+**Disable footer**
+
+To disable the footer altogether, including the institute image,
+set the `nofooter` option:
+
+```latex
+\usetheme[nofooter, darkmode]{pureminimalistic}
+```
+
+![no-footer](https://raw.githubusercontent.com/wiki/kai-tub/latex-beamer-pure-minimalistic/minimal_examples/no_footer.png)
+
+# Release status
+The next steps and thoughts about the upcoming release
+with possible features can be seen on the [project
+page](https://github.com/kai-tub/latex_beamer_pure_minimalistic/projects/1).
+
+# License
+This software is released under the GNU GPL v3.0
+[License](LICENSE).
+
+# Contributing
+Please see the [contribution guidelines](CONTRIBUTING.md) for more information.
+
+As always, PRs are welcome. :)
+
+# Contact
+If you have any comments, issues, or suggestions, please
+open an issue on GitHub.
+I will try my best to help as much as I can. :)
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamercolorthemepureminimalistic.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamercolorthemepureminimalistic.sty
new file mode 100644
index 0000000000..ded9343170
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamercolorthemepureminimalistic.sty
@@ -0,0 +1,78 @@
+% A pure minimalistic LaTeX-Beamer theme for everyone to use.
+% Copyright (C) 2020 Kai Norman Clasen
+
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+% This file is part of beamerthemepureminimalistic.
+
+% If problems/bugs are found or enhancements are desired, please contact
+% me over: https://github.com/kai-tub/latex-beamer-pure-minimalistic
+
+\ProvidesPackage{beamercolorthemepureminimalistic}[v1.2.4]
+\RequirePackage{ifthen}
+\mode<presentation>
+
+\newboolean{darkmode}
+\setboolean{darkmode}{false}
+
+\DeclareOptionBeamer{darkmode}{\setboolean{darkmode}{true}}
+\ProcessOptionsBeamer
+
+\definecolor{pureminimalistic@text@black}{RGB}{0,0,0}
+\definecolor{pureminimalistic@text@gray}{RGB}{113,113,113}
+\definecolor{pureminimalistic@text@whiter_gray}{RGB}{200,200,200}
+\definecolor{pureminimalistic@text@red}{RGB}{190,15,30}
+\definecolor{pureminimalistic@text@white}{RGB}{255, 255, 255}
+
+\newcommand{\beamertitlecolor}{pureminimalistic@text@red}
+
+\ifthenelse{\boolean{darkmode}}{
+ \newcommand{\beamertextcolor}{pureminimalistic@text@white}%
+ \newcommand{\beamerbgcolor}{pureminimalistic@text@black}%
+ \newcommand{\beamerfootertextcolor}{pureminimalistic@text@whiter_gray}%
+}{%
+ \newcommand{\beamertextcolor}{pureminimalistic@text@black}%
+ \newcommand{\beamerbgcolor}{pureminimalistic@text@white}%
+ \newcommand{\beamerfootertextcolor}{pureminimalistic@text@gray}%
+}
+
+\setbeamercolor*{normal text}{fg=\beamertextcolor, bg=\beamerbgcolor}
+\setbeamercolor*{alerted text}{fg=\beamertitlecolor, bg=\beamerbgcolor}
+\setbeamercolor*{footline}{fg=\beamerfootertextcolor, bg=\beamerbgcolor}
+\setbeamercolor*{frametitle}{fg=\beamertitlecolor, bg=\beamerbgcolor}
+
+\setbeamercolor*{author}{parent=normal text}
+\setbeamercolor*{title}{parent=frametitle}
+
+\setbeamercolor*{section in toc}{parent=normal text}
+\setbeamercolor*{subsection in toc}{parent=normal text}
+\setbeamercolor*{subsubsection in toc}{parent=normal text}
+
+\setbeamercolor*{enumerate item}{parent=normal text}
+\setbeamercolor*{enumerate subitem}{parent=normal text}
+\setbeamercolor*{enumerate subsubitem}{parent=normal text}
+
+\setbeamercolor*{itemize item}{parent=normal text}
+\setbeamercolor*{itemize subitem}{parent=normal text}
+\setbeamercolor*{itemize subsubitem}{parent=normal text}
+
+\setbeamercolor*{bibliography item}{parent=normal text}
+\setbeamercolor*{bibliography entry title}{parent=normal text}
+\setbeamercolor*{bibliography entry author}{parent=normal text}
+\setbeamercolor*{bibliography entry location}{parent=normal text}
+\setbeamercolor*{bibliography entry note}{parent=normal text}
+
+\setbeamercolor*{caption name}{parent=normal text}
+
+\mode<all> \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerfontthemepureminimalistic.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerfontthemepureminimalistic.sty
new file mode 100644
index 0000000000..7df83b361e
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerfontthemepureminimalistic.sty
@@ -0,0 +1,87 @@
+% A pure minimalistic LaTeX-Beamer theme for everyone to use.
+% Copyright (C) 2020 Kai Norman Clasen
+
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+% This file is part of beamerthemepureminimalistic.
+
+% If problems/bugs are found or enhancements are desired, please contact
+% me over: https://github.com/kai-tub/latex-beamer-pure-minimalistic
+
+\ProvidesPackage{beamerfontthemepureminimalistic}[v1.2.4]
+\RequirePackage{ifthen}
+\mode<presentation>
+
+\newboolean{nofirafonts}
+\setboolean{nofirafonts}{false}
+\newboolean{helvetica}
+\setboolean{helvetica}{false}
+
+\DeclareOptionBeamer{nofirafonts}{\setboolean{nofirafonts}{true}}
+\DeclareOptionBeamer{helvetica}{\setboolean{helvetica}{true}}
+\ProcessOptionsBeamer
+
+\RequirePackage{silence}
+% I have no clue how I can fix this warning
+\WarningFilter{latex}{Font shape declaration has incorrect series value}
+
+\ifthenelse{\boolean{helvetica}}{%
+ % If Helvetica overwrites the fira fonts settings
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage[scaled]{helvet}
+}{%
+ \ifthenelse{\boolean{nofirafonts}}{%
+ % Load default fonts
+ }{%
+ % By default load Fira
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage[sfdefault]{FiraSans}
+ \RequirePackage{FiraMono}
+ }
+}
+
+\renewcommand\normalsize{\fontsize{12pt}{14pt}\selectfont}
+\renewcommand\small{\fontsize{10pt}{12pt}\selectfont}
+\renewcommand\large{\fontsize{14pt}{16pt}\selectfont}
+\renewcommand\Large{\fontsize{16pt}{18pt}\selectfont}
+
+\setbeamerfont{normal text}{family=\sffamily,size*={12pt}{14pt},series=\mdseries}
+\setbeamerfont{alerted text}{parent=normal text}
+
+\setbeamerfont{structure}{parent=normal text,series=\mdseries}
+
+\setbeamerfont{footline}{parent=structure,size*={8pt}{10pt}}
+
+\setbeamerfont{title}{size*={14pt}{16pt},parent=alerted text,shape=\scshape}
+\setbeamerfont{title in head/foot}{parent=footline,series=\bfseries}
+
+\setbeamerfont{subtitle}{parent=title,shape=\upshape}
+
+\setbeamerfont{section in toc}{parent=normal text}
+\setbeamerfont{subsection in toc}{parent=section in toc}
+\setbeamerfont{subsubsection in toc}{parent=subsection in toc}
+
+\setbeamerfont{author}{parent=normal text}
+\setbeamerfont{author in head/foot}{parent=footline}
+\setbeamerfont*{institute}{parent=normal text}
+
+\setbeamerfont{frametitle}{parent=alerted text,size*={16pt}{18pt}}
+\setbeamerfont{caption}{series=\normalfont, size=\small}
+\setbeamerfont{caption name}{series=\normalfont, size=\small}
+
+\setbeamerfont*{itemize/enumerate body}{parent=normal text}
+\setbeamerfont*{itemize/enumerate subbody}{parent=itemize/enumerate body}
+\setbeamerfont*{itemize/enumerate subsubbody}{parent=itemize/enumerate subbody}
+
+\mode<all> \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerinnerthemepureminimalistic.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerinnerthemepureminimalistic.sty
new file mode 100644
index 0000000000..1bc26800b8
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerinnerthemepureminimalistic.sty
@@ -0,0 +1,96 @@
+% A pure minimalistic LaTeX-Beamer theme for everyone to use.
+% Copyright (C) 2020 Kai Norman Clasen
+
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+% This file is part of beamerthemepureminimalistic.
+
+% If problems/bugs are found or enhancements are desired, please contact
+% me over: https://github.com/kai-tub/latex-beamer-pure-minimalistic
+
+\ProvidesPackage{beamerinnerthemepureminimalistic}[v1.2.4]
+
+\mode<presentation>
+
+\def\itemsymbol{\raisebox{0.3ex}{\small$\bullet$}}
+\let\svitem\item
+\newenvironment{vfilleditems}{%
+ \begin{itemize} %
+ \let\olditem\item
+ \renewcommand\item[1][\itemsymbol]{\vfill\svitem[##1]}}%
+ {\end{itemize}\vfill}
+
+\defbeamertemplate*{section in toc}{pureminimalistic}{%
+ \hspace{0.5em} \inserttocsectionnumber.~\inserttocsection
+}
+
+\defbeamertemplate*{subsection in toc}{pureminimalistic}{%
+ \hspace{1.5em} \inserttocsectionnumber.\inserttocsubsectionnumber~\inserttocsubsection\par
+}
+
+\defbeamertemplate*{subsubsection in toc}{pureminimalistic}{% No one should use subsubsections in a presentation
+}
+
+\defbeamertemplate*{itemize item}{pureminimalistic}{%
+ \usebeamerfont*{itemize item}\itemsymbol
+}
+
+\defbeamertemplate*{itemize subitem}{pureminimalistic}{%
+ \usebeamerfont*{itemize subitem}\itemsymbol
+}
+
+\defbeamertemplate*{itemize subsubitem}{pureminimalistic}{%
+ \usebeamerfont*{itemize subsubitem}\itemsymbol
+}
+
+\defbeamertemplate*{bibliography item}{pureminimalistic}{%
+ \insertbiblabel
+}
+
+\setlength{\abovecaptionskip}{0ex}
+\setlength{\belowcaptionskip}{1ex}
+
+\setbeamertemplate{caption}{%
+ \insertcaption%
+}
+
+\defbeamertemplate*{title page}{pureminimalistic}[1][]
+{
+ \usebeamerfont{title}
+ \begin{beamercolorbox}[sep=0ex,wd=\textwidth,dp=1ex]{headline}
+ \vskip 3pt
+ \hfill\logotitle\par% \logotitle is defined in outertheme
+ \vskip 75pt
+ \parbox{\linewidth}{%
+ \begin{beamercolorbox}[wd=\textwidth]{title}%
+ {\inserttitle}%
+ \end{beamercolorbox}
+
+ \begin{beamercolorbox}[wd=\textwidth,dp=1ex]{author}%
+ \vskip 3pt
+ \small\usebeamerfont{author}\usebeamercolor{author}\insertauthor $\quad$
+ \ifx\insertinstitute\@empty%
+ \else%
+ {\usebeamerfont{institute}\insertinstitute $\quad$}%
+ \fi%
+ \ifx\insertsubtitle\@empty%
+ \else%
+ {\usebeamerfont{subtitle}\insertsubtitle}%
+ \fi%
+ \end{beamercolorbox}%
+ }%
+ \end{beamercolorbox}
+}
+
+\mode<all> \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerouterthemepureminimalistic.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerouterthemepureminimalistic.sty
new file mode 100644
index 0000000000..0e501bf5aa
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerouterthemepureminimalistic.sty
@@ -0,0 +1,125 @@
+% A pure minimalistic LaTeX-Beamer theme for everyone to use.
+% Copyright (C) 2020 Kai Norman Clasen
+
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+% This file is part of beamerthemepureminimalistic.
+
+% If problems/bugs are found or enhancements are desired, please contact
+% me over: https://github.com/kai-tub/latex-beamer-pure-minimalistic
+
+\ProvidesPackage{beamerouterthemepureminimalistic}[v1.2.4]
+\RequirePackage{ifthen}
+\RequirePackage{etoolbox}
+\RequirePackage{calc}
+
+\mode<presentation>
+
+\newboolean{showmaxslides}
+\setboolean{showmaxslides}{false}
+
+\newboolean{nofooter}
+\setboolean{nofooter}{false}
+
+\DeclareOptionBeamer{showmaxslides}{\setboolean{showmaxslides}{true}}
+\DeclareOptionBeamer{nofooter}{\setboolean{nofooter}{true}}
+
+\ProcessOptionsBeamer
+
+% invertcolor is already processed in colortheme
+\ifthenelse{\boolean{darkmode}}{%
+ \newcommand{\headerpath}{logos/header_logo_darkmode}
+ \newcommand{\institutepath}{logos/institute_logo_darkmode}
+}{%
+ \newcommand{\headerpath}{logos/header_logo}
+ \newcommand{\institutepath}{logos/institute_logo}
+}
+% The header shares the horizontal space with the frame title in normal mode
+% a relative width value between .5 and .8 should usually be the best
+\newcommand{\logoheader}{\includegraphics[width=.5\linewidth]{\headerpath}}
+% For the title page, the logo is embedded in the total frame, meaning that \linewidth
+% here refers to the complete \paperwidth, small width values of < .4 are usually best.
+\newcommand{\logotitle}{\includegraphics[width=.2\linewidth]{\headerpath}}
+% The footer will only use part of the space under the line. Usually almost the
+% full linewidth should be used
+\newcommand{\logofooter}{\includegraphics[width=.8\linewidth]{\institutepath}}
+
+\defbeamertemplate*{frametitle}{largetitle}{
+ \logotitle
+}
+
+\newlength{\myleftmargin}
+\setlength{\myleftmargin}{.0625\paperwidth}
+\newlength{\myrightmargin}
+\setlength{\myrightmargin}{.0625\paperwidth}
+\newlength{\mytextlength}
+\setlength{\mytextlength}{\paperwidth - \myleftmargin - \myrightmargin}
+\newlength{\myfooterheight}
+\setlength{\myfooterheight}{.08\paperheight}
+
+\setbeamersize{text margin left=\myleftmargin, text margin right=\myrightmargin}
+
+\defbeamertemplate*{frametitle}{pureminimalistictitle}{
+ \vskip 10pt
+ \leavevmode
+ \begin{beamercolorbox}[sep=0ex, wd=.65\paperwidth, left]{frametitle}
+ \usebeamerfont{frametitle}%
+ \insertframetitle%
+ \end{beamercolorbox}%
+ \begin{beamercolorbox}[sep=0pt, wd=.2\paperwidth, right]{headline}
+ \logoheader
+ \end{beamercolorbox}
+}%
+
+\defbeamertemplate*{footline}{pureminimalisticfooter}{%
+ \ifthenelse{\boolean{nofooter}}{}{%
+ \leavevmode
+ \begin{beamercolorbox}[sep=0pt, wd=\myleftmargin, ht=\myfooterheight, dp=1ex]{footline}
+ \end{beamercolorbox}%
+ \begin{beamercolorbox}[sep=0pt, wd=\mytextlength, ht=\myfooterheight, dp=1ex]{footline}
+ \parbox{\linewidth}%
+ % Don't ask me why I had to insert a space/character after \usebeamercolor
+ % for it to have an effect on \hrule. Same goes for \color{white} \hrule
+ { \usebeamercolor[fg]{normal text}\ \hrule }
+ \leavevmode
+ \begin{beamercolorbox}[sep=0mm, wd=.6\paperwidth, ht=\myfooterheight]{footline}%
+ \usebeamerfont{footline}%
+ \vbox to\myfooterheight{%
+ \vfil%
+ \insertshorttitle{} $~|~$ %
+ \insertshortauthor{} $\quad$ %
+ \insertshortsubtitle{}\par%
+ Page \insertframenumber\ifthenelse{%
+ \boolean{showmaxslides}}%
+ {/\inserttotalframenumber}%
+ {}\par%
+ \vfil%
+ \vfil%
+ }%
+ \end{beamercolorbox}%
+ \begin{beamercolorbox}[sep=0mm, wd=.275\paperwidth,right, ht=\myfooterheight]{footline}
+ \vbox to\myfooterheight{%
+ \vfil%
+ \logofooter
+ \vfil%
+ \vfil%
+ }%
+ \end{beamercolorbox}%
+ \end{beamercolorbox}%
+ \begin{beamercolorbox}[sep=0pt, wd=\myrightmargin, dp=1ex, ht=\myfooterheight]{footline}
+ \end{beamercolorbox}
+ }
+ }
+
+\mode<all> \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamertheme-pure-minimalistic-demo.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamertheme-pure-minimalistic-demo.pdf
new file mode 100644
index 0000000000..67a3d29822
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamertheme-pure-minimalistic-demo.pdf
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamertheme-pure-minimalistic-demo.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamertheme-pure-minimalistic-demo.tex
new file mode 100644
index 0000000000..888f85b64d
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamertheme-pure-minimalistic-demo.tex
@@ -0,0 +1,293 @@
+% A pure minimalistic LaTeX-Beamer theme for everyone to use.
+% Copyright (C) 2020 Kai Norman Clasen
+
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+% This file is part of beamerthemepureminimalistic.
+
+% If problems/bugs are found or enhancements are desired, please contact
+% me over: https://github.com/kai-tub/latex-beamer-pure-minimalistic
+
+\documentclass[aspectratio=169]{beamer}
+% should also look nice for the classic aspectratio
+% of course, than the text has to be refitted
+% \documentclass{beamer}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{tikz}
+\usetheme[showmaxslides, darkmode]{pureminimalistic}
+
+\usepackage[backend=biber, doi=false, maxbibnames=2, maxcitenames=2,%
+ style=numeric, sorting=none, url=false, eprint=false]{biblatex}
+\addbibresource{demo_bib.bib}
+% this makes it possible to add backup slides, without counting them
+\usepackage{appendixnumberbeamer}
+\renewcommand{\appendixname}{\texorpdfstring{\translate{appendix}}{appendix}}
+
+% if loaded after begin{document} a warning will appear: "pdfauthor already used"
+\title[short title]{This is the normal length of a research paper:
+always longer than you would expect}
+\author{Kai Norman Clasen}
+\institute{Insitute name}
+\date{\today}
+
+\begin{document}
+% has to be loaded outside of a frame to work!
+\maketitle
+
+% For longer table of contents, I find it cleaner to
+% use no footline.
+\begin{frame}[plain, noframenumbering]{Outline}
+ \tableofcontents
+\end{frame}
+
+\section{Aspect ratio}
+\begin{frame}[fragile]{Aspect ratio}
+ This pdf uses a 16:9 aspect ratio. To utilize
+ this version, simply use:
+ \begin{verbatim}
+ \documentclass[aspectratio=169]{beamer}
+ \end{verbatim}
+ \vfill
+ The default is a 4:3 aspect ratio.
+ \begin{verbatim}
+ \documentclass{beamer}
+ \end{verbatim}
+\end{frame}
+
+\section{vfilleditems}
+\begin{frame}[fragile]{Using vfilleditems}
+ \begin{verbatim}
+ Use the provided \vfilleditems environment
+ to create nicely spaced bullet points.
+
+ \begin{vfilleditems}
+ \item I like it to have my bullet points
+ \item evenly spaced from one another
+ \item then few bullet points, are not crammed on
+ the upper part of the slide
+ \end{vfilleditems}
+ \end{verbatim}
+\end{frame}
+
+\begin{frame}{Using vfilleditems}
+ \begin{vfilleditems}
+ \item I like it to have my bullet points
+ \item evenly spaced from one another
+ \item then few bullet points, are not crammed on
+ the upper part of the slide
+ \end{vfilleditems}
+\end{frame}
+
+\section{Fonts}
+\begin{frame}[fragile]{Fonts}
+ Fonts:
+
+ {\small This is small}
+
+ This is normal size
+
+ {\large This is large}
+ \vfill
+ Per default the \emph{Fira Font} Package is
+ used. The \emph{Helvetica Font} is also bundled into this
+ package.
+\end{frame}
+
+\begin{frame}[fragile]{Fonts}
+ To use \emph{Helvetica} instead of \emph{Fira Fonts}
+ \begin{verbatim}
+ \usetheme[helvetica]{pureminimalistic}
+ \end{verbatim}
+ \vfill
+ To disable the \emph{Fira Fonts} and use the default font
+ \begin{verbatim}
+ \usetheme[nofirafonts]{pureminimalistic}
+ \end{verbatim}
+\end{frame}
+
+\section{Color}
+\begin{frame}[fragile]{Color}
+ To overwrite the theme color
+ \begin{enumerate}
+ \item Define a new color
+ \item redefine the themes color (before document begins)
+ \end{enumerate}
+\end{frame}
+
+\begin{frame}[fragile]{Change color example}
+ \small
+ \begin{verbatim}
+ \usetheme{pureminimalistic}
+ \definecolor{textcolor}{RGB}{0, 0, 120}
+ \definecolor{title}{RGB}{0, 0, 0}
+ \definecolor{footercolor}{RGB}{133, 133, 133}
+ \definecolor{bg}{RGB}{25, 116, 210}
+
+ \renewcommand{\beamertextcolor}{textcolor}
+ \renewcommand{\beamerbgcolor}{bg}
+ \renewcommand{\beamerfootertextcolor}{footercolor}
+ \renewcommand{\beamertitlecolor}{title}
+ \end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]{Dark mode}
+ I've included a simple way to use a dark mode
+ color theme. To use the dark color mode, provide the \texttt{darkmode}
+ option.
+ \begin{verbatim}
+ \usetheme[darkmode]{pureminimalistic}
+ \end{verbatim}
+ Sometimes, the logos have to be changed to look nice on a
+ dark background. For now, I am simply loading different
+ files if \texttt{darkmode} is used.
+\end{frame}
+
+\section{Graphics}
+\begin{frame}{Logos}
+ Commands setting the logos:
+ \begin{vfilleditems}
+ \item \texttt{\textbackslash{}logotitle} -- Command used for the title page.
+ Here \texttt{\textbackslash{}linewidth} corresponds to the entire paper width.
+ \item \texttt{\textbackslash{}logoheader} -- Command used for the header.
+ Here \texttt{\textbackslash{}linewidth} corresponds to a smaller box,
+ as the horizontal space is shared with the title.
+ \item \texttt{\textbackslash{}logofooter} -- Command used for the footer.
+ Here \texttt{\textbackslash{}linewidth} corresponds to a smaller box,
+ as the horizontal space is shared with the footer text.
+ \end{vfilleditems}
+\end{frame}
+
+\begin{frame}[fragile]{Logos -- Load own logo}
+ To use your own logos, simply redefine the commands and adjust the sizes.
+ \begin{verbatim}
+ \renewcommand{\logotitle}{\includegraphics%
+ [width=.2\linewidth]{alternative_logo/gameboy.png}}
+ \renewcommand{\logoheader}{\includegraphics%
+ [width=.5\linewidth]{alternative_logo/gameboy.png}}
+ \renewcommand{\logofooter}{\includegraphics%
+ [width=.15\linewidth]{alternative_logo/console.png}}
+ \end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]{Logos -- Disable logo}
+ To disable the logo, overwrite the default logo command with an empty
+ command.
+ \begin{verbatim}
+ \renewcommand{\logofooter}{}
+ \end{verbatim}
+\end{frame}
+
+\begin{frame}{Figures}
+ I also changed the default caption settings to not
+ include \texttt{Figure:} and reduced the font size.
+ \begin{figure}[H]
+ \centering
+ \begin{columns}[T]
+ \begin{column}{.3\linewidth}
+ \includegraphics[width=\linewidth]{example-image-a}
+ \caption{Example A}
+ \end{column}
+ \begin{column}{.3\linewidth}
+ \includegraphics[width=\linewidth]{example-image-b}
+ \caption{Example B}
+ \end{column}
+ \end{columns}
+ \end{figure}
+\end{frame}
+
+\begin{frame}[fragile]{Figures -- Set background watermark}
+ There is no extra option to define a background watermark, but here
+ is a command that could be used to create one manually:
+ \vfill
+ \begin{verbatim}
+\setbeamertemplate{background}{%
+ \tikz[overlay,remember picture]%
+ \node[opacity=0.8]at (current page.center)%
+ {\includegraphics[width=.2\linewidth]%
+ {example-image-a}};%
+}
+ \end{verbatim}
+\end{frame}
+
+{
+ \setbeamertemplate{background}{%
+ \tikz[overlay,remember picture]%
+ \node[opacity=0.8]at (current page.center)%
+ {\includegraphics[width=.2\linewidth]%
+ {example-image-a}};%
+ }
+\begin{frame}{Figures -- Set background watermark}
+ Usually you would add this command to specific
+ frames by enclosing this command and all desired frames with
+ curly brackets.
+ \vfill
+ See the source code of this \emph{*.tex} file for an
+ example.
+\end{frame}
+}
+
+
+\section{Footer options}
+\begin{frame}[fragile]{Disable footer}
+ If you do not want to use a footer, disable it with:
+ \begin{verbatim}
+ \usetheme[nofooter]{pureminimalistic}
+ \end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]{Show max slide numbers}
+ For these slides, I used the option to
+ show the maximum number of slides. To activate it
+ one has to activate it with:
+ \begin{verbatim}
+ \usetheme[showmaxslides]{pureminimalistic}
+ \end{verbatim}
+ Usually, I prefer to not show the maximum number of
+ slides, as the people tend to lose focus if they know
+ the last few slides are shown.
+\end{frame}
+
+\section{Citations}
+\begin{frame}{Citations}
+ I've also changed the bibliography options to be minimalistic:
+
+ Just showing a simple \texttt{\textbackslash{}cite} \cite{AlexNet}
+ \vfill
+ \printbibliography
+\end{frame}
+
+\appendix % do not count the following slides for the total number
+\section*{Backup Slides}
+\begin{frame}[plain, noframenumbering]
+ \centering
+ \vfill
+ {\fontsize{40}{50}\selectfont Backup Slides}
+ \vfill
+\end{frame}
+
+\begin{frame}{What happened to the page numbering?}
+ \begin{vfilleditems}
+ \item I've used the \texttt{appendixnumberbeamer}
+ package, which resets the frame counting after calling
+ \texttt{\textbackslash{}appendix}
+ \item Depending on the used pdf viewer, the total
+ count of frames shouldn't include the backup slides and
+ won't demotivate the audience.
+ \item Usually, I would use a \texttt{plain} frame
+ for the backup slides.
+ \end{vfilleditems}
+\end{frame}
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerthemepureminimalistic.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerthemepureminimalistic.sty
new file mode 100644
index 0000000000..0f38bd834f
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/beamerthemepureminimalistic.sty
@@ -0,0 +1,57 @@
+% A pure minimalistic LaTeX-Beamer theme for everyone to use.
+% Copyright (C) 2020 Kai Norman Clasen
+
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+% This file is part of beamerthemepureminimalistic.
+
+% If problems/bugs are found or enhancements are desired, please contact
+% me over: https://github.com/kai-tub/latex-beamer-pure-minimalistic
+
+\ProvidesPackage{beamerthemepureminimalistic}[v1.2.4]
+
+\mode<presentation>
+
+\DeclareOptionBeamer{darkmode}{\PassOptionsToPackage{darkmode}{beamercolorthemepureminimalistic}}
+\DeclareOptionBeamer{showmaxslides}{\PassOptionsToPackage{showmaxslides}{beamerouterthemepureminimalistic}}
+\DeclareOptionBeamer{nofooter}{\PassOptionsToPackage{nofooter}{beamerouterthemepureminimalistic}}
+\DeclareOptionBeamer{nofirafonts}{\PassOptionsToPackage{nofirafonts}{beamerfontthemepureminimalistic}}
+\DeclareOptionBeamer{helvetica}{\PassOptionsToPackage{helvetica}{beamerfontthemepureminimalistic}}
+
+\ProcessOptionsBeamer
+
+% Settings
+\usefonttheme{pureminimalistic}
+\usecolortheme{pureminimalistic}
+\useoutertheme{pureminimalistic}
+\useinnertheme{pureminimalistic}
+
+\setbeamertemplate{navigation symbols}{}%
+\beamerdefaultoverlayspecification{}
+
+\def\maketitle{%
+ {%Set beamer template only works for the following frames.
+ % Would need a different way to support calling \maketitle in
+ % a frame environment
+ \setbeamertemplate{footline}{}%
+ \setbeamertemplate{frametitle}[largetitle]%
+
+ \begin{frame}[noframenumbering]%
+ \titlepage%
+ \end{frame}%
+ }
+}
+
+
+\mode<all>
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/demo_bib.bib b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/demo_bib.bib
new file mode 100644
index 0000000000..a60ab761f5
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/demo_bib.bib
@@ -0,0 +1,11 @@
+% Encoding: UTF-8
+@InCollection{AlexNet,
+ author = {Alex Krizhevsky and Ilya Sutskever and Geoffrey E. Hinton},
+ title = {{ImageNet} Classification with Deep Convolutional Neural Networks},
+ booktitle = {Advances in Neural Information Processing Systems 25},
+ publisher = {Curran Associates, Inc.},
+ year = {2012},
+ pages = {1097--1105},
+}
+
+@Comment{jabref-meta: databaseType:bibtex;}
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/header_logo.png b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/header_logo.png
new file mode 100644
index 0000000000..b04baa858c
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/header_logo.png
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/header_logo_darkmode.png b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/header_logo_darkmode.png
new file mode 100644
index 0000000000..ff9ac690de
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/header_logo_darkmode.png
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/institute_logo.png b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/institute_logo.png
new file mode 100644
index 0000000000..f8d4669c16
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/institute_logo.png
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/institute_logo_darkmode.png b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/institute_logo_darkmode.png
new file mode 100644
index 0000000000..21e32a9003
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-pure-minimalistic/logos/institute_logo_darkmode.png
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
index 972dc51bb2..7c4cf8f8d5 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{american-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{american-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{american}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
index 3f5b459d88..7071b6e422 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.bbx}[2020/05/05\space v9.12\space APA biblatex references style]
+\ProvidesFile{apa.bbx}[2020/05/30\space v9.13\space APA biblatex references style]
\RequireBiber[3]
\RequireBibliographyStyle{standard}
\urlstyle{same} % APA examples all have URLs in same font as text
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
index 5db566a725..f5ac0bb007 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.cbx}[2020/05/05\space v9.12\space APA biblatex citation style]
+\ProvidesFile{apa.cbx}[2020/05/30\space v9.13\space APA biblatex citation style]
\RequireBiber[3]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
index e43ea42963..aa5ccb7134 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx
@@ -12,7 +12,7 @@
%%
%% The Current Maintainer of this work is Philip Kime.
-\ProvidesFile{apa.dbx}[2020/05/05\space v9.12\space APA biblatex style data model]
+\ProvidesFile{apa.dbx}[2020/05/30\space v9.13\space APA biblatex style data model]
\RequireBiber[3]
\DeclareDatamodelEntrytypes{
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
index 0ce160ef37..fa509e76d5 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{austrian-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{austrian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{austrian}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
index 67a3ab7034..51fe552e24 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
index 060ef251e5..591c07058a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
index 5e46846f84..20605c0738 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex
@@ -24,7 +24,7 @@
url={http://mirror.ctan.org/macros/latex/exptl/biblatex-contrib/biblatex-apa/},
author={Philip Kime},
email={Philip@kime.org.uk},
- revision={9.12},
+ revision={9.13},
date={\today}}
\hypersetup{%
@@ -397,7 +397,11 @@ the examples.
\begin{changelog}
-\begin{release}{9.11}{2020-05-05}
+\begin{release}{9.13}{2020-05-30}
+\item Fixed Spanish long date format
+\end{release}
+
+\begin{release}{9.12}{2020-05-05}
\item Fixed INPROCEEDINGS/PROCEEDINGS
\end{release}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa6-test.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa6-test.pdf
deleted file mode 100644
index c056b75b0f..0000000000
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa6-test.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa6.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa6.pdf
deleted file mode 100644
index 0a57a7be90..0000000000
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa6.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
index e700f19109..c769ed240d 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{brazilian-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{brazilian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{brazilian}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
index eefca870a3..a8587b0ecc 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{british-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{british-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{british}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
index 0b9cf0d3ae..8cbc8bc31d 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{danish-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{danish-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{danish}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
index 036e9da076..a628eb3da9 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{dutch-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{dutch-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{dutch}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
index 13ffad747b..53dd289fcf 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{english-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{english-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{english}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
index 5e77896946..e8dc9eb374 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{french-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{french-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{french}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
index 33c72b9fd9..607d7686f7 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{galician-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{galician-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{galician}
\setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
index ed643434a6..68e235370a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{german-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{german-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{german}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
index 7c3d5480f5..7cf6cc7cdf 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{greek-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{greek-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{greek}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
index f8052bf705..8b1730ceaf 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{italian-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{italian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{italian}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
index 1ba2490f0a..375d04724e 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{naustrian-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{naustrian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{naustrian}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
index e88f26e3ba..09ed5836c8 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{ngerman-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{ngerman-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{ngerman}
% Following DGPs guidlines for German/Austrian
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
index 9c08165e50..ce0e551221 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{norsk-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{norsk-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{norsk}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
index ab3b089979..334d6c55a8 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{norwegian-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{norwegian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{norwegian}
\NewBibliographyString{revisededition}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
index d5225a0321..2cd715be0a 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{nswissgerman-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{nswissgerman-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{nswissgerman}
% Following DGPs guidlines for German/Austrian/Swiss German
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
index c0593dc742..1061781117 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{nynorsk-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{nynorsk-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{nynorsk}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
index 59cac63b76..d8d7f60c99 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{portuguese-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{portuguese-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{portuguese}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
index aa3a40c199..f82ec500e0 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{russian-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{russian-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{russian}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
index 6cf598049a..e2c5c29a0c 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{slovene-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{slovene-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{slovene}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
index 9206498d3f..7c975a11f4 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{spanish-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{spanish-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{spanish}
\setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced
@@ -165,69 +165,142 @@
\protected\def\mkbibdateapalong#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
- {\clearfield{labelmonth}%
- \clearfield{labelday}}
- {}%
+ and not test {\ifkeyword{nonacademic}} }
+ {\clearfield{labelmonth}%
+ \clearfield{labelday}}
+ {}%
\iffieldundef{#1}%
{}%
- {\iffieldbibstring{#1}{\biblcstring{\thefield{#1}}}{\thefield{#1}}}%
- \iffieldundef{#2}%
- {}%
- {\iffieldundef{#1}%
- {}%
- {\addcomma\addspace}%
- \mkbibmonth{\thefield{#2}}}%
+ {\iffieldbibstring{#1}{\biblcstring{\thefield{#1}}}{\thefield{#1}}%
+ \ifboolexpr{test {\iffieldundef{#3}} and test {\iffieldundef{#2}}}
+ {}
+ {\addcomma\space}}%
\iffieldundef{#3}%
{}%
- {\iffieldundef{#2}%
- {}%
- {\addspace}%
- \stripzeros{\thefield{#3}}}}%
+ {\stripzeros{\thefield{#3}}%
+ \iffieldundef{#2}
+ {}
+ {\addspace de\space}}%
+ \iffieldundef{#2}%
+ {}%
+ {\mkbibmonth{\thefield{#2}}}}%
\protected\def\mkbibdateapalongextra#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
- {\clearfield{labelmonth}%
- \clearfield{labelday}}
- {}%
+ and not test {\ifkeyword{nonacademic}} }
+ {\clearfield{labelmonth}%
+ \clearfield{labelday}}
+ {}%
\iffieldundef{#1}%
{}%
- {\iffieldbibstring{#1}{\biblcstring{\thefield{#1}}}{\thefield{#1}}\printfield{extradate}}%
- \iffieldundef{#2}%
- {}%
- {\iffieldundef{#1}%
- {}%
- {\addcomma\addspace}%
+ {\iffieldbibstring{#1}{\biblcstring{\thefield{#1}}}{\thefield{#1}}%
+ \printfield{extradate}%
+ \ifboolexpr{test {\iffieldundef{#3}} and test {\iffieldundef{#2}}}
+ {}
+ {\addcomma\space}}%
\iffieldundef{#3}%
{}%
- {\iffieldundef{#2}%
- {}%
- {\stripzeros{\thefield{#3}}\addspace de\addspace}}%
- \mkbibmonth{\thefield{#2}}%
-}}%
+ {\stripzeros{\thefield{#3}}%
+ \iffieldundef{#2}
+ {}
+ {\addspace de\space}}%
+ \iffieldundef{#2}%
+ {}%
+ {\mkbibmonth{\thefield{#2}}}}%
\protected\def\mkbibdateapalongmdy#1#2#3{%
% As per 10.1, Articles only have year
\ifboolexpr{ test {\ifentrytype{article}}
- and not test {\ifkeyword{nonacademic}} }
- {\clearfield{labelmonth}%
- \clearfield{labelday}}
- {}%
+ and not test {\ifkeyword{nonacademic}} }
+ {\clearfield{labelmonth}%
+ \clearfield{labelday}}
+ {}%
\iffieldundef{#3}%
- {}%
- {el\addspace\stripzeros{\thefield{#3}}}%
+ {}%
+ {el\addspace\stripzeros{\thefield{#3}}}%
\iffieldundef{#2}%
- {\addspace{en}\addspace}%
- {\iffieldundef{#3}%
- {en\addspace}%
- {\addspace{de}\addspace}%
- \mkbibmonth{\thefield{#2}}{\addspace{de}\addspace}}%
+ {\addspace{en}\addspace}%
+ {\iffieldundef{#3}%
+ {en\addspace}%
+ {\addspace{de}\addspace}%
+ \mkbibmonth{\thefield{#2}}{\addspace{de}\addspace}}%
\iffieldundef{#1}%
+ {}%
+ {\iffieldundef{#2}%
{}%
- {\iffieldundef{#2}%
- {}%
- {\addspace}%
- \thefield{#1}}}}
+ {\addspace}%
+ \thefield{#1}}}%
+ \def\apa@lbx@es@mkdaterangeapalong#1{%
+ \begingroup
+ \blx@metadateinfo{#1}%
+ \iffieldundef{#1year}{}
+ {\datecircaprint
+ \ifstrequal{#1}{url}% URL dates are unlikely to be BCE ...
+ {\printtext{%
+ \iffieldsequal{#1year}{#1endyear}
+ {\iffieldsequal{#1month}{#1endmonth}
+ {\mkbibdateapalongmdy{}{}{#1day}}
+ {\mkbibdateapalongmdy{}{#1month}{#1day}}}
+ {\mkbibdateapalongmdy{#1year}{#1month}{#1day}}%
+ \iffieldundef{#1endyear}%
+ {}%
+ {\iffieldequalstr{#1endyear}{}% open-ended range?
+ {\mbox{\bibdatedash}}
+ {\bibdatedash%
+ \mkbibdateapalongmdy{#1endyear}{#1endmonth}{#1endday}}}%
+ \dateuncertainprint}}
+ {\printtext{%
+ \ifboolexpr{test {\iffieldsequal{#1year}{#1endyear}}
+ and test {\iffieldsequal{#1month}{#1endmonth}}}
+ {\mkbibdateapalong{#1year}{}{#1day}}%
+ {\mkbibdateapalong{#1year}{#1month}{#1day}}%
+ \dateeraprint{#1year}%
+ \iffieldundef{#1endyear}%
+ {}%
+ {\iffieldequalstr{#1endyear}{}% open-ended range?
+ {\mbox{\bibdatedash}}
+ {\bibdatedash%
+ \iffieldsequal{#1year}{#1endyear}%
+ {\mkbibdateapalong{}{#1endmonth}{#1endday}}%
+ {\mkbibdateapalong{#1endyear}{#1endmonth}{#1endday}%
+ \dateeraprint{#1endyear}}}%
+ \enddateuncertainprint}}}}%
+ \endgroup}%
+ \def\apa@lbx@es@mkdaterangeapalongextra#1{%
+ \begingroup
+ \blx@metadateinfo{#1}%
+ \iffieldundef{#1year}{}
+ {\printtext{%
+ \datecircaprint
+ \ifboolexpr{test {\iffieldsequal{#1year}{#1endyear}}
+ and test {\iffieldsequal{#1month}{#1endmonth}}}
+ {\mkbibdateapalongextra{#1year}{}{#1day}}%
+ {\mkbibdateapalongextra{#1year}{#1month}{#1day}}%
+ \dateeraprint{#1year}%
+ \dateuncertainprint
+ \iffieldundef{#1endyear}%
+ {}%
+ {\iffieldequalstr{#1endyear}{}% open-ended range?
+ {\mbox{\bibdatedash}}
+ {\bibdatedash%
+ \iffieldsequal{#1year}{#1endyear}%
+ {\mkbibdateapalongextra{}{#1endmonth}{#1endday}}
+ {\mkbibdateapalongextra{#1endyear}{#1endmonth}{#1endday}%
+ \dateeraprint{#1endyear}}}%
+ \enddateuncertainprint}}}%
+ \endgroup}%
+ \savecommand\mkdaterangeapalong
+ \savecommand\mkdaterangeapalongextra
+ \def\mkdaterangeapalong{%
+ \apa@lbx@es@mkdaterangeapalong}%
+ \def\mkdaterangeapalongextra#1{%
+ \apa@lbx@es@mkdaterangeapalongextra{#1}}%
+}
+
+
+\UndeclareBibliographyExtras{%
+ \restorecommand\mkdaterangeapalong
+ \restorecommand\mkdaterangeapalongextra
+}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
index f653f2cda5..db122c2273 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{swedish-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{swedish-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{swedish}
\NewBibliographyString{jourarticle}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
index cabc3685aa..fde62e3aba 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx
@@ -1,4 +1,4 @@
-\ProvidesFile{swissgerman-apa.lbx}[2020/05/05\space v9.12\space APA biblatex localisation]
+\ProvidesFile{swissgerman-apa.lbx}[2020/05/30\space v9.13\space APA biblatex localisation]
\InheritBibliographyExtras{swissgerman}
% Following DGPs guidlines for German/Austrian/Swiss German
diff --git a/macros/latex/contrib/semantex/README.md b/macros/latex/contrib/semantex/README.md
new file mode 100644
index 0000000000..31c5e7f563
--- /dev/null
+++ b/macros/latex/contrib/semantex/README.md
@@ -0,0 +1,30 @@
+SemanTeX - object-oriented mathematics
+--------------------------------------
+
+The SemanTeX package for LaTeX delivers a more semantic, systematized way of writing mathematics compared to the ordinary math syntax. The system is
+object-oriented and uses keyval syntax, and everything is highly
+customizable. At the same time, care has been taken to make it
+intuitive, natural, practical, and with an easy-to-use and lightweight
+syntax.
+
+----------------------------------------------------------------
+SemanTeX --- object-oriented mathematics
+Maintained by Sebastian Ørsted
+E-mail: sorsted@gmail.com
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+----------------------------------------------------------------
+
+Copyright (C) 2020 by Sebastian Ørsted <sorsted@gmail.com>
+
+The package is loaded via \usepackage{semantex}
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License (LPPL), either
+version 1.3c of this license or (at your option) any later
+version. The latest version of this license is in the file:
+
+http://www.latex-project.org/lppl.txt
+
+This work is "maintained" (as per LPPL maintenance status) by
+Sebastian Ørsted. \ No newline at end of file
diff --git a/macros/latex/contrib/semantex/semantex.pdf b/macros/latex/contrib/semantex/semantex.pdf
new file mode 100644
index 0000000000..e8a02eae88
--- /dev/null
+++ b/macros/latex/contrib/semantex/semantex.pdf
Binary files differ
diff --git a/macros/latex/contrib/semantex/semantex.sty b/macros/latex/contrib/semantex/semantex.sty
new file mode 100644
index 0000000000..8e8361c8dc
--- /dev/null
+++ b/macros/latex/contrib/semantex/semantex.sty
@@ -0,0 +1,3101 @@
+\RequirePackage{expl3,xparse}
+\ProvidesExplPackage{semantex}{2020/05/30}{0.1alpha}{}
+% IMPORTANT:
+
+% Because of the definition of \semantexnormalscaling, the package now requires amsmath
+
+% Think about changing “upper” etc. into “supper”, whereas what is now
+% “upper” could be called “uppernosep” or something similar.
+
+% Fix left sub- and superscripts, e.g. the right spacing
+
+% Allow “.” (nothing) as delimiter, even in the case of normal or \big etc
+
+% Instead of checking if you are equal to semantexvarible when doing
+% inheritance, check if you are your own parent. This allows multiple
+% “primitive” classes.
+% Also remove commands like \newsemantexvariable etc.
+% in order to force people to create their own classes
+
+% Create 2valuekeys, 3valuekeys etc.
+
+% Test if \exp_not:n can be removed in #1 (=\keyvalue) if
+% another \exp_not:n is added in the data manipulation commands.
+
+% Build groups and \ext_args:NV around the definition of
+% \l_semantex_key_value_temp in order to only
+% define this command locally.
+
+% Allow two keys, nopar and absolutelynopar. The difference is that
+% nopar becomes par if there is more than one argument
+
+% Allow left arguments!
+
+
+% LIST OF BUGS:
+
+%IM A change has been made in catlimits. It shows the existence of a
+%IM kind of bug in semantex
+
+%IM Removed \!\!\!\! in catlimits
+
+
+\msg_new:nnnn { semantex } { keyval_not_found } { Unknown~key~#1~passed~to~object~#2~on~input~line~\msg_line_number: } {}
+
+\msg_new:nnnn { semantex } { arg_valuekey_not_found } { Unknown~argument~key~#1~passed~to~object~#2~on~input~line~\msg_line_number: } {}
+
+\msg_new:nnnn { semantex } { tl_not_found } { Unknown~data~#1~passed~to~object~#2~on~input~line~\msg_line_number: } {}
+%IM should be changed so that this is passed to the actual object, not
+%IM the parent object, e.g., by having a third argument containing the
+%IM actual object in \g_semantex_data_tl_get:nn
+
+
+\msg_new:nnnn { semantex } { parent_not_found } { Unknown~class~#1~set~as~parent~of~object~#2~on~input~line~\msg_line_number: } {}
+
+\msg_new:nnnn { semantex } { data_tl_not_found } { Unknown~data~#1~passed~to~object~#2~on~input~line~\msg_line_number: } {}
+
+% Extra cs variants we need:
+
+\cs_generate_variant:Nn \keyval_parse:NNn { cco }
+\cs_generate_variant:Nn \tl_if_blank:nTF { vTF }
+
+\tl_set:Nn \semantexbullet {\raisebox{-0.25ex}{\scalebox{1.2}{$\cdot$}}}
+\tl_set:Nn \semantexdoublebullet {\semantexbullet\semantexbullet}
+
+\tl_set:Nn \semantexslot { \mathord{-} }
+
+
+
+
+
+\DeclareDocumentCommand\newbinaryclass{mO{}} % new binary-type class
+{
+ % #1 = class name
+ % #2 = options
+ \semantexnewclass { #1 } { #2 }
+ \exp_args:Nc\DeclareDocumentCommand{#1}{mo}{
+ % the actual \#1 command
+ \IfValueTF{##2}
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol = { ##1 }, ##2 }
+ }
+ {
+ \semantexrenderclass { #1 } { symbol = { ##1 } }
+ }
+ }
+ \exp_args:Nc\DeclareDocumentCommand{#1withoptions}{mmo}{
+ \IfValueTF{##3}
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol = { ##2 }, ##1, ##3 }
+ }
+ {
+ \semantexrenderclass { #1 } { symbol = { ##2 }, ##1 }
+ }
+ }
+ \exp_args:Nc\DeclareDocumentCommand{new#1}{mgO{}}
+ {
+ % the command for creating a new object of class #1
+ % ##1 = command name, with backslash
+ % ##2 = symbol
+ % ##3 = options
+ \IfValueTF{##2}
+ {
+ \semantexnewobject { #1 } ##1 { parent = #1, symbol = { ##2 }, ##3 }
+ }
+ {
+ \semantexnewobject { #1 } ##1 { parent = #1, ##3 }
+ }
+ % create the object with name ##1
+ \DeclareDocumentCommand{##1}{o}{
+ % the actual \##1 command
+ \IfValueTF { ####1 }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1 }
+ }
+ {
+ \semantexrenderobject { ##1 } { }
+ }
+ }
+ }
+}
+
+%IM Consider using \semantexIfNoValueOrDotTF on the argument
+
+\DeclareDocumentCommand\newvariableclass{mO{}} % new variable-type class
+{
+ % #1 = class name
+ % #2 = options
+ \semantexnewclass { #1 } { #2 }
+ \exp_args:Nc\DeclareDocumentCommand{#1}{mog}{
+ % the actual \#1 command
+ \IfValueTF { ##2 }
+ {
+ \IfValueTF { ##3 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1},##2,arg={##3} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1},##2}
+ }
+ }
+ {
+ \IfValueTF { ##3 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1},arg={##3} }
+ }
+ {
+ \semantexrenderclass { #1 } { symbol={##1} }
+ }
+ }
+ }
+ \exp_args:Nc\DeclareDocumentCommand{#1withoptions}{mmog}{
+ \IfValueTF { ##3 }
+ {
+ \IfValueTF { ##4 }{
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1, ##3,arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1, ##3 }
+ }
+ }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1,arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { symbol={##2}, ##1 }
+ }
+ }
+ }
+ \exp_args:Nc\DeclareDocumentCommand{new#1}{mgO{}}
+ {
+ % the command for creating a new object of class #1
+ % ##1 = command name, with backslash
+ % ##2 = symbol
+ % ##3 = options
+ \IfValueTF{##2}
+ {
+ \semantexnewobject { #1 } ##1 { parent = #1, symbol = { ##2 }, ##3 }
+ }
+ {
+ \semantexnewobject { #1 } ##1 { parent = #1, ##3 }
+ }
+ % creates the object with name ##1
+ \DeclareDocumentCommand{##1}{og}{
+ % the actual \##1 command
+ \IfValueTF{####1}{
+ \IfValueTF{####2}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1, arg={####2} }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1}
+ }
+ }
+ {
+ \IfValueTF{####2}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,arg={####2} }
+ }
+ {
+ \semantexrenderobject { ##1 } {}
+ }
+ }
+ }
+ }
+}
+
+\DeclareDocumentCommand\newcohomologyclass{mO{}} % new cohomology-type class
+% The intention is to phase this out; use variable type instead,
+%for the sake of consistency in notation.
+{
+ % #1 = class name
+ % #2 = options
+ \semantexnewclass { #1 } { #2 }
+ \exp_args:Nc\DeclareDocumentCommand{#1}{mogg}{
+ % the actual \#1 command
+ \IfValueTF{##2}
+ {
+ \IfValueTF { ##3 }
+ {
+ \semantexifeqTF { ##3 }{ * }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ##2, *, arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ##2, * }
+ }
+ }
+ {
+ \semantexifeqTF { ##3 }{ ** }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ##2, **, arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ##2, ** }
+ }
+ }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ##2, degreedefault={##3}, arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ##2, degreedefault={##3} }
+ }
+ }
+ }
+ }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ##2, arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ##2 }
+ }
+ }
+ }
+ {
+ \IfValueTF { ##3 }
+ {
+ \semantexifeqTF { ##3 }{ * }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol={##1}, *, arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol={##1}, *}
+ }
+ }
+ {
+ \semantexifeqTF { ##3 }{ ** }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, **, arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, ** }
+ }
+ }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, degreedefault={##3}, arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, degreedefault={##3} }
+ }
+ }
+ }
+ }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##1}, arg={##4} }
+ }
+ {
+ \semantexrenderclass { #1 } { symbol={##1}, arg={##4} }
+ }
+ }
+ }
+ }
+ \exp_args:Nc\DeclareDocumentCommand{#1withoptions}{mmogg}{
+ \IfValueTF{##3}
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexifeqTF { ##4 }{ * }
+ {
+ \IfValueTF { ##5 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1, ##3, *, arg={##5} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1, ##3, * }
+ }
+ }
+ {
+ \semantexifeqTF { ##4 }{ ** }
+ {
+ \IfValueTF { ##5 }
+ {
+ \semantexrenderclass { #1 } {ifoutput=true, symbol={##2}, ##1, ##3, **, arg={##5} }
+ }
+ {
+ \semantexrenderclass { #1 } {ifoutput=true, symbol={##2}, ##1, ##3, ** }
+ }
+ }
+ {
+ \IfValueTF { ##5 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1,##3, degreedefault={##4}, arg={##5} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1,##3, degreedefault={##4} }
+ }
+ }
+ }
+ }
+ {
+ \IfValueTF { ##5 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1, ##3, arg={##5} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1, ##3 }
+ }
+ }
+ }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexifeqTF { ##4 }{ * }
+ {
+ \IfValueTF { ##5 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol={##2} ,##1, *, arg={##5} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol={##2} ,##1, *}
+ }
+ }
+ {
+ \semantexifeqTF { ##4 }{ ** }
+ {
+ \IfValueTF { ##5 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol={##2} , ##1, **, arg={##5} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol={##2} , ##1, ** }
+ }
+ }
+ {
+ \IfValueTF { ##5 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol={##2}, ##1, degreedefault={##4}, arg={##5} }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol={##2}, ##1, degreedefault={##4} }
+ }
+ }
+ }
+ }
+ {
+ \IfValueTF { ##5 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true,symbol={##2}, ##1, arg={##5} }
+ }
+ {
+ \semantexrenderclass { #1 } { symbol={##2}, ##1 }
+ }
+ }
+ }
+ }
+ \exp_args:Nc\DeclareDocumentCommand{new#1}{mgO{}}
+ {
+ % the command for creating a new object of class #1
+ % ##1 = command name, with backslash
+ % ##2 = symbol
+ % ##3 = options
+ \IfValueTF{##2}
+ {
+ \semantexnewobject { #1 } { ##1 }{ parent = #1, symbol = { ##2 }, ##3 }
+ }
+ {
+ \semantexnewobject { #1 } { ##1 }{ parent = #1, ##3 }
+ }
+ % creates the object with name ##1
+ \DeclareDocumentCommand{##1}{ogg}{
+ % the actual \##1 command
+ \IfValueTF{####1}
+ {
+ \IfValueTF{####2}
+ {
+ \semantexifeqTF { ####2 } { * }
+ {
+ \IfValueTF{####3}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1, *, arg={ ####3 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1, * }
+ }
+ }
+ {
+ \semantexifeqTF { ####2 } { ** }
+ {
+ \IfValueTF{####3}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true, ####1, **, arg={ ####3 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true, ####1, ** }
+ }
+ }
+ {
+ \IfValueTF{####3}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1, degreedefault={ ####2 }, arg={ ####3 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1, degreedefault={ ####2 } }
+ }
+ }
+ }
+ }
+ {
+ \IfValueTF{####3}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1, arg={ ####3 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1 }
+ }
+ }
+ }
+ {
+ \IfValueTF{####2}
+ {
+ \semantexifeqTF { ####2 } { * }
+ {
+ \IfValueTF{####3}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true, *, arg={ ####3 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true, * }
+ }
+ }
+ {
+ \semantexifeqTF { ####2 } { ** }
+ {
+ \IfValueTF{####3}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,**, arg={ ####3 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,** }
+ }
+ }
+ {
+ \IfValueTF{####3}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,degreedefault={ ####2 }, arg={ ####3 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,degreedefault={ ####2 } }
+ }
+ }
+ }
+ }
+ {
+ \IfValueTF{####3}
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true, arg={ ####3 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+%\DeclareDocumentCommand\newtupleclass{mO{}} % new tuple-type class
+%{
+% % #1 = class name
+% % #2 = options
+% \semantexnewclass { #1 } { #2 }
+% \exp_args:Nc\DeclareDocumentCommand{#1}{mog}{
+% % the actual \#1 command
+% % (maybe this does not even make sense for tuples)
+% \IfValueTF { ##2 }
+% {
+% \IfValueTF { ##3 }
+% {
+% \semantexrenderclass { #1 }{ ifoutput=true,symbol = { ##1 },##2, arg = { ##3 } }
+% }
+% {
+% \semantexrenderclass { #1 }{ ifoutput=true,symbol = { ##1 },##2 }
+% }
+% }
+% {
+% \IfValueTF { ##3 }
+% {
+% \semantexrenderclass { #1 }{ ifoutput=true,symbol = { ##1 }, arg = { ##3 } }
+% }
+% {
+% \semantexrenderclass { #1 }{ symbol = { ##1 } }
+% }
+% }
+% }
+% \exp_args:Nc\DeclareDocumentCommand{#1withoptions}{mmog}{
+% \IfValueTF { ##3 }
+% {
+% \IfValueTF { ##4 }
+% {
+% \semantexrenderclass { #1 }{ ifoutput=true, symbol = { ##2 }, ##1, ##3, arg = { ##4 } }
+% }
+% {
+% \semantexrenderclass { #1 }{ ifoutput=true, symbol = { ##2 }, ##1, ##3 }
+% }
+% }
+% {
+% \IfValueTF { ##4 }
+% {
+% \semantexrenderclass { #1 }{ ifoutput=true, symbol = { ##2 }, ##1, arg = { ##4 } }
+% }
+% {
+% \semantexrenderclass { #1 }{ symbol = { ##2 }, ##1 }
+% }
+% }
+% }
+% \exp_args:Nc\DeclareDocumentCommand{new#1}{mmmmmO{}}
+% {
+% % the command for creating a new object of class #1
+% % ##1 = command name, with backslash
+% % ##2 = symbol
+% % ##3 = options
+% \semantexnewobject { #1 } { ##1 } % creates the object with name ##1
+% { parent = #1, leftpar = { ##2 }, argsep = { ##3 }, rightpar = { ##4 }, argdots = { ##5 }, ##6 }
+% \DeclareDocumentCommand{##1}{og}{
+% % the actual \##1 command
+% \IfValueTF{####1}
+% {
+% \IfValueTF { ####2 }
+% {
+% \semantexrenderobject { ##1 } { ifoutput=true,####1, arg = { ####2 } }
+% }
+% {
+% \semantexrenderobject { ##1 } { ifoutput=true,####1 }
+% }
+% }
+% {
+% \IfValueTF { ####2 }
+% {
+% \semantexrenderobject { ##1 } { ifoutput=true, arg = { ####2 } }
+% }
+% {
+% \semantexrenderobject { ##1 } { }
+% }
+% }
+% }
+% }
+%}
+
+\DeclareDocumentCommand\newdelimiterclass{mO{}} % new delimiter-type class
+{
+ % #1 = class name
+ % #2 = options
+ \semantexnewclass { #1 } {
+% valuekeys={
+% {arg}{argwithoutkeyval={\l_semantex_key_value_temp}},
+% %Currently, using no braces around \l_semantex_key_value_temp is necessary for \semantexdelimsize to work
+% % with par=auto
+% },
+ #2
+ }
+ \exp_args:Nc\DeclareDocumentCommand{#1}{mog} % maybe this does not even make sense for delimiters
+ {
+ \IfValueTF { ##2 }
+ {
+ \IfValueTF { ##3 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol = { ##1 }, ##2, arg = { ##3 } }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol = { ##1 }, ##2 }
+ }
+ }
+ {
+ \IfValueTF { ##3 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol = { ##1 }, arg = { ##3 } }
+ }
+ {
+ \semantexrenderclass { #1 } { symbol = { ##1 } }
+ }
+ }
+ }
+ % the actual \#1 command
+ \exp_args:Nc\DeclareDocumentCommand{#1withoptions}{mmog}
+ {
+ \IfValueTF { ##3 }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol = { ##2 }, ##1, ##3, arg = { ##4 } }
+ }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol = { ##2 }, ##1, ##3 }
+ }
+ }
+ {
+ \IfValueTF { ##4 }
+ {
+ \semantexrenderclass { #1 } { ifoutput=true, symbol = { ##2 }, ##1, arg = { ##4 } }
+ }
+ {
+ \semantexrenderclass { #1 } { symbol = { ##2 }, ##1 }
+ }
+ }
+ }
+ \exp_args:Nc\DeclareDocumentCommand{new#1}{mmmO{}}
+ {
+ % the command for creating a new object of class #1
+ % ##1 = command name, with backslash
+ % ##2 = symbol
+ % ##3 = options
+ \semantexnewobject { #1 } { ##1 }{ parent = #1, leftpar = { ##2 }, rightpar = { ##3 }, ##4 }
+ % creates the object with name ##1
+ \DeclareDocumentCommand{##1}{og}{
+ % the actual \##1 command
+ \IfValueTF { ####1 }
+ {
+ \IfValueTF { ####2 }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1, arg = { ####2 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true,####1 }
+ }
+ }
+ {
+ \IfValueTF { ####2 }
+ {
+ \semantexrenderobject { ##1 } { ifoutput=true, arg = { ####2 } }
+ }
+ {
+ \semantexrenderobject { ##1 } { }
+ }
+ }
+ }
+ }
+}
+
+\cs_generate_variant:Nn \tl_if_eq:nnTF { xnTF }
+
+\cs_generate_variant:Nn \tl_if_eq:nnF { xnF }
+
+\cs_generate_variant:Nn \tl_if_eq:nnT { xnT }
+
+\DeclareDocumentCommand{\semantexifblankordotTF}{mmm}
+{
+ \tl_if_blank:nTF { #1 }
+ { #2 }
+ {
+ \tl_if_eq:xnTF { \tl_trim_spaces:n { #1 } } { . } { #2 } { #3 }
+ }
+}
+
+\DeclareDocumentCommand{\semantexifblankordotT}{mm}
+{
+ \tl_if_blank:nTF { #1 }
+ { #2 }
+ {
+ \tl_if_eq:xnT { \tl_trim_spaces:n { #1 } } { . } { #2 }
+ }
+}
+
+\DeclareDocumentCommand{\semantexifblankordotF}{mm}
+{
+ \tl_if_blank:nF { #1 }
+ {
+ \tl_if_eq:xnF { \tl_trim_spaces:n { #1 } } { . } { #2 }
+ }
+}
+
+\cs_set_eq:NN\semantexifeqTF\tl_if_eq:nnTF
+
+\cs_set_eq:NN\semantexifeqT\tl_if_eq:nnT
+
+\cs_set_eq:NN\semantexifeqF\tl_if_eq:nnF
+
+
+
+\cs_new:Npn \g_semantex_new_class:nn#1#2{
+ % create a new class
+ % #1 = name of class
+ % #2 = standard keyval setup; the parent class by default is semantexvariable
+ \g_semantex_new_object:nnn { semantexvariable } { #1 } { #2 }
+}
+
+\cs_set_eq:NN\semantexnewclass\g_semantex_new_class:nn
+
+\seq_new:N \semantex_all_objects_seq
+\seq_put_right:Nn \semantex_all_objects_seq { semantexvariable }
+
+
+\cs_new:Npn \g_semantex_new_object:nnn#1#2#3{
+ % create new object
+ % #1 = class of command
+ % #2 = name of command, without backslash
+ % #3 = standard keyval setup
+
+ \g_semantex_data_tl_provide:nn { #2 } { parent }
+
+ \g_semantex_data_tl_set:nnn {#2 } { parent } { semantexvariable }
+
+ \cs_set:cpn { g_semantex_data_cs_#2_valuekey:nn } ##1##2 % command controlling valuekeys
+ { \g_semantex_valuekey:nnn { ##2 } { ##1 } { #2 } }
+
+ \cs_set:cpn { g_semantex_data_cs_#2_novaluekey:n } ##1 % command controlling novaluekeys
+ { \g_semantex_novaluekey:nn { ##1 } { #2 } }
+
+ % Now a similar collection of keyval commands for the *argument*
+
+ \cs_set:cpn { g_semantex_data_cs_#2_arg_valuekey:nn } ##1##2
+ { \g_semantex_arg_valuekey:nnn { ##2 } { ##1 }{ #2 } }
+
+ \cs_set:cpn { g_semantex_data_cs_#2_arg_novaluekey:n } ##1
+ { \g_semantex_arg_novaluekey:nn { ##1 } { #2 } }
+
+
+ % initially sets up the keyval interface of the object
+ \g_semantex_keys_set:nn { #2 } { parent=#1, #3 }
+
+ \seq_put_right:Nx \semantex_all_objects_seq { #2 }
+}
+
+
+\cs_generate_variant:Nn \g_semantex_new_object:nnn { nxn }
+
+\cs_set:Npn \semantexnewobject#1#2#3
+{ \g_semantex_new_object:nxn { #1 }{ \cs_to_str:N #2 } { #3 } }
+
+
+
+
+%-------------------------------
+
+% Commands for rendering:
+
+\tl_new:N\l__semantex_symbol_temp
+
+\cs_new_protected:Npn \g_semantex_render:nn#1#2
+{
+ % the main command for rendering an object
+ % #1 = name of object
+ % #2 = options
+ \group_begin:
+ \g_semantex_data_tl_inherit:nn { #1 } { symbol }
+ \g_semantex_keys_set:nn { #1 } { #2 }
+ \g_semantex_primitive_valuekey_parse:nn { #1 } { } % not the right place to run this?
+ \g_semantex_data_bool_get:nnTF { #1 } { output }
+ {
+ \g_semantex_primitive_valuekey_innerreturn:nn { #1 }{}
+ \g_semantex_data_bool_get:nnTF { #1 } { rightreturnbeforerender }
+ {
+ \g_semantex_primitive_valuekey_rightreturn:nn { #1 }{}
+ }
+ {
+ % do nothing
+ }
+ \tl_set:Nx\l__semantex_render_symbol_temp { \g_semantex_data_tl_get:nn { #1 } { symbol } } %IM chang to "store" solution
+ \g_semantex_data_tl_get_store:nnN { #1 } { upper_index } \l__semantex_render_upper_index_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { lower_index } \l__semantex_render_lower_index_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { upper_left_index } \l__semantex_render_upper_left_index_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { lower_left_index } \l__semantex_render_lower_left_index_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { preupper } \l__semantex_render_preupper_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postupper } \l__semantex_render_postupper_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { prelower } \l__semantex_render_prelower_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postlower } \l__semantex_render_postlower_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { preupperleft } \l__semantex_render_preupperleft_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postupperleft } \l__semantex_render_postupperleft_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { prelowerleft } \l__semantex_render_prelowerleft_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postlowerleft } \l__semantex_render_postlowerleft_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { texclass } \l__semantex_render_texclass_temp
+ \tl_set:Nx \l__semantex_render_temp
+ {
+ \exp_not:c {
+ \g_semantex_data_tl_get:nn { #1 } { output }withoptions
+ }
+ {
+ upperaddleft={\exp_not:V\l__semantex_render_upper_index_temp},
+ loweraddleft={\exp_not:V\l__semantex_render_lower_index_temp},
+ upperleftaddright={\exp_not:V\l__semantex_render_upper_left_index_temp},
+ lowerleftaddright={\exp_not:V\l__semantex_render_lower_left_index_temp},
+ preupper={\exp_not:V\l__semantex_render_preupper_temp},
+ postupper={\exp_not:V\l__semantex_render_postupper_temp},
+ prelower={\exp_not:V\l__semantex_render_prelower_temp},
+ postlower={\exp_not:V\l__semantex_render_postlower_temp},
+ preupperleft={\exp_not:V\l__semantex_render_preupperleft_temp},
+ postupperleft={\exp_not:V\l__semantex_render_postupperleft_temp},
+ prelowerleft={\exp_not:V\l__semantex_render_prelowerleft_temp},
+ postlowerleft={\exp_not:V\l__semantex_render_postlowerleft_temp},
+ texclass={\l__semantex_render_texclass_temp},
+ \g_semantex_data_tl_get_exp_not:nn { #1 } { output_options },
+ }
+ { \exp_not:V \l__semantex_render_symbol_temp }
+ }
+ }
+ {
+ \g_semantex_primitive_valuekey_return:nn { #1 }{}
+% \tl_set:Nx \l__semantex_render_temp { \exp_not:V \l__semantex_symbol_temp }
+% \tl_set:Nx\l__semantex_render_temp { \g_semantex_data_tl_get:nn { #1 } { symbol } } % this is the ordinary solution that generally just works
+ %\tl_set:Nx\l__semantex_render_temp { \exp_not:n{\exp_not:v { semantex_data_tl_#1_symbol } }}
+% \g_semantex_data_tl_get_store:nnN { #1 } { symbol } \l__semantex_render_symbol_temp
+ \tl_if_blank:xTF { \g_semantex_data_tl_get:nn { #1 } { texclass } }{
+ \tl_set:Nx\l__semantex_render_symbol_temp { \g_semantex_data_tl_get:nn { #1 } { symbol } }
+ }
+ {
+ \tl_set:Nx\l__semantex_render_symbol_temp { \g_semantex_data_tl_get:nn { #1 } { texclass } { \g_semantex_data_tl_get:nn { #1 } { symbol } } }
+ }
+ \tl_set:Nx\l__semantex_render_temp {
+ \exp_not:V \l__semantex_render_symbol_temp
+ }
+ }
+ \exp_last_unbraced:NV
+ \group_end:
+ \l__semantex_render_temp
+}
+
+\cs_set_eq:NN\semantexrenderclass\g_semantex_render:nn % a front-end command
+
+\cs_set:Npn\semantexrenderobject#1#2
+{
+ \g_semantex_render:nn { \cs_to_str:N #1 } { #2 }
+}
+
+
+
+\cs_generate_variant:Nn\tl_if_blank:nTF { xTF }
+
+\cs_new:Npn \g_semantex_right_indices:nnnnnn#1#2#3#4#5#6
+{
+ \tl_if_blank:nF { #2 } { \sp{#1 #2 #3} }
+ \tl_if_blank:nF { #5 } { \sb{#4 #5 #6} }
+ % Using x here was the source of a very long
+ % debugging; inputting underbrace in the index
+ % caused problems
+}
+
+\cs_new:Npn \g_semantex_left_indices:nnnnnn#1#2#3#4#5#6
+{
+ \tl_if_blank:nTF { #2 } {
+ \tl_if_blank:nF { #5 } { {}\sb{#4 #5 #6} }
+ }
+ {
+ {} \sp{#1 #2 #3}
+ \tl_if_blank:nF { #5 } { \sb{#4 #5 #6} }
+ }
+}
+
+
+
+\tl_new:N\semantexdelimsize
+
+%So far, this is experimental:
+%\makeatletter %this part requires amsmath
+\newcommand{\semantexnormalscaling}{\bBigg@{0.8}}
+\newcommand{\semantexnormalscalingl}{\mathopen\semantexnormalscaling}
+\newcommand{\semantexnormalscalingr}{\mathclose\semantexnormalscaling}
+\newcommand{\semantexnormalscalingm}{\mathrel\semantexnormalscaling}
+%\makeatother
+
+
+\cs_new:Npn \g_semantex_parentheses:nnnnnn#1#2#3#4#5#6
+{
+ \tl_if_blank:nF { #5 }
+ {
+ \str_case:nnF { #1 }
+ {
+ { normal } {
+ \group_begin:
+ %\semantexnormalscalingl#2 #4 #5 #6 \semantexnormalscalingr#3
+ \mathopen#2 #4 #5 #6 \mathclose#3
+ \group_end:
+ }
+ { auto } {
+ \group_begin:
+ \tl_set:Nn\semantexdelimsize{\middle}
+ %\tl_set_eq:NN\semantexdelimsize\middle
+ \mathopen{}\mathclose\bgroup\left#2
+ #4 #5 #6
+ \aftergroup\egroup\right#3
+ \group_end:
+ }
+ { * } {
+ \group_begin:
+ \tl_set:Nn\semantexdelimsize{\middle}
+ %\tl_set_eq:NN\semantexdelimsize\middle
+ \mathopen{}\mathclose\bgroup\left#2
+ #4 #5 #6
+ \aftergroup\egroup\right#3
+ \group_end:
+ }
+% { \big } {
+% \group_begin:
+% \tl_set_eq:NN\semantexdelimsize\big
+% \mathopen\big#2 #4 \mathclose\big#3
+% \group_end:
+% }
+% { \Big } {
+% \group_begin:
+% \tl_set_eq:NN\semantexdelimsize\Big
+% \mathopen\Big#2 #4 \mathclose\Big#3
+% \group_end:
+% }
+% { \bigg } {
+% \group_begin:
+% \tl_set_eq:NN\semantexdelimsize\bigg
+% \mathopen\bigg#2 #4 \mathclose\bigg#3
+% \group_end:
+% }
+% { \Bigg } {
+% \group_begin:
+% \tl_set_eq:NN\semantexdelimsize\Bigg
+% \mathopen\Bigg#2 #4 \mathclose\Bigg#3
+% \group_end:
+% }
+ }
+ {
+ \group_begin:
+ \tl_set_eq:NN\semantexdelimsize#1
+ %\tl_set:Nx\semantexdelimsize{\exp_not:N#1}
+ \mathopen#1#2 #4 #5 #6 \mathclose#1#3
+ \group_end:
+ }
+ }
+}
+
+\cs_new:Npn \g_semantex_no_parentheses:nnn#1#2#3
+{
+ \tl_if_blank:nF { #2 }
+ {
+ \group_begin:
+ \tl_clear:N\semantexdelimsize
+ #1 #2 #3
+ \group_end:
+ }
+}
+
+\cs_new:Npn \g_semantex_symbol_parentheses:nnnn#1#2#3#4
+{
+ \tl_if_blank:nF { #4 }
+ {
+ \str_case:nnF { #1 }
+ {
+ { normal } { \mathopen#2 #4 \mathclose#3 }
+ { auto } { \mathopen{}\mathclose\bgroup\left#2 #4 \aftergroup\egroup\right#3 }
+ { * } { \mathopen{}\mathclose\bgroup\left#2 #4 \aftergroup\egroup\right#3 }
+ }
+ { \mathopen#1#2 #4 \mathclose#1#3 }
+ }
+}
+
+
+
+
+%--------------------------------------------
+% Commands to modify and obtain data
+
+\cs_generate_variant:Nn \str_if_eq:nnTF { fnTF , onTF }
+
+%\cs_new:Npn \g_semantex_data_tl_get_proto:nnn#1#2#3
+%{
+% % #1 = name of object
+% % #2 = the data to get
+% % #3 = also the name of object, but being stored
+% % when passing to the parent, in order to make
+% % error messages meaningful
+% \tl_if_exist:cTF { semantex_data_tl_#1_#2 }
+% {
+% \use:c { semantex_data_tl_#1_#2 }
+% }
+% {
+% \tl_if_eq:nnTF { #1 } { semantexvariable }
+% {
+% \msg_error:nnnn { semantex } { data_tl_not_found } { #2 } { #3 }
+% }
+% {
+% \g_semantex_data_tl_get_proto:nnn { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } { #1 }
+% }
+% }
+%}
+%
+%\cs_new:Npn \g_semantex_data_tl_get:nn#1#2
+%{
+% \g_semantex_data_tl_get_proto:nnn { #1 } { #2 } { #1 }
+%}
+
+\cs_new:Npn \g_semantex_data_tl_get:nn#1#2
+{
+ % #1 = name of object
+ % #2 = the data to get
+ % #3 = also the name of object, but being stored
+ % when passing to the parent, in order to make
+ % error messages meaningful
+ \tl_if_exist:cTF { semantex_data_tl_#1_#2 }
+ {
+ \use:c { semantex_data_tl_#1_#2 }
+ }
+ {
+ \g_semantex_data_tl_get:nn { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 }
+ }
+}
+
+\cs_new:Npn \g_semantex_data_tl_get_exp_not:nn#1#2
+{
+ % #1 = name of object
+ % #2 = the data to get
+ \tl_if_exist:cTF { semantex_data_tl_#1_#2 }
+ {
+ \exp_not:v { semantex_data_tl_#1_#2 }
+ }
+ {
+ \g_semantex_data_tl_get:nn { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 }
+ }
+}
+
+%\cs_generate_variant:Nn \g_semantex_data_tl_get:nn { cn }
+
+\cs_new:Npn \g_semantex_data_tl_get_store:nnN#1#2#3% maybe should be PROTECTED??
+{
+ % #1 = name of object
+ % #2 = the data to get
+ % #3 = where to store it
+ \tl_if_exist:cTF { semantex_data_tl_#1_#2 }
+ {
+ \tl_set_eq:Nc #3 { semantex_data_tl_#1_#2 }
+ }
+ {
+ \g_semantex_data_tl_get_store:nnN { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } #3
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_data_tl_get_store:nnN { nnc }
+
+\cs_new:Npn\g_semantex_data_tl_provide:nn#1#2
+{
+ \tl_if_exist:cF { semantex_data_tl_#1_#2 }
+ {
+ \tl_set:cn { semantex_data_tl_#1_#2 } {}
+ }
+}
+
+\cs_new:Npn\g_semantex_data_tl_inherit:nn#1#2
+{
+ % #1 = object
+ % #2 = piece of token list data
+ % Takes the data #2 from the parent of #1 and saves it locally
+ % to the object #1. After this, no more inheritance is taking place
+ % from the parent, and the data can be changed locally on the level
+ % of #1.
+ \tl_if_exist:cF { semantex_data_tl_#1_#2 }
+ {
+ \g_semantex_data_tl_get_store:nnc { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } { semantex_data_tl_#1_#2 }
+ }
+ {
+ \g_semantex_data_tl_get_store:nnc { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } { semantex_data_tl_#1_#2 }
+ %IM could be replaced by simply { #1 } { #2 } once the check is made
+ %IM based on "if_provided"
+ }
+}
+
+\cs_new:Npn\g_semantex_data_tl_inherit_x:nn#1#2
+{
+ % The same as inherit; historically, this one did an x type
+ % expansion first, but after changes in other places, this
+ % no longer appeard to be necessary. I decided to keep up the
+ % separation of the two, just in case.
+ \tl_if_exist:cF { semantex_data_tl_#1_#2 }
+ {
+ \g_semantex_data_tl_get_store:nnc { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } { semantex_data_tl_#1_#2 }
+ }
+ {
+ \g_semantex_data_tl_get_store:nnc { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } { semantex_data_tl_#1_#2 }
+ %IM could be replaced by simply { #1 } { #2 } once the check is made
+ %IM based on "if_provided"
+ }
+}
+
+\cs_new:Npn \g_semantex_data_tl_set:nnn#1#2#3
+{
+ %\g_semantex_data_tl_provide:nn { #1 } { #2 }
+ \tl_set:cn { semantex_data_tl_#1_#2 } { #3 }
+}
+
+\cs_generate_variant:Nn \g_semantex_data_tl_set:nnn { nnx }
+
+\cs_new:Npn \g_semantex_data_tl_put_right:nnn#1#2#3
+{
+ \g_semantex_data_tl_inherit:nn { #1 } { #2 }
+ \tl_put_right:cn { semantex_data_tl_#1_#2 } { #3 }
+}
+
+\cs_generate_variant:Nn \g_semantex_data_tl_put_right:nnn { nnx }
+
+\cs_new:Npn \g_semantex_data_tl_put_left:nnn#1#2#3
+{
+ \g_semantex_data_tl_inherit:nn { #1 } { #2 }
+ \tl_put_left:cn { semantex_data_tl_#1_#2 } { #3 }
+}
+
+\cs_generate_variant:Nn \g_semantex_data_tl_put_left:nnn { nnx }
+
+\cs_new:Npn \g_semantex_data_tl_clear:nn#1#2
+{
+ \g_semantex_data_tl_provide:nn { #1 } { #2 }
+ \tl_clear:c { semantex_data_tl_#1_#2 }
+}
+
+\cs_new:Npn \g_semantex_data_seq_get_store:nnN#1#2#3{% maybe should be PROTECTED??
+ % #1 = name of object
+ % #2 = the sequence to get
+ % #3 = the command to store it in
+ \bool_if_exist:cTF { semantex_data_seq_#1_#2_bool_if_provided }
+ {
+ \bool_if:cTF { semantex_data_seq_#1_#2_bool_if_provided }
+ { \seq_set_eq:Nc#3 { semantex_data_seq_#1_#2 } }
+ { \g_semantex_data_seq_get_store:vnN{ semantex_data_tl_#1_parent }{#2}#3 }
+ }
+ {
+ \g_semantex_data_seq_get_store:nnN{ \g_semantex_data_tl_get:nn { #1 } { parent } }{#2}#3%
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_data_seq_get_store:nnN { vnN, nnc, vnc }
+
+\cs_new:Npn\g_semantex_data_seq_provide:nn#1#2
+{
+ \bool_if_exist:cTF { semantex_data_seq_#1_#2_bool_if_provided }
+ {
+ \bool_if:cF { semantex_data_seq_#1_#2_bool_if_provided }
+ {
+ \seq_new:c { semantex_data_seq_#1_#2 }
+ \bool_set_true:c { semantex_data_seq_#1_#2_bool_if_provided }
+ }
+ }
+ {
+ \bool_new:c { semantex_data_seq_#1_#2_bool_if_provided }
+ \bool_set_true:c { semantex_data_seq_#1_#2_bool_if_provided }
+ \seq_if_exist:cF { semantex_data_seq_#1_#2 } {
+ \seq_new:c { semantex_data_seq_#1_#2 }
+ }
+ }
+}
+
+\cs_new:Npn\g_semantex_data_seq_inherit:nn#1#2
+{
+ \bool_if_exist:cTF { semantex_data_seq_#1_#2_bool_if_provided }
+ {
+ \bool_if:cF { semantex_data_seq_#1_#2_bool_if_provided }
+ {
+ \g_semantex_data_seq_get_store:vnc { semantex_data_tl_#1_parent } { #2 } { semantex_data_seq_#1_#2 }
+ \bool_set_true:c { semantex_data_seq_#1_#2_bool_if_provided }
+ }
+ }
+ {
+ \bool_new:c { semantex_data_seq_#1_#2_bool_if_provided }
+ \bool_set_true:c { semantex_data_seq_#1_#2_bool_if_provided }
+ \seq_if_exist:cF { semantex_data_seq_#1_#2 } { \seq_new:c { semantex_data_seq_#1_#2 } }
+ \g_semantex_data_seq_get_store:vnc { semantex_data_tl_#1_parent } { #2 } { semantex_data_seq_#1_#2 }
+ }
+}
+
+\cs_new:Npn\g_semantex_data_seq_put_right:nnn#1#2#3
+{
+ \g_semantex_data_seq_inherit:nn { #1 } { #2 }
+ \seq_put_right:cn { semantex_data_seq_#1_#2 } { #3 }
+}
+
+\cs_new:Npn \g_semantex_data_prop_provide:nn#1#2
+{
+ % #1 = name of the object
+ % #2 = name of the prop
+ \prop_if_exist:cF { semantex_data_prop_#1_#2 } { \prop_new:c { semantex_data_prop_#1_#2 } }
+}
+
+\cs_new:Npn \g_semantex_data_prop_put:nnnn#1#2#3#4
+{
+ \prop_put:cnn { semantex_data_prop_#1_#2 } { #3 } { #4 }
+}
+
+
+\cs_new:Npn \g_semantex_valuekey_get:nnNTF#1#2#3#4#5{%
+ % #1 = name of the object
+ % #2 = keyval data to get
+ % #3 = command to store possible data in
+ % #4 = if true (not to be used)
+ % #5 = if false
+ \prop_get:cnNTF { semantex_data_prop_#1_custom_valuekeys } { #2 }#3%\l_semantex_valuekey_get_temp
+ { #4 }
+ {
+ \tl_if_eq:nnTF { #1 } { semantexvariable }
+ { #5 }
+ {
+ \g_semantex_valuekey_get:xnNTF { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } #3 { #4 } { #5 }
+ }
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_valuekey_get:nnNTF { vnNTF, xnNTF }
+
+\cs_new:Npn \g_semantex_novaluekey_get:nnNTF#1#2#3#4#5{%
+ % #1 = name of the object
+ % #2 = singlekey data to get
+ % #3 = command to store possible data in
+ % #4 = if true (not to be used)
+ % #5 = if false
+ \prop_get:cnNTF { semantex_data_prop_#1_custom_novaluekeys } { #2 } #3
+ { #4 }
+ {
+ \tl_if_eq:nnTF { #1 } { semantexvariable }
+ { #5 }
+ {
+ \g_semantex_novaluekey_get:xnNTF { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } #3 { #4 } { #5 }
+ }
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_novaluekey_get:nnNTF { vnNTF, xnNTF }
+
+%\cs_new:N\l_semantex_arg_valuekey_get_parent_temp
+
+\cs_new:Npn \g_semantex_arg_valuekey_get:nnNTF#1#2#3#4#5{%
+ % #1 = name of the object
+ % #2 = keyval data to get
+ % #3 = command to store possible data in
+ % #4 = if true (not to be used)
+ % #5 = if false
+ \prop_get:cnNTF { semantex_data_prop_#1_custom_arg_valuekeys } { #2 }#3%\l_semantex_valuekey_get_temp
+ { #4 }
+ {
+ \tl_if_eq:nnTF { #1 } { semantexvariable }
+ { #5 }
+ {
+ \g_semantex_arg_valuekey_get:xnNTF { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } #3 { #4 } { #5 }
+ }
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_arg_valuekey_get:nnNTF { vnNTF, xnNTF }
+
+\prop_new:N\l_semantex_arg_valuekey_get_temp
+
+\cs_new:Npn \g_semantex_arg_novaluekey_get:nnNTF#1#2#3#4#5{%
+ % #1 = name of the object
+ % #2 = singlekey data to get
+ % #3 = command to store possible data in
+ % #4 = if true (not to be used)
+ % #5 = if false
+ \prop_get:cnNTF { semantex_data_prop_#1_custom_arg_novaluekeys } { #2 } #3
+ { #4 }
+ {
+ \tl_if_eq:nnTF { #1 } { semantexvariable }
+ { #5 } { \g_semantex_arg_novaluekey_get:xnNTF { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } #3 { #4 } { #5 } }
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_arg_novaluekey_get:nnNTF { vnNTF, xnNTF }
+
+\cs_new:Npn\g_semantex_data_bool_get:nnTF#1#2#3#4
+{
+ % #1 = name of the object
+ % #2 = boolean to get
+ % #3 = if true
+ % #4 = if false
+ \bool_if_exist:cTF { semantex_data_bool_#1_if_#2_bool_if_provided }
+ {
+ \bool_if:cTF { semantex_data_bool_#1_if_#2_bool_if_provided }
+ {
+ \bool_if:cTF { semantex_data_bool_#1_if_#2 } { #3 } { #4 }
+ }
+ {
+ \tl_if_eq:nnTF { #1 } { semantexvariable }
+ { #4 } { \g_semantex_data_bool_get:xnTF { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } { #3 } { #4 } }
+ }
+ }
+ {
+ \tl_if_eq:nnTF { #1 } { semantexvariable }
+ { #4 } { \g_semantex_data_bool_get:xnTF { \g_semantex_data_tl_get:nn { #1 } { parent } } { #2 } { #3 } { #4 } }
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_data_bool_get:nnTF { xnTF, vnTF }
+
+\cs_new:Npn\g_semantex_data_bool_provide:nn#1#2
+{
+ % #1 = name of the object
+ % #2 = boolean to provide
+ \bool_if_exist:cTF { semantex_data_bool_#1_if_#2_bool_if_provided }
+ {
+ \bool_if:cF { semantex_data_bool_#1_if_#2_bool_if_provided }
+ { \bool_set_true:c { semantex_data_bool_#1_if_#2_bool_if_provided } }
+ }
+ {
+ \bool_new:c { semantex_data_bool_#1_if_#2 }
+ \bool_new:c { semantex_data_bool_#1_if_#2_bool_if_provided }
+ \bool_set_true:c { semantex_data_bool_#1_if_#2_bool_if_provided }
+ }
+}
+
+\cs_new:Npn\g_semantex_data_bool_set_true:nn#1#2
+{
+ % #1 = name of the object
+ % #2 = boolean to provide
+ \g_semantex_data_bool_provide:nn { #1 } { #2 }
+ \bool_set_true:c { semantex_data_bool_#1_if_#2 }
+}
+
+\cs_new:Npn\g_semantex_data_bool_set_false:nn#1#2
+{
+ % #1 = name of the object
+ % #2 = boolean to provide
+ \g_semantex_data_bool_provide:nn { #1 } { #2 }
+ \bool_set_false:c { semantex_data_bool_#1_if_#2 }
+}
+
+\cs_new:Npn\g_semantex_data_cs_get:nnn#1#2#3
+{
+ % #1 = name of the object
+ % #2 = command sequence to get
+ % #3 = what to apply said command sequence to
+ \cs_if_exist:cTF { g_semantex_data_cs_#1_#2:n }
+ { \use:c { g_semantex_data_cs_#1_#2:n } { #3 } }
+ {
+ \tl_if_eq:nnTF { #1 } { semantexvariable }
+ {
+ % should probably throw an error by now, but later!
+ }
+ {
+ \g_semantex_data_cs_get:xnn { \g_semantex_data_tl_get:nn{#1}{parent} } { #2 } { #3 }
+ }
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_data_cs_get:nnn { xnn }
+
+\cs_new:Npn \g_semantex_keys_set:nn#1#2
+{
+ % #1 = object
+ % #2 = keys
+ \keyval_parse:cco %IM think about wthether o-type is really necessary.
+ { g_semantex_data_cs_#1_novaluekey:n }
+ { g_semantex_data_cs_#1_valuekey:nn }
+ { #2 }
+}
+
+\cs_new:Npn \g_semantex_arg_keys_set:nn#1#2
+{
+ % #1 = object
+ % #2 = keys
+ \keyval_parse:cco %IM -||-
+ { g_semantex_data_cs_#1_arg_novaluekey:n }
+ { g_semantex_data_cs_#1_arg_valuekey:nn }
+ { #2 }
+}
+
+\cs_generate_variant:Nn \clist_map_function:nN { nc }
+
+\cs_new:Npn \g_semantex_arg_novaluekeys_set:nn#1#2
+{
+ \clist_map_function:nc {#2} { g_semantex_data_cs_#1_arg_novaluekey:n }
+}
+
+\DeclareDocumentCommand\setupclass{mm}{ % a user-level command for setting up the object
+ % #1 = class
+ % #2 = setup
+ %\exp_args:Nx
+ \g_semantex_keys_set:nn { #1 }{ #2 }
+}
+
+\DeclareDocumentCommand\setupobject{mm}{%
+ % #1 = object
+ % #2 = setup
+ \g_semantex_keys_set:nn { \cs_to_str:N #1 } { #2 }
+}
+
+
+
+
+
+% Now for the commands that implement the keyval interface.
+% These commands are used by the command \g_semantex_data_cs_#1_keys_set, see
+% above.
+% There is a fixed collection of primitive commands.
+% Furthermore, the user has the option to create a collection
+% of new commands, which are all stored in the property list
+% called \semantex_data_prop_#1_custom_valuekeys
+% These valuekeys contain code that must be executable by other keys
+% (e.g., primitive ones)
+% The key value is accessible to the user via the temporary command
+% \l_semantex_key_value_temp
+
+\providecommand\semantexdataprovide{}
+\providecommand\semantexdataset{}
+\providecommand\semantexdatasetx{}
+\providecommand\semantexdataputright{}
+\providecommand\semantexdataputrightx{}
+\providecommand\semantexdataputleft{}
+\providecommand\semantexdataputleftx{}
+\providecommand\semantexdataget{}
+\providecommand\semantexdatagetexpnot{}
+\providecommand\semantexdataclear{}
+\providecommand\semantexsetkeys{}
+\providecommand\semantexsetkeysx{}
+\providecommand\semantexstrifeq{}
+\providecommand\semantexboolprovide{}
+\providecommand\semantexboolsettrue{}
+\providecommand\semantexboolsetfalse{}
+\providecommand\semantexboolif{}
+
+% CHANGE TO CAMEL CASE!
+
+
+\cs_generate_variant:Nn\str_if_eq:nnTF {xxTF,ooTF}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_execute:nn#1#2
+{
+ \renewcommand\semantexdataprovide[1]{\g_semantex_data_tl_provide:nn{#1}{##1}}
+ \renewcommand\semantexdataset[2]{\g_semantex_data_tl_set:nnn{#1}{##1}{##2}}
+ \renewcommand\semantexdatasetx[2]{\g_semantex_data_tl_set:nnx{#1}{##1}{##2}}
+ \renewcommand\semantexdataputright[2]{\g_semantex_data_tl_put_right:nnn{#1}{##1}{##2}}
+ \renewcommand\semantexdataputrightx[2]{\g_semantex_data_tl_put_right:nnx{#1}{##1}{##2}}
+ \renewcommand\semantexdataputleft[2]{\g_semantex_data_tl_put_left:nnn{#1}{##1}{##2}}
+ \renewcommand\semantexdataputleftx[2]{\g_semantex_data_tl_put_left:nnx{#1}{##1}{##2}}
+ \renewcommand\semantexdataget[1]{\g_semantex_data_tl_get:nn{#1}{##1}}
+ \renewcommand\semantexdatagetexpnot[1]{\g_semantex_data_tl_get_exp_not:nn{#1}{##1}}
+ \renewcommand\semantexdataclear[1]{\g_semantex_data_tl_clear:nn{#1}{##1}}
+ \renewcommand\semantexsetkeys[1]{\g_semantex_keys_set:nn{#1}{##1}}
+ \renewcommand\semantexsetkeysx[1]{\g_semantex_keys_set:nx{#1}{##1}}
+ \renewcommand\semantexstrifeq[4]{\str_if_eq:xxTF{##1}{##2}{##3}{##4}}
+ \renewcommand\semantexboolprovide[1]{\g_semantex_data_bool_provide:nn{#1}{##1}}
+ \renewcommand\semantexboolsettrue[1]{\g_semantex_data_bool_set_true:nn{#1}{##1}}
+ \renewcommand\semantexboolsetfalse[1]{\g_semantex_data_bool_set_false:nn{#1}{##1}}
+ \renewcommand\semantexboolif[3]{\g_semantex_data_bool_get:nnTF{#1}{##1}{##2}{##3}}
+ %\exp_not:n{#2}
+ % how about erase and forget?
+ #2
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_parse:nn#1#2
+{
+ \g_semantex_data_tl_inherit:nn { #1 } { parseoptions }
+ % But we need to also reset this, plus all data variables that
+ % it used; nope, not necessary
+ \g_semantex_keys_set:nx { #1 } {
+ \g_semantex_data_tl_get_exp_not:nn { #1 } { parseoptions }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_parseoptions:nn#1#2
+{
+ \g_semantex_data_tl_put_right:nnn { #1 } { parseoptions } { #2 }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_return:nn#1#2
+{
+ \g_semantex_primitive_valuekey_innerreturn:nn { #1 }{}
+ \g_semantex_primitive_valuekey_rightreturn:nn { #1 }{}
+ \g_semantex_primitive_valuekey_leftreturn:nn { #1 }{}
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_innerreturn:nn#1#2
+{
+ \g_semantex_data_tl_inherit:nn { #1 } { symbol }
+ \g_semantex_data_seq_inherit:nn { #1 } { commands_sequence }
+ \g_semantex_data_seq_get_store:nnN { #1 } { commands_sequence } \l__semantex_data_seq_commands_sequence_temp
+ %\seq_map_inline:cn { semantex_data_seq_#1_commands_sequence }
+ \seq_map_inline:Nn \l__semantex_data_seq_commands_sequence_temp
+ {
+ \g_semantex_data_tl_set:nnx { #1 } { symbol }
+ {
+ \exp_not:n {\exp_not:N ##1} {
+ \g_semantex_data_tl_get_exp_not:nn { #1 } { symbol }
+ }
+ % This was the solution that happened to solve
+ % the expansion issues best
+ }
+ }
+ \seq_clear:c { semantex_data_seq_#1_commands_sequence }
+}
+
+\tl_new:N\l__semantex_rightreturn_par_temp
+
+\tl_new:N\l__semantex_rightreturn_nopar_temp
+
+\cs_generate_variant:Nn \g_semantex_keys_set:nn { nx , no }
+
+\cs_new:Npn\g_semantex_primitive_valuekey_rightreturn:nn#1#2
+{
+ \g_semantex_data_tl_inherit_x:nn { #1 } { upper_index }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { lower_index }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { preupper }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { postupper }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { prelower }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { postlower }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { arg }
+ \g_semantex_data_tl_get_store:nnN { #1 } { upper_index } \l__semantex_rightreturn_upper_index_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { lower_index } \l__semantex_rightreturn_lower_index_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { symbol } \l__semantex_rightreturn_symbol_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { preupper }
+ \l__semantex_rightreturn_preupper_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postupper }
+ \l__semantex_rightreturn_postupper_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { prelower }
+ \l__semantex_rightreturn_prelower_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postlower }
+ \l__semantex_rightreturn_postlower_temp
+ \g_semantex_data_tl_set:nnx { #1 } { symbol }
+ {
+ \exp_not:V \l__semantex_rightreturn_symbol_temp
+ % Setup indices:
+ \exp_not:N\g_semantex_right_indices:nnnnnn
+ { \exp_not:V \l__semantex_rightreturn_preupper_temp }
+ { \exp_not:V \l__semantex_rightreturn_upper_index_temp }
+ { \exp_not:V \l__semantex_rightreturn_postupper_temp }
+ { \exp_not:V \l__semantex_rightreturn_prelower_temp }
+ { \exp_not:V \l__semantex_rightreturn_lower_index_temp }
+ { \exp_not:V \l__semantex_rightreturn_postlower_temp }
+ }
+ \g_semantex_data_bool_get:nnTF { #1 } { par }
+ {
+ \g_semantex_data_tl_get_store:nnN { #1 } { par_size }
+ \l__semantex_rightreturn_par_size_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { par_open } \l__semantex_rightreturn_par_open_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { par_close } \l__semantex_rightreturn_par_close_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { arg } \l__semantex_rightreturn_arg_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { prearg } \l_semantex_rightreturn_prearg_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postarg } \l_semantex_rightreturn_postarg_temp
+ \tl_set:Nx\l__semantex_rightreturn_par_temp
+ {
+ { \exp_not:V \l__semantex_rightreturn_par_size_temp }
+ { \exp_not:V \l__semantex_rightreturn_par_open_temp }
+ { \exp_not:V \l__semantex_rightreturn_par_close_temp }
+ { \exp_not:V \l_semantex_rightreturn_prearg_temp }
+ { \exp_not:V \l__semantex_rightreturn_arg_temp }
+ { \exp_not:V \l_semantex_rightreturn_postarg_temp }
+ }
+ \tl_put_left:Nn\l__semantex_rightreturn_par_temp
+ {
+ \exp_not:N
+ \g_semantex_parentheses:nnnnnn
+ }
+ \g_semantex_data_tl_put_right:nnx { #1 } { symbol }
+ {
+ \exp_not:V\l__semantex_rightreturn_par_temp
+ }
+ }
+ {
+ \tl_set:Nx\l__semantex_rightreturn_nopar_temp
+ {
+ { \g_semantex_data_tl_get_exp_not:nn { #1 } { prearg } }
+ { \g_semantex_data_tl_get_exp_not:nn { #1 } { arg } }
+ { \g_semantex_data_tl_get_exp_not:nn { #1 } { postarg } }
+ }
+ \tl_put_left:Nn\l__semantex_rightreturn_nopar_temp
+ {
+ \exp_not:N
+ \g_semantex_no_parentheses:nnn
+ }
+ \g_semantex_data_tl_put_right:nnx { #1 } { symbol }
+ {
+ \exp_not:V\l__semantex_rightreturn_nopar_temp
+ }
+ }
+ \g_semantex_data_tl_clear:nn { #1 } { upper_index }
+ \g_semantex_data_bool_provide:nn { #1 } { first_upper }
+ \g_semantex_data_bool_set_true:nn { #1 } { first_upper }
+ \g_semantex_data_tl_clear:nn { #1 } { lower_index }
+ \g_semantex_data_bool_provide:nn { #1 } { first_lower }
+ \g_semantex_data_bool_set_true:nn { #1 } { first_lower }
+ \g_semantex_data_tl_clear:nn { #1 } { arg }
+ \g_semantex_data_bool_provide:nn { #1 } { first_arg }
+ \g_semantex_data_bool_set_true:nn { #1 } { first_arg }
+ \g_semantex_data_tl_clear:nn { #1 } { preupper }
+ \g_semantex_data_tl_clear:nn { #1 } { postupper }
+ \g_semantex_data_tl_clear:nn { #1 } { prelower }
+ \g_semantex_data_tl_clear:nn { #1 } { postlower }
+ %IM maybe one should enclose the new symbol in another group
+ %IM Maybe should also reset stuff like par size
+ %IM reset leftpar, rightpar, parsize etc. also
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_leftreturn:nn#1#2
+{
+ \g_semantex_data_tl_inherit_x:nn { #1 } { upper_left_index }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { lower_left_index }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { preupperleft }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { postupperleft }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { prelowerleft }
+ \g_semantex_data_tl_inherit_x:nn { #1 } { postlowerleft }
+ %IMPLEMENT THIS!!!
+ % Clean up the following names
+ \g_semantex_data_tl_get_store:nnN { #1 } { upper_left_index } \l__semantex_leftreturn_upper_left_index_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { lower_left_index } \l__semantex_leftreturn_lower_left_index_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { symbol } \l__semantex_leftreturn_symbol_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { preupperleft } \l__semantex_leftreturn_preupperleft_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postupperleft } \l__semantex_leftreturn_postupperleft_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { prelowerleft } \l__semantex_leftreturn_prelowerleft_temp
+ \g_semantex_data_tl_get_store:nnN { #1 } { postlowerleft } \l__semantex_leftreturn_postlowerleft_temp
+ \g_semantex_data_tl_set:nnx { #1 } { symbol }
+ {
+ % Setup indices:
+ \exp_not:N\g_semantex_left_indices:nnnnnn
+ {
+ \exp_not:V \l__semantex_leftreturn_preupperleft_temp
+ }
+ {
+ \exp_not:V \l__semantex_leftreturn_upper_left_index_temp
+ }
+ {
+ \exp_not:V \l__semantex_leftreturn_postupperleft_temp
+ }
+ {
+ \exp_not:V \l__semantex_leftreturn_prelowerleft_temp
+ }
+ {
+ \exp_not:V \l__semantex_leftreturn_lower_left_index_temp
+ }
+ {
+ \exp_not:V \l__semantex_leftreturn_postlowerleft_temp
+ }
+ \exp_not:V \l__semantex_leftreturn_symbol_temp
+ }
+ \g_semantex_data_tl_clear:nn { #1 } { upper_left_index }
+ \g_semantex_data_bool_provide:nn { #1 } { first_upper_left }
+ \g_semantex_data_bool_set_true:nn { #1 } { first_upper_left }
+ \g_semantex_data_tl_clear:nn { #1 } { lower_left_index }
+ \g_semantex_data_bool_provide:nn { #1 } { first_lower_left }
+ \g_semantex_data_bool_set_true:nn { #1 } { first_lower_left }
+ \g_semantex_data_tl_clear:nn { #1 } { preupperleft }
+ \g_semantex_data_tl_clear:nn { #1 } { postupperleft }
+ \g_semantex_data_tl_clear:nn { #1 } { prelowerleft }
+ \g_semantex_data_tl_clear:nn { #1 } { postlowerleft }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_parent:nn#1#2{
+ % Must inherit everything from the parent class
+ %\tl_clear_new:c { semantex_data_tl_#1_parent }
+ %\g_semantex_data_tl_provide:nn { #1 } { parent }
+ %IM This should always be declared, so no need for if_provided checks
+ %IM This does not work, for unknown reasons:
+% \seq_if_in:NxTF \semantex_all_objects_seq { #2 }
+% { \tl_set:cn { semantex_data_tl_#1_parent } { #2 } }
+% { \msg_error:nnnn { semantex } { parent_not_found } { #2 } { #1 } }
+ %IM control if exists!
+ %\tl_set:cn { semantex_data_tl_#1_parent } { #2 }
+ \g_semantex_data_tl_set:nnn { #1 } { parent } { #2 }
+}
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_class:nn\g_semantex_primitive_valuekey_parent:nn
+
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_copy:nn#1#2{
+ % Must inherit everything from the parent class
+ \g_semantex_primitive_valuekey_parent:nn{#1}{ \cs_to_str:N #2 }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_valuekeys:nn#1#2{
+ % Add new valuekeys via the interface
+ % valuekeys={
+ % {key1}{do something with \l_semantex_key_value_temp},
+ % {key2}{g=\l_semantex_key_value_temp,i=\l_semantex_key_value_temp},
+ % }
+ \g_semantex_data_prop_provide:nn { #1 } { custom_valuekeys }
+ \clist_map_inline:nn { #2 }{
+ \g_semantex_valuekey_equality_format:nnn{#1}##1
+ }
+}
+
+\cs_generate_variant:Nn\g_semantex_data_prop_put:nnnn {nnno}
+
+\cs_new:Npn \g_semantex_valuekey_equality_format:nnn#1#2#3
+{
+ \cs_set:Npn\l__semantex_valuekey_equality_format_temp:n##1{#3}
+ \g_semantex_data_prop_put:nnno {#1} {custom_valuekeys} {#2} {\l__semantex_valuekey_equality_format_temp:n{\l_semantex_key_value_temp}}
+ %IM Remove spaces in #2
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_novaluekeys:nn#1#2{
+ % Add sinple keys, taking no values, via the
+ % interface
+ % novaluekeys={
+ % {key1}{print something},
+ % {key2}{d=42,i=42},
+ % }
+ \g_semantex_data_prop_provide:nn { #1 } { custom_novaluekeys }
+ \clist_map_inline:nn { #2 }{
+ \g_semantex_valuekey_noequality_format:nnn{#1}##1
+ }
+}
+
+\cs_new:Npn \g_semantex_valuekey_noequality_format:nnn#1#2#3{
+ %\prop_put:cnn { semantex_data_prop_#1_custom_novaluekeys }{#2}{#3}
+ \g_semantex_data_prop_put:nnnn {#1} {custom_novaluekeys} {#2} {#3}
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_argvaluekeys:nn#1#2{
+ % Add new valuekeys via the interface
+ % valuekeys={
+ % {key1}{do something with \l_semantex_key_value_temp},
+ % {key2}{g=\l_semantex_key_value_temp,i=\l_semantex_key_value_temp},
+ % }
+ \g_semantex_data_prop_provide:nn { #1 } { custom_arg_valuekeys }
+ \clist_map_inline:nn { #2 }{
+ \g_semantex_arg_valuekey_equality_format:nnn{#1}##1
+ }
+}
+
+\cs_new:Npn \g_semantex_arg_valuekey_equality_format:nnn#1#2#3{
+ %\prop_put:cnn { semantex_data_prop_#1_custom_arg_valuekeys }{#2}{#3}
+ \cs_set:Npn\l__semantex_arg_valuekey_equality_format_temp:n##1{#3}
+ \g_semantex_data_prop_put:nnno {#1} {custom_arg_valuekeys} {#2} {\l__semantex_arg_valuekey_equality_format_temp:n{\l_semantex_arg_key_value_temp}}
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_argnovaluekeys:nn#1#2{
+ % Add sinple keys, taking no values, via the
+ % interface
+ % novaluekeys={
+ % {key1}{print something},
+ % {key2}{g=42,i=42},
+ % }
+ \g_semantex_data_prop_provide:nn { #1 } { custom_arg_novaluekeys }
+ \clist_map_inline:nn { #2 }{
+ \g_semantex_arg_valuekey_noequality_format:nnn{#1}##1
+ }
+}
+
+\cs_new:Npn \g_semantex_arg_valuekey_noequality_format:nnn#1#2#3{
+ \g_semantex_data_prop_put:nnnn {#1} {custom_arg_novaluekeys} {#2} {#3}
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_symbol:nn#1#2{
+ % Sets the value of the symbol
+ \g_semantex_data_tl_set:nnn { #1 } { symbol } { \exp_not:n { #2 } }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_texclass:nn#1#2{
+ % Sets the value of the symbol
+ \g_semantex_data_tl_set:nnn { #1 } { texclass } { \exp_not:n { #2 } }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_slot:nn#1#2{
+ % Sets the value of the symbol
+ \g_semantex_data_tl_set:nnn { #1 } { slot } { \exp_not:n { #2 } }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_symbolputright:nn#1#2{
+ \g_semantex_data_tl_put_right:nnn { #1 } { symbol } { \exp_not:n { #2 } }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_symbolputleft:nn#1#2{
+ \g_semantex_data_tl_put_left:nnn { #1 } { symbol } { \exp_not:n { #2 } }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_command:nn#1#2{
+ % Adds one entry on the left of the command
+ % sequence to be applied to the symbol
+ \g_semantex_data_seq_put_right:nnn { #1 } { commands_sequence } { #2 } %IM maybe \exp_not:n { #2 }?
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_argwithkeyval:nn#1#2{
+ % Sets the argument (printed in parentheses
+ % after the symbol)
+ \g_semantex_arg_keys_set:nn { #1 } {{{ #2 }}}
+ %IM for unknown reasons, one needs these extra braces.
+ %IM This should be moved to the arg valuekeys themselves
+ %IM where ifoutput=true is also declared
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_argwithnovaluekeys:nn#1#2{
+ % Sets the argument (printed in parentheses
+ % after the symbol)
+ \g_semantex_arg_novaluekeys_set:nn { #1 } { #2 }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_argwithonenovaluekey:nn#1#2{
+ % Sets the argument (printed in parentheses
+ % after the symbol)
+ \use:c { g_semantex_data_cs_#1_arg_novaluekey:n } {{{{ #2 }}}}
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_argwithoutkeyval:nn#1#2{
+ \g_semantex_data_tl_put_right:nnn { #1 } { arg } { \exp_not:n { #2 } }
+ \g_semantex_primitive_valuekey_ifrightreturnbeforerender:nn{#1}{true}
+}
+
+
+%\cs_new:Npn\g_semantex_primitive_valuekey_useargwithkeyval:nn#1#2
+%{
+%% \g_semantex_primitive_valuekey_valuekeys:nn { #1 }
+%% {
+%% {arg} { argwithkeyval={ \l_semantex_key_value_temp } },
+%% }
+% \g_semantex_keys_set:nn { #1 }{
+% \exp_not:n{valuekeys={
+% {arg}{ argwithkeyval={\l_semantex_key_value_temp} },
+% },}
+% }
+%}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_argsep:nn#1#2
+{
+ %\g_semantex_data_tl_provide:nn { #1 } { argsep }
+ \g_semantex_data_tl_set:nnn { #1 } { argsep } { \exp_not:n { #2 } }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_argdots:nn#1#2
+{
+% \g_semantex_data_tl_provide:nn { #1 } { argdots }
+ \g_semantex_data_tl_set:nnn { #1 } { argdots } { \exp_not:n { #2 } }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_prearg:nn#1#2{
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { prearg } { \exp_not:n { #2 } }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_postarg:nn#1#2{
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { postarg } { \exp_not:n{ #2 } }
+ }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_output:nn#1#2
+{
+ \g_semantex_data_tl_set:nnn { #1 } { output } { #2 }
+ % Maybe allow output=self
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_outputoptions:nn#1#2{
+ \g_semantex_data_tl_put_right:nnn { #1 } { output_options } { #2, }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_ifrightreturnbeforerender:nn#1#2{
+ % tells whether to use the output class or not
+ \str_if_eq:nnTF { #2 } { true }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { rightreturnbeforerender }
+ }
+ {
+ \str_if_eq:nnTF { #2 } { false }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { rightreturnbeforerender }
+ }
+ {
+ %IM do nothing right now, but should
+ %IM probably throw an error
+ }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_ifoutput:nn#1#2{ %IMPLEMENT THIS
+ % tells whether to output or not
+ \str_if_eq:nnTF { #2 } { true }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { output }
+ }
+ {
+ \str_if_eq:nnTF { #2 } { false }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { output }
+ }
+ {
+ %IM do nothing right now, but should
+ %IM probably throw an error
+ }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_gradingpos:nn#1#2{
+ % tells whether to use upper or lower indices
+ \g_semantex_data_bool_provide:nn { #1 } { upper_grading }
+ \str_case:nnTF { #2 }
+ {
+ { upper }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { upper_grading }
+ }
+ { lower }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { upper_grading }
+ }
+ }
+ {
+ % do nohting
+ }
+ {
+ % do nothing at the moment, but should probably throw an error
+ }
+}
+
+\cs_set_eq:NN \g_semantex_primitive_valuekey_gradingposition:nn \g_semantex_primitive_valuekey_gradingpos:nn
+
+% Upper and lower right indices:
+
+\cs_new:Npn\g_semantex_primitive_valuekey_upper:nn#1#2{
+ % adds to the upper index
+ \tl_if_blank:nF{#2}{
+ \g_semantex_data_tl_put_right:nnn { #1 } { upper_index } { \exp_not:n{ #2 } }
+ % For a long time, when using x type expansions when checking
+ % if indices were empty, two \exp_not:n's were necessary here.
+ % Thankfully, I can now happily remove them again, it seems.
+ %\g_semantex_data_bool_provide:nn { #1 } { first_upper }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper }
+ }
+}
+
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_supper:nn#1#2{
+ % adds to the upper index, with a separator
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_bool_get:nnTF { #1 } { first_upper }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { upper_index } { \exp_not:n { #2 } }
+ }
+ {
+ \g_semantex_data_tl_put_right:nnx { #1 } { upper_index }
+ { \exp_not:n { \g_semantex_data_tl_get:nn { #1 } { uppersep } } }
+ \g_semantex_data_tl_put_right:nnn { #1 } { upper_index } { \exp_not:n { #2 } }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_upperaddleft:nn#1#2{
+ % adds to the upper index
+ \tl_if_blank:nF{#2}{
+ \g_semantex_data_tl_put_left:nnn { #1 } { upper_index } { \exp_not:n{ #2 } }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_preupper:nn#1#2{
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_left:cn { #1 } { preupper } { \exp_not:n{ #2 } }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_postupper:nn#1#2{
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { postupper } { \exp_not:n{ #2 } }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_lower:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { lower_index } { \exp_not:n { #2 } }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_slower:nn#1#2{
+ % adds to the lower index, with a separator
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_bool_get:nnTF { #1 } { first_lower }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { lower_index } { \exp_not:n { #2 } }
+ }
+ {
+ \g_semantex_data_tl_put_right:nnx { #1 } { lower_index }
+ { \exp_not:n { \g_semantex_data_tl_get:nn { #1 } { lowersep } } }
+ \g_semantex_data_tl_put_right:nnn { #1 } { lower_index } { \exp_not:n { #2 } }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_loweraddleft:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { lower_index } { \exp_not:n { #2 } }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_prelower:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { prelower } { \exp_not:n { #2 } }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_postlower:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { postlower } { \exp_not:n{ #2 } }
+ }
+}
+
+\cs_generate_variant:Nn \tl_if_blank:nTF { vTF }
+
+\cs_new:Npn \g_semantex_primitive_upper_lower_auxiliary_first_arg:nn#1#2 { #1 }
+
+\cs_new:Npn \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn#1#2 { #2 }
+
+\cs_new:Npn\g_semantex_primitive_valuekey_uppersep:nn#1#2{
+ % uppersep={separator}{contents} adds contents to the upper index
+ % with the appropriate index separator
+ \g_semantex_data_bool_inherit:nn { #1 } { first_upper }
+ \g_semantex_data_bool_get:nnTF { #1 } { first_upper }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { upper_index } {
+ \exp_not:n {
+ \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn #2
+ }
+ }
+ }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { upper_index } {
+ \exp_not:n {
+ \g_semantex_primitive_upper_lower_auxiliary_first_arg:nn #2
+ \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn #2
+ }
+ }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_lowersep:nn#1#2{
+ % lowersep={separator}{contents} adds contents to the lower index
+ % with the appropriate index separator
+ \g_semantex_data_bool_get:nnTF { #1 } { first_lower }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { lower_index } {
+ \exp_not:n {
+ \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn #2
+ }
+ }
+ }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { lower_index } {
+ \exp_not:n { \g_semantex_primitive_upper_lower_auxiliary_first_arg:nn #2 \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn #2
+ }
+ }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_cupper:nn#1#2{
+ % adds to the upper index, with a comma as separator
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_bool_get:nnTF { #1 } { first_upper }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { upper_index } { \exp_not:n { #2 } }
+ }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { upper_index } { , \exp_not:n { #2 } }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper }
+ }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_clower:nn#1#2{
+ % adds to the lower index, with a comma as separator
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_bool_get:nnTF { #1 } { first_lower }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { lower_index } { \exp_not:n { #2 } }
+ }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { lower_index } { , \exp_not:n { #2 } }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_iffirstupper:nn#1#2
+{
+ \tl_if_eq:nnTF { #2 } { true }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { first_upper }
+ }
+ {
+ \tl_if_eq:nnTF { #2 } { false }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper }
+ }
+ {
+ %IM Throw error later
+ }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_iffirstlower:nn#1#2
+{
+ \tl_if_eq:nnTF { #2 } { true }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { first_lower }
+ }
+ {
+ \tl_if_eq:nnTF { #2 } { false }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower }
+ }
+ {
+ %IM Throw error later
+ }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_setuppersep:nn#1#2
+{
+ \g_semantex_data_tl_set:nnn { #1 } { uppersep } { \exp_not:n { #2 }}
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_setlowersep:nn#1#2
+{
+ \g_semantex_data_tl_set:nnn { #1 } { lowersep } { \exp_not:n { #2 }}
+}
+
+%--------------- Left indices:
+
+\cs_new:Npn\g_semantex_primitive_valuekey_upperleft:nn#1#2{
+ % adds to the upper left index
+ \tl_if_blank:nF{#2}{
+ \g_semantex_data_tl_put_left:nnn { #1 } { upper_left_index } { \exp_not:n{ #2 } }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper_left }
+ }
+}
+
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_supperleft:nn#1#2{
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_bool_get:nnTF { #1 } { first_upper_left }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { upper_left_index } { \exp_not:n { #2 } }
+ }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { upper_left_index } { \exp_not:n { #2 } }
+ \g_semantex_data_tl_put_left:nnx { #1 } { upper_left_index }
+ { \exp_not:n { \g_semantex_data_tl_get:nn { #1 } { uppersep } } }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper_left }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_upperleftaddright:nn#1#2{
+ % adds to the upper index
+ \tl_if_blank:nF{#2}{
+ \g_semantex_data_tl_put_right:nnn { #1 } { upper_left_index } { \exp_not:n{ #2 } }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper_left }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_preupperleft:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { preupperleft } { \exp_not:n{ #2 } }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_postupperleft:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { postupperleft } { \exp_not:n{ #2 } }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_lowerleft:nn#1#2{
+ % adds to the lower left index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { lower_left_index } { \exp_not:n{ #2 } }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower_left }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_slowerleft:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_bool_get:nnTF { #1 } { first_lower_left }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { lower_left_index } { \exp_not:n { #2 } }
+ }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { lower_left_index } { \exp_not:n { #2 } }
+ \g_semantex_data_tl_put_left:nnx { #1 } { lower_left_index }
+ { \exp_not:n { \g_semantex_data_tl_get:nn { #1 } { lowerleftsep } } }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower_left }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_lowerleftaddright:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2} %This test really shouldn’t be made.
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { lower_left_index } { \exp_not:n{ #2 } }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower_left }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_prelowerleft:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { prelowerleft } { \exp_not:n{ #2 } }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_postlowerleft:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { postlowerleft } { \exp_not:n{ #2 } }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_upperleftsep:nn#1#2{
+ % adds to the upper index
+ \g_semantex_data_bool_get:nnTF { #1 } { first_left_upper }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { upper_left_index } {
+ \exp_not:n { \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn #2 }
+ }
+ }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { upper_left_index } {
+ \exp_not:n { \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn #2 \g_semantex_primitive_upper_lower_auxiliary_first_arg:nn #2 }
+ }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_left_upper }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_lowerleftsep:nn#1#2{
+ % adds to the lower index
+ \g_semantex_data_bool_get:nnTF { #1 } { first_lower_left }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { lower_left_index } {
+ \exp_not:n { \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn #2 }
+ }
+ }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { lower_left_index } {
+ \exp_not:n { \g_semantex_primitive_upper_lower_auxiliary_second_arg:nn #2 \g_semantex_primitive_upper_lower_auxiliary_first_arg:nn #2 }
+ }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower_left }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_cupperleft:nn#1#2{
+ % adds to the upper index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_bool_get:nnTF { #1 } { first_upper_left }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { upper_left_index } { \exp_not:n { #2 } }
+ }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { upper_left_index } { \exp_not:n { #2 } , }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper_left }
+ }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_clowerleft:nn#1#2{
+ % adds to the lower index
+ \tl_if_blank:nF{#2}
+ {
+ \g_semantex_data_bool_get:nnTF { #1 } { first_lower_left }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { lower_left_index } { \exp_not:n { #2 } }
+ }
+ {
+ \g_semantex_data_tl_put_left:nnn { #1 } { lower_left_index } { \exp_not:n { #2 } , }
+ }
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower_left }
+ }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_iffirstupperleft:nn#1#2
+{
+ \tl_if_eq:nnTF { #2 } { true }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { first_upper_left }
+ }
+ {
+ \tl_if_eq:nnTF { #2 } { false }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { first_upper_left }
+ }
+ {
+ %IM Throw error later
+ }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_iffirstlowerleft:nn#1#2
+{
+ \tl_if_eq:nnTF { #2 } { true }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { first_lower_left }
+ }
+ {
+ \tl_if_eq:nnTF { #2 } { false }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { first_lower_left }
+ }
+ {
+ %IM Throw error later
+ }
+ }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_setupperleftsep:nn#1#2
+{
+ \g_semantex_data_tl_set:nnn { #1 } { upperleftsep } { \exp_not:n { #2 } }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_setlowerleftsep:nn#1#2
+{
+ \g_semantex_data_tl_set:nnn { #1 } { lowerleftsep } { \exp_not:n { #2 } }
+}
+
+%---------------
+
+% Contrary to what you might think, the following commands ARE
+% sometimes needed.
+
+\cs_new:Npn\g_semantex_primitive_valuekey_iffirstd:nn#1#2
+{
+ \g_semantex_data_bool_get:nnTF { #1 } { upper_grading }
+ { \g_semantex_primitive_valuekey_iffirstupper:nn { #1 } { #2 } }
+ { \g_semantex_primitive_valuekey_iffirstlower:nn { #1 } { #2 } }
+}
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_iffirstdeg:nn\g_semantex_primitive_valuekey_iffirstd:nn
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_iffirstdegree:nn\g_semantex_primitive_valuekey_iffirstd:nn
+
+\cs_new:Npn\g_semantex_primitive_valuekey_iffirsti:nn#1#2
+{
+ \g_semantex_data_bool_get:nnTF { #1 } { upper_grading }
+ { \g_semantex_primitive_valuekey_iffirstlower:nn { #1 } { #2 } }
+ { \g_semantex_primitive_valuekey_iffirstupper:nn { #1 } { #2 } }
+}
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_iffirstindex:nn\g_semantex_primitive_valuekey_iffirsti:nn
+
+\cs_new:Npn\g_semantex_primitive_valuekey_d:nn#1#2
+{
+ % adds to the d-index (upper by default)
+ % I added an \exp_not:n here and in similar commands to
+ % take care of \underbrace expansion issues. However,
+ % I am puzzled as to why it was necessary.
+ %\bool_if:cTF { semantex_data_bool_#1_if_upper_grading }
+ \g_semantex_data_bool_get:nnTF { #1 } { upper_grading }
+ {
+ \g_semantex_primitive_valuekey_upper:nn { #1 } { #2 }
+ }
+ {
+ \g_semantex_primitive_valuekey_lower:nn { #1 } { #2 }
+ }
+}
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_deg:nn\g_semantex_primitive_valuekey_d:nn
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_degree:nn\g_semantex_primitive_valuekey_d:nn
+
+\cs_new:Npn\g_semantex_primitive_valuekey_sd:nn#1#2
+{
+ % adds to the d-index (upper by default)
+ \g_semantex_data_bool_get:nnTF { #1 } { upper_grading }
+ {
+ \g_semantex_primitive_valuekey_supper:nn { #1 } { #2 }
+ }
+ {
+ \g_semantex_primitive_valuekey_slower:nn { #1 } { #2 }
+ }
+}
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_sdeg:nn\g_semantex_primitive_valuekey_sd:nn
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_sdegree:nn\g_semantex_primitive_valuekey_sd:nn
+
+\cs_new:Npn\g_semantex_primitive_valuekey_cd:nn#1#2{ %IM Maybe remove this.
+ % adds to the d-index (upper by default)
+ \g_semantex_data_bool_get:nnTF { #1 } { upper_grading }
+ {
+ \g_semantex_primitive_valuekey_cupper:nn { #1 } { #2 }
+ }
+ {
+ \g_semantex_primitive_valuekey_clower:nn { #1 } { #2 }
+ }
+}
+
+
+
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_cdeg:nn\g_semantex_primitive_valuekey_cd:nn
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_cdegree:nn\g_semantex_primitive_valuekey_cd:nn
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_i:nn#1#2{
+ % adds to the i-index (lower by default)
+ %\bool_if:cTF { semantex_data_bool_#1_if_upper_grading }
+ \g_semantex_data_bool_get:nnTF { #1 } { upper_grading }
+ {
+ \g_semantex_primitive_valuekey_lower:nn { #1 } { #2 }
+ }
+ {
+ \g_semantex_primitive_valuekey_upper:nn { #1 } { #2 }
+ }
+}
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_index:nn\g_semantex_primitive_valuekey_i:nn
+
+\cs_new:Npn\g_semantex_primitive_valuekey_si:nn#1#2{
+ % adds to the i-index (lower by default)
+ \g_semantex_data_bool_get:nnTF { #1 } { upper_grading }
+ {
+ \g_semantex_primitive_valuekey_slower:nn { #1 } { #2 }
+ }
+ {
+ \g_semantex_primitive_valuekey_supper:nn { #1 } { #2 }
+ }
+}
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_sindex:nn\g_semantex_primitive_valuekey_si:nn
+
+\cs_new:Npn\g_semantex_primitive_valuekey_ci:nn#1#2{
+ % adds to the i-index (lower by default)
+ %\bool_if:cTF { semantex_data_bool_#1_if_upper_grading }
+ \g_semantex_data_bool_get:nnTF { #1 } { upper_grading }
+ {
+ \g_semantex_primitive_valuekey_clower:nn { #1 } { #2 }
+ }
+ {
+ \g_semantex_primitive_valuekey_cupper:nn { #1 } { #2 }
+ }
+}
+
+\cs_set_eq:NN\g_semantex_primitive_valuekey_cindex:nn\g_semantex_primitive_valuekey_ci:nn
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_par:nn#1#2{
+ % sets the size of the parentheses
+ \g_semantex_data_tl_set:nnn { #1 } { par_size }{ \exp_not:n { #2 } }
+ \g_semantex_primitive_valuekey_ifpar:nn { #1 } { true }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_parsize:nn#1#2{
+ % sets the size of the parentheses
+ \g_semantex_data_tl_set:nnn { #1 } { par_size }{ \exp_not:n { #2 } }
+}
+
+
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_leftpar:nn#1#2{
+% \g_semantex_data_tl_set:nnn { #1 } { par_open }{ \exp_not:n { #2 } }
+ \tl_set:cn { semantex_data_tl_#1_par_open }{ \exp_not:n { #2 } }
+}
+
+
+
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_rightpar:nn#1#2{
+ \g_semantex_data_tl_set:nnn { #1 } { par_close }{ \exp_not:n { #2 } }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_ifpar:nn#1#2{ %IMPLEMENT THIS
+ % tells whether to use the output class or not
+ \g_semantex_data_bool_provide:nn { #1 } { par }
+ \str_if_eq:nnTF { #2 } { true }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { par }
+ }
+ {
+ \str_if_eq:nnTF { #2 } { false }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { par }
+ }
+ {
+ %IM do nothing right now, but should
+ %IM probably throw an error
+ }
+ }
+}
+
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_spar:nn#1#2
+{
+ \tl_if_blank:nTF { #2 }
+ {
+ \g_semantex_primitive_valuekey_return:nn { #1 }{}
+ \g_semantex_data_tl_set:nnx { #1 } { symbol }
+ {
+ { \g_semantex_data_tl_get_exp_not:nn { #1 } { spar_size } }
+ %IM like in _return
+ { \g_semantex_data_tl_get:nn { #1 } { spar_open } }
+ { \g_semantex_data_tl_get:nn { #1 } { spar_close } }
+ { \g_semantex_data_tl_get_exp_not:nn { #1 } { symbol } }
+% { \l__semantex_spar_symbol_temp }
+ }
+ \g_semantex_data_tl_put_left:nnn { #1 } { symbol }
+ {
+ \exp_not:N
+ \g_semantex_symbol_parentheses:nnnn
+ }
+ }
+ {
+ \g_semantex_data_tl_inherit:nn { #1 } { symbol }
+ \g_semantex_primitive_valuekey_return:nn { #1 }{}
+ \g_semantex_data_tl_set:nnx { #1 } { symbol }
+ {
+ { \exp_not:n { \exp_not:n { #2 } } }
+ { \g_semantex_data_tl_get:nn { #1 } { spar_open } }
+ { \g_semantex_data_tl_get:nn { #1 } { spar_close } }
+ { \g_semantex_data_tl_get_exp_not:nn { #1 } { symbol } }
+ }
+ \g_semantex_data_tl_put_left:nnn { #1 } { symbol }
+ {
+ \exp_not:N
+ \g_semantex_symbol_parentheses:nnnn
+ }
+ }
+}
+
+
+\cs_new:Npn\g_semantex_primitive_valuekey_iffirstarg:nn#1#2
+{
+ \tl_if_eq:nnTF { #2 } { true }
+ {
+ \g_semantex_data_bool_set_true:nn { #1 } { first_arg }
+ }
+ {
+ \tl_if_eq:nnTF { #2 } { false }
+ {
+ \g_semantex_data_bool_set_false:nn { #1 } { first_arg }
+ }
+ {
+ %IM Throw error later
+ }
+ }
+}
+
+\cs_new:Npn\g_semantex_auxiliary_first_arg:nn#1#2 { #1 }
+\cs_new:Npn\g_semantex_auxiliary_second_arg:nn#1#2 { #2 }
+
+%\cs_new:Npn\g_semantex_primitive_valuekey_otherspar:nn#1#2
+%{
+% \g_semantex_data_tl_inherit:nn { #1 } { spar_size }
+% \g_semantex_data_tl_inherit:nn { #1 } { symbol }
+% \g_semantex_primitive_novaluekey_return:n { #1 }
+%% \tl_set:Nn\l__semantex_spar_temp
+%% {
+%% \exp_not:N
+%% \g_semantex_symbol_parentheses:nnnn
+%% }
+%% \tl_put_right:Nx\l__semantex_spar_temp
+%% {
+%% { \exp_not:v { semantex_data_tl_#1_spar_size } }
+%% { \g_semantex_auxiliary_first_arg:nn#2 }
+%% { \g_semantex_auxiliary_second_arg:nn#2 }
+%% { \exp_not:v { semantex_data_tl_#1_symbol } }
+%% }
+%% \tl_set:cx { semantex_data_tl_#1_symbol } { \exp_not:V\l__semantex_spar_temp }
+% \tl_set:cx { semantex_data_tl_#1_symbol }
+% {
+% %{ \exp_not:c { semantex_data_tl_#1_spar_size } }
+% { \exp_not:n { \use:c { semantex_data_tl_#1_spar_size } } }
+% { \g_semantex_auxiliary_first_arg:nn #2 }
+% { \g_semantex_auxiliary_second_arg:nn #2 }
+% { \exp_not:v { semantex_data_tl_#1_symbol } }
+% }
+% \tl_put_left:cn { semantex_data_tl_#1_symbol }
+% {
+% \exp_not:N
+% \g_semantex_symbol_parentheses:nnnn
+% }
+%}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_otherspar:nn#1#2
+{
+ \g_semantex_primitive_valuekey_otherspar_auxiliary:nnn { #1 } #2
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_otherspar_auxiliary:nnn#1#2#3
+{
+ %IM DOES NOT WORK!!!!!
+ \g_semantex_data_tl_inherit:nn { #1 } { spar_size }
+ \g_semantex_data_tl_get_store:nnN { #1 } { spar_size } \l__semantex_otherspar_spar_size_temp
+ \g_semantex_data_tl_inherit:nn { #1 } { symbol }
+ \g_semantex_primitive_valuekey_return:nn { #1 }{}
+% \tl_set:Nn\l__semantex_spar_temp
+% {
+% \exp_not:N
+% \g_semantex_symbol_parentheses:nnnn
+% }
+% \tl_put_right:Nx\l__semantex_spar_temp
+% {
+% { \exp_not:v { semantex_data_tl_#1_spar_size } }
+% { \g_semantex_auxiliary_first_arg:nn#2 }
+% { \g_semantex_auxiliary_second_arg:nn#2 }
+% { \exp_not:v { semantex_data_tl_#1_symbol } }
+% }
+% \tl_set:cx { semantex_data_tl_#1_symbol } { \exp_not:V\l__semantex_spar_temp }
+ \g_semantex_data_tl_set:nnx { #1 } { symbol }
+ {
+ %{ \exp_not:c { semantex_data_tl_#1_spar_size } }
+ %{ \exp_not:n { \use:c { semantex_data_tl_#1_spar_size } } }
+ %{ normal }
+ %{ \exp_not:n { \exp_not:v { semantex_data_tl_#1_spar_size } } }
+ { \exp_not:V \l__semantex_otherspar_spar_size_temp }
+ { \exp_not:n { \exp_not:n { #2 } } }
+ { \exp_not:n { \exp_not:n { #3 } } }
+ { \g_semantex_data_tl_get_exp_not:nn { #1 } { symbol } }
+ }
+ \g_semantex_data_tl_put_left:nnn { #1 } { symbol }
+ {
+ \exp_not:N
+ \g_semantex_symbol_parentheses:nnnn
+ }
+% \tl_put_left:cx { g_auomath_#1_symbol }
+% {
+% \exp_not:N
+% \g_semantex_symbol_parentheses:nnnn
+% }
+ %\tl_put_left:cn { semantex_data_tl_#1_symbol }
+ %{
+ % \exp_not:N
+ % \g_semantex_symbol_parentheses:nnnn
+ %}
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_sparsize:nn#1#2{
+ % sets the size of the parentheses
+ \g_semantex_data_tl_set:nnn { #1 } { spar_size }{ \exp_not:n { #2 } }
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_leftspar:nn#1#2{
+ \g_semantex_data_tl_set:nnn { #1 } { spar_open }{ \exp_not:n { \exp_not:n { #2 } } }
+ %IM Two \exp_not necessary for unknown reasons
+ %IM Doing the same at leftpar yields an error.
+}
+
+\cs_new:Npn\g_semantex_primitive_valuekey_rightspar:nn#1#2{
+ \g_semantex_data_tl_set:nnn { #1 } { spar_close }{ \exp_not:n { \exp_not:n { #2 } } }
+ %IM Two \exp_not necessary for unknown reasons
+ %IM Doing the same at leftpar yields an error.
+}
+
+
+
+
+
+
+%\msg_new:nnnn { semantex } { singlekey_not_found } { Unknown~key~#1~passed~to~object~#2~on~input~line~\msg_line_number: } {}
+
+\cs_generate_variant:Nn \g_semantex_keys_set:nn { nx, no, nV }
+
+\cs_generate_variant:Nn \exp_args:Nnx { cnx }
+
+\cs_new:Npn \g_semantex_valuekey:nnn#1#2#3{
+ % Takes care of valuekeys, keys with a value
+ % For the sake of implementation, the arguments
+ % come in a strange order
+ % #1 = value of key
+ % #2 = name of the key
+ % #3 = object
+ %\tl_set:Nn\l_semantex_key_value_temp{#1}
+ \tl_set:Nn\l_semantex_key_value_temp{\exp_not:n{#1}}
+ %\tl_set:Nx\l_semantex_key_value_temp{\exp_not:n{\exp_not:n{#1}}} % stores the content of the key in the temporary command \l_semantex_key_value_temp
+ %\tl_set:Nn\l_semantex_key_value_temp{#1}
+ %\tl_set:No\l_semantex_key_value_temp{\exp_not:n{#1}} % stores the content of the key in the temporary command \l_semantex_key_value_temp
+ %IM think about using extra {...} to avoid interference with keyval str
+ \g_semantex_valuekey_get:nnNTF { #3 } { #2 } \l_semantex_custom_valuekey_temp
+ {
+ \g_semantex_keys_set:nx { #3 }
+ { \l_semantex_custom_valuekey_temp }
+ }
+ {
+ \cs_if_exist:cTF { g_semantex_primitive_valuekey_#2:nn }
+ {
+ \use:c { g_semantex_primitive_valuekey_#2:nn }{ #3 }{ #1 }
+ }
+ {
+ \msg_error:nnnn { semantex } { keyval_not_found } { #2 } { #3 }
+ }
+ }
+}
+
+\cs_generate_variant:Nn \g_semantex_keys_set:nn { nx }
+
+\cs_new:Npn \g_semantex_novaluekey:nn#1#2
+{
+ % #1 = name of the key
+ % #2 = object
+% % takes care of single keys, keys without a value
+ \g_semantex_novaluekey_get:nnNTF { #2 } { #1 } \l_semantex_custom_novaluekey_temp
+ {
+ \g_semantex_keys_set:nx { #2 }
+ {
+ \l_semantex_custom_novaluekey_temp
+ }
+ }
+ {
+ \g_semantex_keys_set:nn { #2 } { default = { #1 } }
+ }
+}
+
+%IMplement the same thing for upper, lower?? Probably not.
+
+\cs_new:Npn \g_semantex_arg_primitive_valuekey_sep_auxiliary_function_withsep:nn#1#2
+{
+ #1#2
+}
+
+\cs_new:Npn \g_semantex_arg_primitive_valuekey_sep_auxiliary_function_withoutsep:nn#1#2
+{
+ #2
+}
+
+\cs_new:Npn \g_semantex_primitive_arg_valuekey_sep:nn#1#2
+{
+ \g_semantex_data_bool_get:nnTF { #1 } { first_arg }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { arg } {
+ \exp_not:n { \g_semantex_arg_primitive_valuekey_sep_auxiliary_function_withoutsep:nn #2 }
+ }
+ %IM These do not use :x, unlike the ones below
+ }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { arg } { \exp_not:n { \g_semantex_arg_primitive_valuekey_sep_auxiliary_function_withsep:nn #2 } }
+ }
+ \g_semantex_primitive_valuekey_ifrightreturnbeforerender:nn{#1}{true}
+ \g_semantex_data_bool_set_false:nn { #1 } { first_arg }
+}
+
+\cs_new:Npn \g_semantex_primitive_arg_valuekey_standardsep:nn#1#2
+{
+ \g_semantex_data_bool_get:nnTF { #1 } { first_arg }
+ {
+ \g_semantex_data_tl_put_right:nnn { #1 } { arg } { \exp_not:n { #2 } }
+ %IM Recently corrected
+ % Previously, this was cx, but I didn’t see any point of this;
+ % this was mostly to create symmetry with the below case where
+ % cx is strictly necessary.
+ }
+ {
+ \g_semantex_data_tl_put_right:nnx { #1 } { arg } { \exp_not:n { \g_semantex_data_tl_get:nn { #1 } { argsep } } }
+ \g_semantex_data_tl_put_right:nnn { #1 } { arg } {\exp_not:n { #2 } }
+ % As an experiment, I tried changing cx to cn, and it failed
+ % when changing the separator on the fly.
+ }
+% \g_semantex_primitive_valuekey_ifoutput:nn { #1 } { true }
+ \g_semantex_primitive_valuekey_ifrightreturnbeforerender:nn{#1}{true}
+ \g_semantex_data_bool_set_false:nn { #1 } { first_arg }
+}
+
+\cs_new:Npn \g_semantex_primitive_arg_valuekey_dots:nn#1#2
+{
+ \g_semantex_primitive_arg_valuekey_standardsep:nn { #1 } { \g_semantex_data_tl_get:nn { #1 } { argdots } }
+}
+
+\cs_new:Npn \g_semantex_primitive_arg_valuekey_slot:nn#1#2
+{
+ \g_semantex_primitive_arg_valuekey_standardsep:nn { #1 } { \g_semantex_data_tl_get:nn { #1 } { slot } }
+}
+
+\cs_generate_variant:Nn \g_semantex_arg_keys_set:nn { nx }
+
+\cs_new:Npn \g_semantex_arg_valuekey:nnn#1#2#3
+{
+ % Takes care of valuekeys, keys with a value
+ % For the sake of implementation, the arguments
+ % come in a strange order
+ % #1 = value of key
+ % #2 = name of the key
+ % #3 = object
+ \tl_set:Nn\l_semantex_arg_key_value_temp{\exp_not:n{#1}} % stores the content of the key in the temporary command \l_semantex_key_value_temp
+ \g_semantex_arg_valuekey_get:nnNTF { #3 } { #2 } \l_semantex_custom_arg_valuekey_temp
+ {
+ \g_semantex_arg_keys_set:nx { #3 } { \l_semantex_custom_arg_valuekey_temp }
+ }
+ {
+ \cs_if_exist:cTF { g_semantex_primitive_arg_valuekey_#2:nn }
+ {
+ \use:c { g_semantex_primitive_arg_valuekey_#2:nn }{ #3 }{ #1 }%
+ }
+ {
+ \msg_error:nnnn { semantex } { arg_valuekey_not_found } { #2 } { #3 }
+ }
+ }
+}
+
+
+\cs_new:Npn \g_semantex_arg_novaluekey:nn#1#2
+{
+ % #1 = name of the key
+ % #2 = object
+% % takes care of single keys, keys without a value
+% the class key is not actually necessary
+ \g_semantex_arg_novaluekey_get:nnNTF { #2 } { #1 } \l_semantex_custom_arg_novaluekey_temp
+ {
+ %\exp_args:NNno
+ %\exp_args:Nno
+ %\use:c { g_semantex_data_cs_#3_arg:n }
+ \g_semantex_arg_keys_set:nx { #2 }
+ {
+ \l_semantex_custom_arg_novaluekey_temp
+ }
+ }
+ {
+ \g_semantex_data_tl_inherit_x:nn { #2 } { arg }
+ \g_semantex_arg_keys_set:nn { #2 } { default={\exp_not:n { #1 } }}
+ %\g_semantex_arg_keys_set:nn { #3 } { default={#1}}
+ %IM THis \exp_not:n was added late, might be needed elsewhere, too.
+ }
+}
+
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { output }
+
+\g_semantex_data_tl_set:nnn { semantexvariable } { output } { semantexvariable }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { upper_index }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { uppersep }
+
+\g_semantex_data_tl_set:nnn { semantexvariable } { uppersep } { , }
+
+%IM Also, need commands like forgetupperindex, reverting to the class standard
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { lower_index }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { lowersep }
+
+\g_semantex_data_tl_set:nnn { semantexvariable } { lowersep } { , }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { preupper }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { postupper }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { prelower }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { postlower }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { upper_left_index }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { upperleftsep }
+
+\g_semantex_data_tl_set:nnn { semantexvariable } { upperleftsep } { , }
+
+%IM do the same with all the others, INCLUDING if_upper_grading and symbol
+%IM Also, need commands like forgetupperindex, reverting to the class standard
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { lower_left_index }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { lowerleftsep }
+
+\g_semantex_data_tl_set:nnn { semantexvariable } { lowerleftsep } { , }
+
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { preupperleft }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { postupperleft }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { prelowerleft }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { postlowerleft }
+
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { first_upper_left }
+\g_semantex_data_bool_set_true:nn { semantexvariable } { first_upper_left }
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { first_lower_left }
+\g_semantex_data_bool_set_true:nn { semantexvariable } { first_lower_left }
+
+
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { prearg }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { postarg }
+%IMplement these later
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { arg }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { argsep }
+\g_semantex_data_tl_set:nnn { semantexvariable } { argsep } {,}
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { slot }
+\g_semantex_data_tl_set:nnn { semantexvariable } { slot } { \semantexslot }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { argdots }
+\g_semantex_data_tl_set:nnn { semantexvariable } { argdots } {\dots}
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { symbol }
+
+\g_semantex_data_seq_provide:nn { semantexvariable } { commands_sequence }
+
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { upper_grading }
+\g_semantex_data_bool_set_true:nn { semantexvariable } { upper_grading }
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { output }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { output_options }
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { first_arg }
+\g_semantex_data_bool_set_true:nn { semantexvariable } { first_arg }
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { first_upper }
+\g_semantex_data_bool_set_true:nn { semantexvariable } { first_upper }
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { first_lower }
+\g_semantex_data_bool_set_true:nn { semantexvariable } { first_lower }
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { par }
+\g_semantex_data_bool_set_true:nn { semantexvariable } { par }
+
+\g_semantex_data_bool_provide:nn { semantexvariable } { rightreturnbeforerender }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { parseoptions }
+
+\g_semantex_data_tl_provide:nn { semantexvariable } { texclass }
+
+
+%\tl_set:Nn\g_objectmath_semantexvariable_upper_index { hej }
+%\tl_set:Nn \g_semantexvariable_output { semantexvariable }
+%\bool_new:N \g_semantexvariable_output_if_provided
+%\bool_set_true:N \g_semantexvariable_output_if_provided
+
+
+\newvariableclass{semantexvariable}[
+ %parent=semantexvariable,
+ symbol=,
+ gradingpos=upper,
+ %upper=,
+ %lower=,
+ leftpar=(,
+ rightpar=),
+ par=normal,
+ leftspar=(,
+ rightspar=),
+ sparsize=normal,
+ %arg=,
+ ifoutput=false,
+ output=semantexvariable,
+ novaluekeys={
+ {bullet}{d={\noexpand\semantexbullet}},
+ {doublebullet}{d={\noexpand\semantexdoublebullet}},
+ {prime}{upper={\prime}},
+ {'}{prime},
+ {''}{prime,prime},
+ {'''}{prime,prime,prime},
+ {ibullet}{i={\noexpand\semantexbullet}},
+ {idoublebullet}{i={\noexpand\semantexdoublebullet}},
+ {*}{bullet},
+ {**}{doublebullet},
+ {i*}{ibullet},
+ {i**}{idoublebullet},
+ {smash}{command=\noexpand\smash},
+% (widebar}{command=\noexpand\widebar},%For unknown reasons, this only seems to work when run as a primitive
+ {tilde}{command=\noexpand\tilde},
+ {widetilde}{command=\widetilde},
+ {overline}{command=\noexpand\overline},
+ {bar}{command=\noexpand\bar},
+ {bold}{command=\noexpand\mathbf},
+ {roman}{command=\noexpand\mathrm},
+ {mathord}{texclass=\mathord},
+ {mathbin}{texclass=\mathbin},
+ {mathop}{texclass=\mathop},
+ {mathrel}{texclass=\mathrel},
+ {leftreturn}{leftreturn=},
+ {innerreturn}{innerreturn=},
+ {rightreturn}{rightreturn=},
+ {return}{return=},
+ {spar}{spar=},
+ {parse}{parse=},
+ {par}{ifpar=true},
+ {nopar}{ifpar=false},
+ % The following four commands do not work due to expansion issues:
+% {useargwithkeyval}{useargwithkeyval=},
+% {argwithkeyval}{
+% valuekeys={
+% {arg}{argwithkeyval={\noexpand\l_semantex_key_value_temp}},
+% },
+% },
+% {argwithnovaluekeys}{
+% valuekeys={
+% {arg}{argwithnovaluekeys={\noexpand\l_semantex_key_value_temp}},
+% },
+% },
+% {argwithoutkeyval}{
+% valuekeys={
+% {arg}{argwithoutkeyval={\noexpand\l_semantex_key_value_temp}},
+% },
+% },
+% {argwithonenovaluekey}{
+% valuekeys={
+% {arg}{argwithonenovaluekey={\noexpand\l_semantex_key_value_temp}},
+% },
+% },
+ },
+ valuekeys={
+ {default}{si={#1}},
+% {arg}{argwithkeyval={#1}},
+ {arg}{argwithnovaluekeys={#1}},
+ {degreedefault}{sd={#1}},
+ {parseoptions}{
+ execute={
+ \semantexdataputright{parseoptions}{#1}
+ },
+ },
+ },
+% argwithnovaluekeys,
+ argvaluekeys={
+ {default}{standardsep={#1}},
+ },
+ argnovaluekeys={
+ {slot}{slot=},
+ {-}{slot=},
+ {*}{slot=},
+ {...}{dots=},
+ },
+ %command=,
+% useargwithkeyval,
+] \ No newline at end of file
diff --git a/macros/latex/contrib/semantex/semantex.tex b/macros/latex/contrib/semantex/semantex.tex
new file mode 100644
index 0000000000..da8cfd390b
--- /dev/null
+++ b/macros/latex/contrib/semantex/semantex.tex
@@ -0,0 +1,1882 @@
+\documentclass[a4paper,article,oneside,english,10pt]{memoir}
+
+\makeatletter
+
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{babel}
+\usepackage[noDcommand,slantedGreeks]{kpfonts}
+
+\frenchspacing
+
+\usepackage{mathtools,etoolbox, microtype,xspace}
+
+
+
+\usepackage[shortlabels]{enumitem}%control lists
+
+\usepackage[draft]{fixme}
+
+%Setup of memoir:
+\pagestyle{plain} %change to heading for running headings
+\nouppercaseheads %running heads should not be capitalized
+\captionnamefont{\small} %captions with small font
+\captiontitlefont{\small}
+\makeevenhead{headings}{\thepage}{}{\itshape\leftmark} %make headings italic instead of slanted (though we do not use headings right now)
+\makeoddhead{headings}{\itshape\rightmark}{}{\thepage}
+
+\raggedbottomsectiontrue%less harse than \raggedbottom
+%\allowdisplaybreaks %long equations may break
+
+\g@addto@macro\bfseries{\boldmath} %make math in bold text automatically bold
+
+\usepackage[english=american]{csquotes}
+
+\usepackage[hidelinks]{hyperref}
+
+\usepackage[nameinlink]{cleveref}
+
+\title{Seman\!\TeX: Object-oriented mathematics (v$0.1\alpha$)}
+\date{\today}
+\author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})}
+
+\hypersetup{
+ pdfauthor={Sebastian Ørsted},
+ pdftitle={SemanTeX: Object-oriented mathematics},
+ %pdfsubject={},
+ %pdfkeywords={},
+ %pdfproducer={Latex with hyperref, or other system},
+ %pdfcreator={pdflatex, or other tool},
+}
+
+
+
+
+% Settup up SemanTeX:
+
+\usepackage{semantex}
+
+\newvariableclass{var}[
+ output=var,
+]
+
+\newvar\va{a}
+\newvar\vb{b}
+\newvar\vc{c}
+\newvar\vd{d}
+\newvar\ve{e}
+\newvar\vf{f}
+\newvar\vg{g}
+\newvar\vh{h}
+\newvar\vi{i}
+\newvar\vj{j}
+\newvar\vk{k}
+\newvar\vl{l}
+\newvar\vm{m}
+\newvar\vn{n}
+\newvar\vo{o}
+\newvar\vp{p}
+\newvar\vq{q}
+\newvar\vr{r}
+\newvar\vs{s}
+\newvar\vt{t}
+\newvar\vu{u}
+\newvar\vv{v}
+\newvar\vw{w}
+\newvar\vx{x}
+\newvar\vy{y}
+\newvar\vz{z}
+
+\newvar\vA{A}
+\newvar\vB{B}
+\newvar\vC{C}
+\newvar\vD{D}
+\newvar\vE{E}
+\newvar\vF{F}
+\newvar\vG{G}
+\newvar\vH{H}
+\newvar\vI{I}
+\newvar\vJ{J}
+\newvar\vK{K}
+\newvar\vL{L}
+\newvar\vM{M}
+\newvar\vN{N}
+\newvar\vO{O}
+\newvar\vP{P}
+\newvar\vQ{Q}
+\newvar\vR{R}
+\newvar\vS{S}
+\newvar\vT{T}
+\newvar\vU{U}
+\newvar\vV{V}
+\newvar\vW{W}
+\newvar\vX{X}
+\newvar\vY{Y}
+\newvar\vZ{Z}
+
+\newvar\valpha{\alpha}
+\newvar\vvaralpha{\varalpha}
+\newvar\vbeta{\beta}
+\newvar\vgamma{\gamma}
+\newvar\vdelta{\delta}
+\newvar\vepsilon{\epsilon}
+\newvar\vvarepsilon{\varepsilon}
+\newvar\vzeta{\zeta}
+\newvar\veta{\eta}
+\newvar\vtheta{\theta}
+\newvar\viota{\iota}
+\newvar\vkappa{\kappa}
+\newvar\vlambda{\lambda}
+\newvar\vmu{\mu}
+\newvar\vnu{\nu}
+\newvar\vxi{\xi}
+\newvar\vpi{\pi}
+\newvar\vvarpi{\varpi}
+\newvar\vrho{\rho}
+\newvar\vsigma{\sigma}
+\newvar\vtau{\tau}
+\newvar\vupsilon{\upsilon}
+\newvar\vphi{\phi}
+\newvar\vvarphi{\varphi}
+\newvar\vchi{\chi}
+\newvar\vpsi{\psi}
+\newvar\vomega{\omega}
+
+\newvar\vGamma{\Gamma}
+\newvar\vDelta{\Delta}
+\newvar\vTheta{\Theta}
+\newvar\vLambda{\Lambda}
+\newvar\vXi{\Xi}
+\newvar\vPi{\Pi}
+\newvar\vSigma{\Sigma}
+\newvar\vUpsilon{\Upsilon}
+\newvar\vPhi{\Phi}
+\newvar\vPsi{\Psi}
+\newvar\vOmega{\Omega}
+
+\newvar\sheafF{\mathcal{F}}
+\newvar\sheafG{\mathcal{G}}
+\newvar\sheafO{\mathcal{O}}
+\newvar\sheafHom{\mathcal{H}\!\!om}
+
+\newvar\Hom{\operatorname{Hom}}
+
+\usepackage{showexpl,newunicodechar}
+
+\newunicodechar{⟨}{\textlangle}
+\newunicodechar{⟩}{\textrangle}
+
+
+\setupclass{var}{
+ novaluekeys={
+ {inverseimage}{upper={-1},nopar},
+ },
+}
+
+\newcohomologyclass{cohomology}[
+ parent=var,
+ valuekeys={
+ {arg}{argwithkeyval={#1}},
+ },
+ gradingpos=upper,
+]
+
+\newcohomologyclass{homology}[
+ parent=cohomology,
+ gradingpos=lower,
+]
+
+\newcohomology\co{H}
+
+\newhomology\ho{H}
+
+\makeatother
+
+\begin{document}
+
+\maketitle
+
+\lstset{%
+ language=[LaTeX]TeX,
+ basicstyle=\ttfamily\small,
+ commentstyle=\itshape\ttfamily\small,
+ extendedchars=true,
+ breaklines=true,
+ breakindent={0pt},
+ captionpos=t,
+ pos=r,
+ tabsize=2,
+ inputencoding=utf8,
+ extendedchars=true,
+ explpreset={numbers=none,},
+ literate={⟨}{\textlangle}1 {⟩}{\textrangle}1,
+}
+
+
+
+\newcommand*\mybs{$\backslash$}
+
+\newcommand*\commandname[1]{\mybs\texttt{#1}}
+
+\let\pack=\texttt
+
+\newcommand\semantex{Seman\!\TeX\xspace}
+
+\noindent
+The \semantex package for \LaTeX\ delivers a more semantic, systematized way of writing mathematics, compared to the ordinary math syntax. The system is object-oriented and uses keyval syntax, and everything is highly customizable. At the same time, care has been taken to make it intuitive, natural, practical, and with an easy-to-use and lightweight syntax.
+\textbf{Note: \semantex is still in its alpha stage and cannot be considered stable at this point. You are more than welcome to report bugs and come with suggestions!}
+
+\begingroup
+ \setupclass{var}{
+ novaluekeys={
+ {inverseimage}{upper={-1},nopar},
+ },
+ valuekeys={
+ {stalk}{lower=#1},
+ {res}{ return,symbolputright={|}, lower={#1} },
+ },
+ argvaluekeys={
+ {coef}{sep={;}{#1}},
+ },
+ }
+
+ Traditional math notation in \TeX\ is not particularly semantic -- you usually type the raw \emph{notation} rather than the underlying
+ \emph{meaning} of your math.
+ Take, for instance, the following equations from algebraic geometry:
+ \begin{align*}
+ \vf[inverseimage]{\sheafF}[spar,stalk=\vp]
+ &=
+ \sheafF[stalk=\vf{\vp}] ,
+ \\
+ \sheafO[\vU]
+ &=
+ \sheafO[\vX,res=\vU] ,
+ \\
+ \sheafHom{ \sheafF , \sheafG }{\vU}
+ &=
+ \Hom[\sheafO[\vU]]{ \sheafF[res=\vU] , \sheafG[res=\vU] } ,
+ \\
+ \co{0}{\vU,coef=\sheafO[\vX]} &= \sheafO[\vX]{\vU}
+ .
+ \end{align*}
+ Here, \( \sheafF \) and~\( \sheafG \)
+ are sheaves on some scheme~\( \vX \),
+ \( \sheafO[\vX] \)~is the structure sheaf,
+ and~\( \vU \subset \vX \) an open subset.
+ In traditional \TeX, you would probably define a collection of commands \lstinline!\sheafF!, \lstinline!\sheafG!, \lstinline!\sheafO!, and~\lstinline!\sheafHom! for~\( \sheafF \),~\( \sheafG \), \( \sheafO \), and~\( \sheafHom \) and then proceed
+ something like
+ \begin{lstlisting}
+(f^{-1}\sheafF)_{p}=\sheafF_{f(p)},
+\sheafO_{U} = \sheafO_{X}|_{U},
+\sheafHom( \sheafF , \sheafG)(U)
+ = \Hom_{\sheafO_{X} ( \sheafF|_{U} , \sheafG|_{V} ),
+ H^{0}(U;\sheafF) = \sheafF(U).
+ \end{lstlisting}
+ For more than~90~\% of all mathematicians, this solution will be completely satisfactory; it prints what it is supposed to, and that's that.
+ If this is how you feel, there is absolutely no reason for you to continue reading. This package is for the remaining less than~10~\% who would prefer to write
+ something like the following instead:
+ \begin{lstlisting}
+\vf[inverseimage]{ \sheafF }[spar,stalk=\vp]
+ = \sheafF[ stalk=\vf{\vp} ] ,
+\sheafO[\vU] = \sheafO[ \vX, res=\vU ],
+\sheafHom{ \sheafF , \sheafG }{\vU}
+ = \Hom[\sheafO[\vU]]{ \sheafF[res=\vU], \sheafG[res=\vU] },
+\co{0}{ \vU, coef=\sheafO[\vX] } = \sheafO[\vX]{\vU}.
+ \end{lstlisting}
+
+ A lot of comments are in order.
+ The whole syntax will be explained in later chapters, but let us take a moment to look at these examples and understand the logic.
+ First of all, what is up with all the~\lstinline!v!'s in the command names \lstinline!\vf!, \lstinline!\vX!, \lstinline!\vU!? The~\lstinline!v!~stands for \textquote{variable}, and it is the prefix I recommend using for all standard variables. So for all letters in the alphabet, uppercase and lowercase, as well as the Greek ones, there will be a command: \lstinline!\va!, \lstinline!\vA!, \lstinline!\vb!, \lstinline!\vB!,~etc.
+ It is not always necessary to use them; for instance, in the above example, both \lstinline!\vX! and \lstinline!\vU! could have been replaced by simply~\lstinline!X!,~\lstinline!U! without changing anything. This is because we did not apply any arguments to these symbols. However, for the sake of consistency, I prefer to switch completely to using commands instead of writing the symbols directly.
+ How \emph{you} use the system is completely up to you.
+
+ In \semantex, all entries are being built up from the inside and out.
+ The basic syntax layout for most \semantex commands is
+ \begin{lstlisting}
+\command[options]{argument}
+ \end{lstlisting}
+ Let us try focusing on the first example from above:
+ \begin{LTXexample}
+$\vf[inverseimage]{\sheafF}[spar,stalk=\vp]$
+ \end{LTXexample}
+ You always start with a central piece: a \emph{symbol}.
+ In the case of~\lstinline!\vf!, the symbol is~\( f \). After the symbol follows the options we apply to it, written in brackets~\lstinline![...]!. In this case, we the option~\lstinline!inverseimage!. This tells \semantex that we want the inverse image functor~\( \vf[inverseimage] \), so it adds a superscript~\lstinline!-1! to the symbol. After this, we apply the function~\lstinline!\vf[inverseimage]! to something, namely the sheaf~{$\sheafF$}. This is done by enclosing them in braces~\lstinline!{...}!.\footnote{You should be aware that this argument in braces~\texttt{\{...\}} is \emph{optional}. You can simply write~\texttt{$\backslash$vf[inverseimage]} if you want, and it will produce~\smash{\( \vf[inverseimage] \)}.}
+
+
+ Next, we want to take the stalk of this sheaf at the point~\( \vp \). If we simply wrote~\lstinline!\vf[inverseimage]{\sheafF}[stalk=\vp]!, we would get~\smash{\( \vf[inverseimage]{\sheafF}[stalk=\vp] \)}, which looks confusing. So we want to enclose~\smash{\( \vf[inverseimage]{\sheafF} \)} in parentheses before taking the stalk. This is done with the key~\lstinline!spar! (an abbreviation for \textquote{symbol parentheses}).
+ This key takes whatever has been typed so far, symbol and indices, and adds parentheses around it (of course, type and size is adjustable).
+ This~\lstinline!spar! is a key you fill find yourself using a lot.
+\endgroup
+
+\chapter{Getting started}
+
+To get started using \semantex, load down the package
+with
+\begin{lstlisting}
+\usepackage{semantex}
+\end{lstlisting}
+The \semantex system is object-oriented; all entities are objects of some class. When you load the package, there
+is only one class by default, which is simply called \lstinline!semantexvariable!.
+You should think of this as a low-level class, the parent of all other classes. Therefore, I highly advice against using it directly or modifying it.
+Instead, we create a new, more high-level variable class.
+To make notations brief, we call it \lstinline!var!.
+We could write \lstinline!\newvariableclass{var}!, but we choose to
+pass some options to it in~\lstinline![...]!:
+\begin{lstlisting}
+\newvariableclass{var}[output=var]
+\end{lstlisting}
+This \lstinline!output=var! option will be explained better below.
+Roughly speaking, it tells \semantex that everything
+a variable \emph{outputs} will also be a variable.
+For instance, if the function~\lstinline!\vf! (i.e.~\( \vf \)) is of class~\lstinline!var!,
+then \lstinline!\vf{\vx}!~(i.e.~\( \vf{\vx} \))~will also of class~\lstinline!var!.
+
+Now we have a class, but we do not have any objects.
+When we create the class~\lstinline!var!, the system
+automatically defines the command \lstinline!\newvar!
+that creates a new object of class~\lstinline!var!. The syntax is
+\begin{lstlisting}
+\newvar\⟨variable name⟩{⟨variable symbol⟩}[options]
+\end{lstlisting}
+For instance, we may write
+\begin{lstlisting}
+\newvar\vf{f}
+\newvar\vx{x}
+\end{lstlisting}
+to get two variables \lstinline!\vf! and~\lstinline!\vx! with symbols \( f \) resp.~\( x \).
+Let us perform a stupid test to see if the variables work:
+\begin{LTXexample}
+$\vf$, $\vx$
+\end{LTXexample}
+Th general syntax of a variable-type command is
+\begin{lstlisting}
+\command[options]{argument}
+\end{lstlisting}
+Both \lstinline!options! and \lstinline!argument! are optional
+arguments (they can be left out if you do not need them).
+The \lstinline!options! should consist of a list of options separated by commas, using keyval syntax. On the other hand, \lstinline!argument! is the actual argument of the function.
+By design, \semantex does not distinguish between variables and functions, so all variables can take arguments.
+This is a design choice to make the system easier to use; after all, it is fairly common in mathematics that something is first a variable and then a moment later takes an argument.
+So we may write:
+\begin{LTXexample}
+$\vf{1}$, $\vf{\vx}$
+\end{LTXexample}
+
+So far, we do not have very many options to write in the
+\lstinline!options! position, since we have not added any keys yet. However, we do have access
+to the most important of all options: the \emph{index}.
+There is a simple shortcut for writing an index: You simply write the index itself in the options tag:
+\begin{LTXexample}
+$\vf[1]$, $\vf[\vf]$,
+$\vf[1,2,\vf]{2}$
+\end{LTXexample}
+As long as what you write in the options tag is not recognized as a predefined key, it will be printed as the index.
+Other than that, there are two important predefined keys: \lstinline!upper! and \lstinline!lower! which simply add something to the upper and lower index:
+\begin{LTXexample}
+$\vf[upper=2]$,
+$\vf[lower=3]$
+\end{LTXexample}
+
+We are soon going to need more variables
+than just \( \vf \) and~\( \vx \).
+In fact, I advise you to create a variable for each letter in the Latin and Greek alphabets, both uppercase and lowercase.
+This is pretty time-consuming, so I did it for you already:
+\begin{lstlisting}
+\newvar\va{a}
+\newvar\vb{b}
+\newvar\vc{c}
+\newvar\vd{d}
+\newvar\ve{e}
+\newvar\vf{f}
+\newvar\vg{g}
+\newvar\vh{h}
+\newvar\vi{i}
+\newvar\vj{j}
+\newvar\vk{k}
+\newvar\vl{l}
+\newvar\vm{m}
+\newvar\vn{n}
+\newvar\vo{o}
+\newvar\vp{p}
+\newvar\vq{q}
+\newvar\vr{r}
+\newvar\vs{s}
+\newvar\vt{t}
+\newvar\vu{u}
+\newvar\vv{v}
+\newvar\vw{w}
+\newvar\vx{x}
+\newvar\vy{y}
+\newvar\vz{z}
+
+\newvar\vA{A}
+\newvar\vB{B}
+\newvar\vC{C}
+\newvar\vD{D}
+\newvar\vE{E}
+\newvar\vF{F}
+\newvar\vG{G}
+\newvar\vH{H}
+\newvar\vI{I}
+\newvar\vJ{J}
+\newvar\vK{K}
+\newvar\vL{L}
+\newvar\vM{M}
+\newvar\vN{N}
+\newvar\vO{O}
+\newvar\vP{P}
+\newvar\vQ{Q}
+\newvar\vR{R}
+\newvar\vS{S}
+\newvar\vT{T}
+\newvar\vU{U}
+\newvar\vV{V}
+\newvar\vW{W}
+\newvar\vX{X}
+\newvar\vY{Y}
+\newvar\vZ{Z}
+
+\newvar\valpha{\alpha}
+\newvar\vvaralpha{\varalpha}
+\newvar\vbeta{\beta}
+\newvar\vgamma{\gamma}
+\newvar\vdelta{\delta}
+\newvar\vepsilon{\epsilon}
+\newvar\vvarepsilon{\varepsilon}
+\newvar\vzeta{\zeta}
+\newvar\veta{\eta}
+\newvar\vtheta{\theta}
+\newvar\viota{\iota}
+\newvar\vkappa{\kappa}
+\newvar\vlambda{\lambda}
+\newvar\vmu{\mu}
+\newvar\vnu{\nu}
+\newvar\vxi{\xi}
+\newvar\vpi{\pi}
+\newvar\vvarpi{\varpi}
+\newvar\vrho{\rho}
+\newvar\vsigma{\sigma}
+\newvar\vtau{\tau}
+\newvar\vupsilon{\upsilon}
+\newvar\vphi{\phi}
+\newvar\vvarphi{\varphi}
+\newvar\vchi{\chi}
+\newvar\vpsi{\psi}
+\newvar\vomega{\omega}
+
+\newvar\vGamma{\Gamma}
+\newvar\vDelta{\Delta}
+\newvar\vTheta{\Theta}
+\newvar\vLambda{\Lambda}
+\newvar\vXi{\Xi}
+\newvar\vPi{\Pi}
+\newvar\vSigma{\Sigma}
+\newvar\vUpsilon{\Upsilon}
+\newvar\vPhi{\Phi}
+\newvar\vPsi{\Psi}
+\newvar\vOmega{\Omega}
+\end{lstlisting}
+
+Just like~\lstinline!\vf!, these can all be regarded as functions, so~\lstinline!\va{\vb}!~produces~\( \va{\vb} \).
+Importantly,
+\textbf{parentheses can be scaled}.
+To make parentheses bigger, use the following keys:
+\begin{LTXexample}
+$\vf{\vx}$,
+$\vf[par=\big]{\vx}$,
+$\vf[par=\Big]{\vx}$,
+$\vf[par=\bigg]{\vx}$,
+$\vf[par=\Bigg]{\vx}$,
+$\vf[par=auto]{\frac{1}{2}}$
+\end{LTXexample}
+Using \lstinline!par=auto! corresponds to using \lstinline!\left...\right!. Just as for ordinary math, I advice you to use manual scaling rather than automatic scaling, as \TeX\ has a tendency to scale things wrong. If you do not want parentheses at all, you can pass the key~\lstinline!nopar!:
+\begin{LTXexample}
+$\vf[nopar]{\vx}$
+\end{LTXexample}
+Primes are added via the key~\lstinline!prime!
+or the keys~\lstinline!'!,~\lstinline!''! and~\lstinline!'''!:
+\begin{LTXexample}
+$\vf['] = \vf[prime]$,
+$\vf[''] = \vf[prime,prime]$
+$\vf['''] = \vf[prime,prime,prime]$
+\end{LTXexample}
+
+So far, so good, but our variables cannot really do anything yet. For this, we need to assign \emph{keys} to them. The more pieces of math notation you need, the more keys you will have to define.
+Keys are being added via two different keys:
+\begin{center}
+ \lstinline!novaluekeys!
+ \qquad\qquad and \qquad\qquad
+ \lstinline!valuekeys!.
+\end{center}
+In short, \lstinline!novaluekeys! is for keys that do \emph{not} take a value (i.e.~keys using the syntax~\lstinline!\command[key]!), and \lstinline!valuekeys! is for keys that \emph{do} take a value
+(i.e.~keys using the syntax~\lstinline!\command[key=value]!)).
+We explain the syntax for using them in the next section where we show how to make keyval syntax for elementary calculus.
+
+\chapter{Example: Elementary calculus}
+
+One thing we might want to do to a variable
+is \emph{invert} it. We therefore add a key~\lstinline!inv!
+that adds an upper index~\lstinline!-1! to the symbol.
+We add this key using the key \lstinline!novaluekeys!:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {inv}{ upper={-1} },
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+novaluekeys={
+ {inv}{ upper={-1} },
+},
+}
+Now the key \lstinline!inv!
+has been defined to be equivalent to \lstinline!upper={-1}!.
+Now we can do the following:
+\begin{LTXexample}
+$\va[inv]$, $\vf[inv]$,
+$\vg[1,2,inv]$,
+$\vh[\va,\vb,inv]$
+\end{LTXexample}
+The key \lstinline!novaluekeys! is for keys that take no value,
+like \lstinline!inv!.
+
+Other keys might need to take a value.
+For defining such, we have the command~\lstinline!valuekeys!.
+%There are two different keys for adding new keys
+%to a class: \lstinline!novaluekeys! and \lstinline!valuekeys!.
+%The difference is that
+For instance, suppose we want a command for deriving a function \( n \)~times.
+For this, we add the following extra keyval key~\lstinline!der!:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {inv}{ upper={-1} },
+ },
+ valuekeys={
+ {der}{ upper={(#1)} },
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+valuekeys={
+ {der}{ upper={(#1)} },
+},
+}
+The~\lstinline!#1! will contain whatever the
+user added as the value of the key.
+Now we can write:
+\begin{LTXexample}
+$\vf[der=\vn]{\vx}$
+\end{LTXexample}
+Maybe we also want a more elementary operation:
+raising a variable to some \emph{power}.
+We could have called the key \lstinline!power!, but this is long and cumbersome, so let us simply call it \lstinline!to!:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {inv}{ upper={-1} },
+ },
+ valuekeys={
+ {der}{ upper={(#1)} },
+ {to}{ upper={#1} },
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ valuekeys={
+ {to}{ upper={#1} },
+ },
+}
+This allows us to write
+\begin{LTXexample}
+$\vx[to=2]$,
+$\vy[1,to=2] + \vy[2,to=2]$
+\end{LTXexample}
+In the long run, you might want to define a command~\lstinline!squared! or~\lstinline!sq! and make it equivalent to~\lstinline!to=2!.
+
+Let us try doing something a bit more complicated: Adding a key for restricting a function to a smaller subset.
+For this, we do the following:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {inv}{ upper={-1} },
+ },
+ valuekeys={
+ {der}{ upper={(#1)} },
+ {to}{ upper={#1} },
+ {res}{ return,symbolputright={|}, lower={#1} },
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ valuekeys={
+ {res}{ return,symbolputright={|}, lower={#1} },
+ },
+}
+This adds a horizonal line~\enquote{$|$}
+to the right of the symbol followed by
+a lower index containing whatever you passed to the key
+(contained in the \mbox{command~\lstinline!#1!)}.
+(There is also an extra key, \lstinline!return!, which is a bit more advanced and should be taken for granted for now. Roughly speaking, it is there to make sure that the restriction symbol is printed \emph{after} all indices that you might have added before. More details in \cref{ch:return}.)
+Now we may write the following:
+\begin{LTXexample}
+$\vf[res=\vU]{\vx}$,
+$\vg[1,res=\vY]{\vy}$,
+$\vh[inv,res=\vT]{\vz}$
+\end{LTXexample}
+
+If the reader starts playing around with the \semantex functions, they will discover that whenever you apply a function to something, the result becomes a new function that can take an argument itself. This behaviour is both useful and extremely necessary in order for the package to be useful in practice. For instance, you may write
+\begin{LTXexample}
+$\vf[der=\vn]{\vx}{\vy}{\vz}
+=\vg{\vu,\vv,\vw}[3]{
+ \vx[1],\vx[2]}[8,1,der=2]{\vt}$
+\end{LTXexample}
+Some people prefer to be able to scale the restriction
+line. I rarely do that, but for that purpose, we could do the following:
+\begin{lstlisting}
+\setupclass{var}{
+ valuekeys={
+ {bigres}{ return, symbolputright=\big\vert, lower={#1} },
+ {Bigres}{ return, symbolputright=\Big\vert, lower={#1} },
+ {biggres}{ return, symbolputright=\bigg\vert, lower={#1} },
+ {Biggres}{ return, symbolputright=\Bigg\vert, lower={#1} },
+ {autores}{ return, sparsize=auto, otherspar=.\vert,
+ sparsize=normal, lower={#1} },
+ % This auto scales the vertical bar. See the chapter on the spar
+ % key for information about sparsize and otherspar
+ },
+}
+\end{lstlisting}
+
+So to sum up, we first defined a class~\lstinline!var!
+via \lstinline!\newvariableclass! and then used \lstinline!\setupclass! to add keys to it. In fact, we could have done it all at once by passing these options directly to \lstinline!\newvariableclass!:
+\begin{lstlisting}
+ \newvariableclass{var}[
+ output=var,
+ novaluekeys={
+ {inv}{ upper={-1} },
+ },
+ valuekeys={
+ {der}{ upper={(#1)} },
+ {to}{ upper={#1} },
+ {res}{ rightreturn, symbolputright={|},
+ lower={#1} },
+ },
+ ]
+\end{lstlisting}
+As we proceed in this guide, we shall use \lstinline!\setupclass!
+to add more and more keys to~\lstinline!var!. However, when you set up your own system, you may as well just add all of the keys like this when you create the class and then be done with it.
+
+Let me add that it is possible to create subclasses of existing classes. You just write \lstinline!parent=myclass! in the class declaration to tell that \lstinline!myclass! is the parent class. \textbf{But a word of warning:} It is a natural idea to create different classes for different mathematical entities, each with their own keyval syntax that fits whatever class you are in; for instance, you could have one class for algebraic structures like rings and modules with keys for opposite rings and algebraic closure, and you could have another class for topological spaces with keys for closure and interior. However, as the reader can probably imagine, this becomes extremely cumbersome to work with in practice since an algebraic structure might very well also carry a topology. So at the end of the day, I advice you to use a single superclass \lstinline!var! that has all the keyval syntax and only use subclasses for further \emph{customization}. We shall see examples of this below.
+\chapter{Example: Elementary algebra}
+
+\setupclass{var}{
+ novaluekeys={
+ {pol}{
+ par, % This tells semantex to use parentheses around
+ % the argument in the first place, in case this
+ % had been turned off
+ leftpar=[,rightpar=],
+ },
+ },
+}
+
+Let us try to use the \semantex system to build some commands
+for doing algebra.
+As an algebraist, one of the first things you might want to do is to create polynomial rings~\( \vk[pol]{\vx,\vy,\vz} \). Since all variables can already be used as functions (this is a design choice we discussed earlier), all we need to do is find a way to change from using parentheses to square brackets. This can be done the following way:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {pol}{
+ par, % This tells semantex to use parentheses around
+ % the argument in the first place, in case this
+ % had been turned off
+ leftpar=[,rightpar=],
+ },
+ },
+}
+\end{lstlisting}
+Now we may write
+\begin{LTXexample}
+ $\vk[pol]{\vx,\vy,\vz}$
+\end{LTXexample}
+It is straightforward how to do adjust this to instead write the \emph{field} generated by the variables~\( x, y, z \):
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {pol}{
+ par, % This tells semantex to use parentheses around
+ % the argument in the first place, in case this
+ % had been turned off
+ leftpar=[,rightpar=],
+ },
+ {field}{
+ par,
+ leftpar=(,rightpar=),
+ },
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {field}{
+ par,
+ leftpar=(,rightpar=),
+ },
+ },
+}
+Now \lstinline!\vk[field]{\vx,\vy,\vz}! produces~\( \vk[field]{\vx,\vy,\vz} \). Of course, leaving out the \lstinline!field!
+key would produce the same result with the current configuration of~\lstinline!var!. However, it is still best to use a key for this, both because this makes the semantics more clear, but also because you might later change some settings that would cause the default behaviour to be different.
+
+Adding support for free algebras and fields is almost as easy, but there is a catch:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {pol}{
+ par, % This tells semantex to use parentheses around
+ % the argument in the first place, in case this
+ % had been turned off
+ leftpar=[,rightpar=],
+ },
+ {field}{
+ par,
+ leftpar=(,rightpar=),
+ },
+ {freealg}{
+ par,
+ leftpar=\noexpand\langle,
+ rightpar=\noexpand\rangle,
+ },
+ {powerseries}{
+ par,
+ leftpar=\noexpand\llbracket,
+ rightpar=\noexpand\rrbracket,
+ },
+ {laurent}{
+ par,
+ leftpar=(, rightpar=),
+ prearg={\!\!\noexpand\semantexdelimsize(},
+ postarg={\noexpand\semantexdelimsize)\!\!},
+ % These are printed before and after the argument.
+ % The command "\semantexdelimsize" is substituted
+ % by \big, \Big, ..., or whatever size the
+ % argument delimiters have
+ },
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {freealg}{
+ par,
+ leftpar=\noexpand\langle,
+ rightpar=\noexpand\rangle,
+ },
+ {powerseries}{
+ par,
+ leftpar=\noexpand\llbracket,
+ rightpar=\noexpand\rrbracket,
+ },
+ {laurent}{
+ par,
+ leftpar=(, rightpar=),
+ prearg={\!\!\noexpand\semantexdelimsize(},
+ postarg={\noexpand\semantexdelimsize)\!\!},
+ % These are printed before and after the argument.
+ % The command "\semantexdelimsize" is substituted
+ % by \big, \Big, ..., or whatever size the
+ % argument delimiters have
+ },
+ },
+}
+For expansion reasons (which I am not completely sure of),
+we need \lstinline!\noexpand! before these commands.
+In general, whenever something fails, try throwing in \lstinline!\noexpand!'s in front of suspicious-looking commands,
+and things will usually work out just fine. See for yourself:
+\begin{LTXexample}
+$\vk[freealg]{\vx}$,
+$\vk[powerseries]{\vy}$,
+$\vk[laurent]{\vz}$
+\end{LTXexample}
+
+
+Let us look at some other algebraic operations that we can control via \semantex:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {op}{upper={\noexpand\mathrm{op}}},
+ % opposite groups, rings, categories, etc.
+ {algclosure}{overline},
+ % algebraic closure
+ {conj}{overline},
+ % complex conjugation
+ {dual}{upper=*},
+ % dual vector space
+ {perp}{upper=\perp},
+ % orthogonal complement
+ },
+ valuekeys={
+ {mod}{symbolputright={/#1}},
+ % for modulo notation like R/I
+ {dom}{symbolputleft={#1\backslash}},
+ % for left modulo notation like I\R
+ % "dom" is "mod" spelled backwards
+ {oplus}{upper={\oplus#1}},
+ % for notation like R^{\oplus n}
+ {tens}{upper={\otimes#1}},
+ % for notation like R^{\otimes n}
+ {localize}{symbolputright={ \relax [#1^{-1}] }},
+ % localization at a multiplicative subset;
+ % the \relax is necessary becauese, in some cases,
+ % the [...] can be interpreted as an optional argument
+ {localizeprime}{lower={#1}},
+ % for localization at a prime ideal
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {op}{upper={\noexpand\mathrm{op}}},
+ % opposite groups, rings, categories, etc.
+ {algclosure}{overline},
+ % algebraic closure
+ {conj}{overline},
+ % complex conjugation
+ {dual}{upper=*},
+ % dual vector space
+ {perp}{upper=\perp},
+ % orthogonal complement
+ },
+ valuekeys={
+ {mod}{symbolputright={/#1}},
+ % for modulo notation like R/I
+ {dom}{symbolputleft={#1\backslash}},
+ % for left modulo notation like I\R
+ % "dom" is "mod" spelled backwards
+ {oplus}{upper={\oplus#1}},
+ % for notatoin like R^{\oplus n}
+ {tens}{upper={\otimes#1}},
+ % for notation like R^{\otimes n}
+ {localize}{symbolputright={ [#1^{-1}] }},
+ % localization at a multiplicative subset
+ {localizeprime}{lower={#1}},
+ % for localization at a prime ideal
+ },
+}
+Let us see it in practice:
+\begin{LTXexample}
+$\vR[op]$, $\vk[algclosure]$,
+$\vz[conj]$, $\vV[dual]$,
+$\vR[mod=\vI]$,$\vR[dom=\vJ]$,
+$\vR[oplus=\vn]$,
+$\vV[tens=\vm]$,
+$\vR[localize=\vS]$,
+$\vR[localizeprime=\vI]$,
+$\vk[freealg]{\vS}[op]$,
+$\vV[perp]$
+\end{LTXexample}
+
+\chapter{The \texttt{spar} key}
+
+The \lstinline!spar! key is one of the most important commands in \semantex at all. To understand why we need it, imagine you want to derive a function \( \vn \)~times and then invert it. Writing something like
+\begin{LTXexample}
+$\vf[der=\vn,inv]$
+\end{LTXexample}
+does not yield a satisfactory result. However, the \lstinline!spar! key saves the day:
+\begin{LTXexample}
+$\vf[der=\vn,spar,inv]$
+\end{LTXexample}
+So \lstinline!spar! simply adds a pair of parentheses around the current symbol, complete with all indices that you may have added to it so for. The name \lstinline!spar! stands for \enquote{symbol parentheses}. You can add as many as you like:
+\begin{LTXexample}
+$ \vf[1,res=\vV,spar,conj,op,spar,0,inv,spar,mod=\vI,spar,dual]{\vx} $
+\end{LTXexample}
+If it becomes too messy, you can scale the parentheses, too. Simply use the syntax
+\lstinline!spar=\big!, \lstinline!spar=\Big!, etc.
+You can also get auto-scaled parentheses base on \lstinline!\left...\right!,
+using the key \lstinline!spar=auto!:
+\begin{LTXexample}
+$\vf[spar]$,
+$\vf[spar=\big]$,
+$\vf[spar=\Big]$,
+$\vf[spar=\bigg]$,
+$\vf[spar=\Bigg]$,
+$\vf[spar=auto]$
+\end{LTXexample}
+So returning to the above example, we can write
+\begin{LTXexample}
+$\vf[1,res=\vV,spar,conj,op,spar=\big,0,inv,spar=\Big,mod=\vI,spar=\bigg,dual]{\vx}$
+\end{LTXexample}
+To adjust the type of parentheses, use the \lstinline!leftspar! and \lstinline!rightspar! keys:
+\begin{LTXexample}
+$\vf[leftspar={[},rightspar={\}},spar,spar=\Bigg]$
+\end{LTXexample}
+Occassionally, it is useful to be able to input a particular kind of parentheses just once,
+without adjusting any settings. For this purpose, we have the (previously mentioned)
+\lstinline!otherspar!~key. It uses the syntax~\lstinline!otherspar={opening parenthesis}{closing parenthesis}!:
+\begin{LTXexample}
+$\vf[otherspar={[}{)},otherspar={\{}{\rangle},
+ spar]$
+\end{LTXexample}
+
+
+\chapter{The \texttt{command} key}
+
+Above, we used the key \lstinline!overline! a couple of times:
+\begin{LTXexample}
+$\va[overline]$,
+$\vH[overline]$
+\end{LTXexample}
+This command applies the command \lstinline!\overline!
+to the symbol. In fact, you can create similar commands yourself via
+the \lstinline!command! key.
+In fact, you could have defined the \lstinline!overline! yourself as follows:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {overline}{command=\noexpand\overline},
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {overline}{command=\noexpand\overline},
+ },
+}
+This is how the key \lstinline!overline! is defined internally, except it is defined on the level of the superclass \lstinline!automathvariable! instead. We need the key \lstinline!\noexpand! in order for everything to expand properly. This is only necessary for some commands, and to tell the truth, I haven't quite figured out the system of which commands need it and which ones do not. However, as usual, if something does not work, try throwing in some \lstinline!\noexpand!'s and see if it solves the problem.
+Here are some more examples of predefined keys that use the command key:
+\begin{lstlisting}
+\setupclass{var}{ % do not add these -- they are already predefined!
+ novalueskeys={
+ {smash}{command=\noexpand\smash},
+ {tilde}{command=\noexpand\tilde},
+ {widetilde}{command=\widetilde},
+ {bar}{command=\noexpand\bar},
+ {bold}{command=\noexpand\mathbf},
+ {roman}{command=\noexpand\mathrm},
+ },
+}
+\end{lstlisting}
+Let us test:
+\begin{LTXexample}
+$\va[widetilde]$,
+$\va[bold]$,
+$\va[roman]$,
+$\va[bar]$
+\end{LTXexample}
+
+\chapter{The \texttt{return} keys}\label{ch:return}
+
+Suppose you want to take the complex conjugate of the variable~\( \vz[1] \). Then you might write something like
+\begin{LTXexample}
+$\vz[1,conj]$
+\end{LTXexample}
+Notice that the bar has only been added over the~\( \vz \), as is standard mathematical typography; you do not normally write~\( \vz[1,return,conj] \).
+This reveals a design choice that has been made in \semantex:
+When you add an index or a command via the \lstinline{command} key,
+it is not immediately applied to the symbol.
+Rather, both commands and indices are added to a register and are then applied at the very last, right before the symbol is printed.
+This allows us to respect standard mathematical typography, as shown above.
+
+However, there are other times when this behaviour is not what you want.
+For instance, if you want to comjugate the inverse of a function, the following looks wrong:
+\begin{LTXexample}
+$\vf[inv,conj]$
+\end{LTXexample}
+Therefore, there is a command \lstinline!return! that can be applied at any point to invoke the routine of adding all indices and commands to the symbol. Let us try it out:
+\begin{LTXexample}
+$\vf[inv,return,conj]$
+\end{LTXexample}
+In fact, \lstinline!return! is an umbrella key that invokes three different return routines: \lstinline!leftreturn!, \lstinline!innerreturn!, and \lstinline!rightreturn!. The command \lstinline!leftreturn! adds the left indices to the symbol (we have not discussed left indices yet, though). The command \lstinline!innerreturn! adds all commands to the symbol (those defined using the \lstinline!command!~key).
+Finally, \lstinline!rightreturn! adds all right indices and arguments to the symbol.
+In general, the user should probably be satisfied with just using \lstinline!return!.
+
+\chapter{Example: Algebraic geometry}
+
+Let us discuss how to typeset sheaves and operations on morphisms in algebraic geometry.
+First of all, adding commands for sheaves is not a big deal:
+\begin{lstlisting}
+\newvar\sheafF{\mathcal{F}}
+\newvar\sheafG}{\mathcal{G}}
+\newvar\sheafH{\mathcal{H}}
+\newvar\sheafO{\mathcal{O}}
+\newvar\sheafHom{\mathcal{H}\!\!om}
+\end{lstlisting}
+You can of course add as many sheaf commands as you need.
+Also, to make notations shorter, you could consider
+calling the commands~\lstinline!\shF!, \lstinline!\shG!, \lstinline!\shH!, \lstinline!\shO!, and~\lstinline!\shHom! instead, as I usually do.
+You may also want to have a separate command~\lstinline!shreg!
+for the sheaf~\( \sheafO \)
+of regular functions.
+
+Next, for morphisms of schemes~\( \vf \colon \vX \to \vY \),
+we need to be able to typeset comorphisms as well as the one hundred thousand different pullback and pushforward operations. For this, we add some keys to the \lstinline!var! key:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {comor}{upper=\#},
+ % comorphisms, i.e. f^{\#}
+ {inverseimage}{upper={-1},nopar},
+ % inverse image of sheaves
+ {shpull}{upper=*,nopar},
+ % sheaf *-pullback
+ {shpush}{lower=*,nopar},
+ % sheaf *-pushforward
+ {sh!pull}{upper=!,nopar},
+ % sheaf !-pullback
+ {sh!push}{lower=!,nopar},
+ % sheaf !-pushforward
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {comor}{upper=\#},
+ % comorphisms, i.e. f^{\#}
+ {inverseimage}{upper={-1},nopar},
+ % inverse image of sheaves
+ {shpull}{upper=*,nopar},
+ % sheaf *-pullback
+ {shpush}{lower=*,nopar},
+ % sheaf *-pushforward
+ {sh!pull}{upper=!,nopar},
+ % sheaf !-pullback
+ {sh!push}{lower=!,nopar},
+ % sheaf !-pushforward
+ },
+}
+We have added the command \lstinline!nopar! to all pullback and pushforward commands since it is custom to write, say,~\( \vf[shpull]{\sheafF} \) rather than~\( \vf[shpull,par]{\sheafF} \). Of course, you can decide that for yourself, and in any case, you can write~\lstinline!\vf[shpull,par]{\shF}! if you want to force it to use parentheses in a particular case. Of course, since all \semantex variables can be used as functions, so can whatever these pullback and pushforward operations output. So we may write:
+\begin{LTXexample}
+For a morphism~$ \vf \colon
+\vX \to \vY $ with
+comorphism~$ \vf[comor]
+\colon \sheafO[\vY] \to
+\vf[shpush]{\sheafO[\vX]} $,
+and for a sheaf~$ \sheafF $ on~$ \vY $, we can define the
+pullback~$ \vf[shpull]{
+\sheafF} $ by letting~$
+\vf[shpull]{ \sheafF}{\vU} = \cdots $ and the $ ! $-pullback by letting~$
+\vf[sh!pull]{\sheafF}{\vU} = \cdots $.
+\end{LTXexample}
+Maybe some people would write \lstinline!pull!, \lstinline!push!, etc.~instead, but there are other things in math called pullbacks, so I prefer to use the \lstinline!sh!~prefix to show that this is for sheaves.
+Probably, in the long run, an algebraic geometer might also want
+to abbreviate~\lstinline!inverseimage! to~\lstinline!invim!.
+
+There are a number of other operations we might want to do for sheaves. We already defined the key~\lstinline!res! for restriction, so there is no need to define this again.
+However, we might need to stalk, sheafify, take dual sheaves, and twist sheaves. Let us define keys for this:
+\begin{lstlisting}
+\setupclass{var}{
+ valuekeys={
+ {stalk}{clower={#1}},
+ {twist}{return,symbolputright={(#1)}},
+ },
+ novaluekeys={
+ {sheafify}{upper=+},
+ {shdual}{upper=\vee},
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ valuekeys={
+ {stalk}{clower={#1}},
+ {twist}{return,symbolputright={(#1)}},
+ },
+ novaluekeys={
+ {sheafify}{upper=+},
+ {shdual}{upper=\vee},
+ },
+}
+The key \lstinline!clower! stands for \enquote{comma-lower}.
+It is like \lstinline!lower!, except that it checks whether the index
+is already non-empty, and if so, it separates the new index from the previous index by a comma. There is, of course, a \lstinline!cupper!~key that does the same with the upper index.
+\begin{LTXexample}
+$\sheafF[res=\vU,stalk=\vp]$,
+$\sheafF[res=\vU,spar,stalk=
+\vp]$,
+$\sheafO[\vX,stalk=\vp]$,
+$\sheafG[sheafify]$,
+$\vf[inverseimage]{\sheafO[
+\vY]}[spar,stalk=\vx]$
+$\sheafG[shdual]$,
+$\sheafO[\vX][twist=-1]$,
+$\sheafO[twist=1,shdual]$
+\end{LTXexample}
+
+\chapter{Example: Homological algebra}
+
+Before you venture into homological algebra, you should probably
+define some keys for the standard constructions:
+
+\begin{lstlisting}
+\newvar\Hom{\operatorname{Hom}}
+\newvar\Ext{\operatorname{Ext}}
+\newvar\Tor{\operatorname{Tor}}
+\end{lstlisting}
+\newvar\Ext{\operatorname{Ext}}
+\newvar\Tor{\operatorname{Tor}}
+Now the ability to easily print indices via the options key will come in handy:
+\begin{LTXexample}
+$\Hom[\vA]{\vM,\vN}$,
+$\Ext[\vA]{\vM,\vN}$
+\end{LTXexample}
+\setupclass{var}{
+valuekeys={
+ {shift}{ return,symbolputright={ \relax [ {#1} ] } },
+ % \relax is necessary since otherwise [...] can
+ % occasionally be interpreted as an optional argument
+ },
+}
+You will probably need several keyval interfaces, some of which will be covered below. But right now, we shall implement a shift operation~\( \vX\mapsto\vX[shift=\vn] \):
+\begin{lstlisting}
+\setupclass{var}{
+ valuekeys={
+ {shift}{ return,symbolputright={ \relax [ {#1} ] } },
+ % \relax is necessary since otherwise [...] can
+ % occasionally be interpreted as an optional argument
+ },
+}
+\end{lstlisting}
+Let us see that it works:
+\begin{LTXexample}
+$\vX\mapsto\vX[shift=\vn]$
+\end{LTXexample}
+
+\section{The keys \texttt{i = index} and \texttt{d = deg = degree}}
+
+Homological algebra is a place where people
+have very different opinions about the positions of the gradings.
+As an algebraist, I am used to \emph{upper} gradings (\enquote{cohomological} grading), whereas many topologists prefer \emph{lower} gradings (\enquote{homological} grading). The \semantex system
+supports both, but the default is upper gradings (the package author has the privilege to decide).
+You can adjust this by writing
+\lstinline!gradingpos=upper! or~\lstinline!gradingpos=lower!.
+
+
+We already learned about the keys \lstinline!upper! and~\lstinline!lower!.
+There are two more, \enquote{relative} keys that print the index either as an upper index or as a lower index, depending on your preference for cohomological or homological grading. They are called
+\begin{center}
+ \lstinline!index!
+ \qquad\qquad and\qquad\qquad
+ \lstinline!degree!
+\end{center}
+The \lstinline!degree! is the actual grading in the homological algebra
+sense. The \lstinline!index! is an additional index where you can put extra information that you might need.
+To understand the difference, keep the following two examples
+in mind: the hom complex~\( \Hom[*,index=\vA] \) and the simplicial homology~\( \ho[*,index=\vDelta] \) (we will define the command~\lstinline!\ho! for homology in the next section):
+\begin{LTXexample}
+$\Hom[index=\vA,degree=0]$,
+$\ho[index=\vDelta,degree=1]$
+\end{LTXexample}
+These names are not perfect; many people would say that the degree is also
+an index, but feel free to come up with a more satisfactory naming principle, and I shall be happy to consider it. These names probably become a bit too heave to write in the long run, so both keys have abbreviated equivalents:
+\begin{center}
+ \lstinline!i! = \lstinline!index!
+ \qquad\qquad and\qquad\qquad
+ \lstinline!d! = \lstinline!deg! = \lstinline{degree}
+\end{center}
+Let us see them in action:
+\begingroup\begin{LTXexample}
+$ \vX[d=3,i=\vk] $
+
+\setupobject\vX{
+ gradingpos=lower
+}
+
+$ \vX[d=3,i=\vk] $
+\end{LTXexample}\endgroup
+\noindent (We haven't seen the command \lstinline!\setupobject! before, but I imagine you can guess what it does).
+If you want to print a bullet as the degree, there is the predefined key~\lstinline!*! for this:
+\begingroup\begin{LTXexample}
+$ \vX[*] $
+
+\setupobject\vX{
+ gradingpos=lower
+}
+
+$ \vX[*] $
+\end{LTXexample}\endgroup
+
+I guess it is also time to reveal that the previously mentioned shorthand notation~\lstinline!\vx[1]! for indices always prints the~\lstinline!1! on the \lstinline{index} position. So changing the grading position changes the position of the index:
+\begingroup\begin{LTXexample}
+$ \vX[1] $
+
+\setupobject\vX{
+ gradingpos=lower
+}
+
+$ \vX[1] $
+\end{LTXexample}\endgroup
+In other words, in the first example above, we could have written
+\begin{LTXexample}
+$\Hom[\vA,d=0]$,
+$\ho[\vDelta,d=1]$
+\end{LTXexample}
+
+
+Note that the use of the short notations \lstinline!d! and~\lstinline!i! does not mean you cannot write e.g. \lstinline!\vx[d]! and~\lstinline!\vx[i]!.
+In fact, this is not the case:
+\begin{LTXexample}
+$\vf[i]$, $\vf[i=]$,
+$\vf[d]$, $\vf[d=]$
+\end{LTXexample}
+As we see, it is only when a \lstinline!d! or~\lstinline!i! key is followed by an equality sign~\lstinline!=!
+that the routines of these keys are invoked.
+In fact, \semantex carefully separates
+\lstinline!valuekeys! from \lstinline!novaluekeys!.
+
+\section{The \texttt{cohomology} class type}
+
+Now homological algebra is hard unless we can do \emph{cohomology} and \emph{homology}. In principle, this is not hard
+to do, as we can write e.g.~\lstinline!\vH[d=0]{\vX}! to get~\( \vH[d=0]{\vX} \).
+However, some people might find it cumbersome to have to write~\lstinline!d=! every time you want to print an index.
+This is probably the right time to reveal that \semantex supports multiple class \emph{types}.
+So far, we have been exclusively using the \lstinline!variable!
+class type, but there are several others.
+The first one we shall need is the \lstinline!cohomology! class type, which has a different input syntax that fits cohomology.
+Let us try to use it:
+\begin{lstlisting}
+\newcohomologyclass{cohomology}[parent=var,gradingpos=upper]
+
+\newcohomology\co{H}
+
+\newcohomologyclass{homology}[parent=cohomology,gradingpos=lower]
+
+\newhomology\ho{H}
+\end{lstlisting}
+The cohomology command~\lstinline!\co! in general works very much
+like a command of variable type. However, the input syntax is a bit different:
+\begin{lstlisting}
+\co[options]{degree}{argument}
+\end{lstlisting}
+All three arguments are optional. Let us see it in practice:
+\begin{LTXexample}
+$\co{0}$, $\co{*}$,
+$\co{\vi}{\vX}$,
+$\co[\vG]{0}$,
+$\co[\vH]{*}$,
+$\co[\vDelta]{\vi}{\vX}$
+\end{LTXexample}
+
+\begin{LTXexample}
+$\ho{0}$, $\ho{*}$,
+$\ho{\vi}{\vX}$,
+$\ho[\vG]{0}$,
+$\ho[\vH]{*}$,
+$\ho[\vDelta]{\vi}{\vX}$
+\end{LTXexample}
+Of course, you can define similar commands for cocycles, coboundaries, and all sorts of other entities that show up in homological algebra.
+
+You might also want to implement feature like reduced cohomology, \v{C}ech cohomology,
+and hypercohomology. This is quite easy with the \lstinline!command! key:
+\begin{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {reduced}{command=\widetilde},
+ {cech}{command=\noexpand\check},
+ {hyper{command=\noexpand\mathbb},
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ novaluekeys={
+ {reduced}{command=\widetilde},
+ {cech}{command=\noexpand\check},
+ {hyper}{command=\noexpand\mathbb},
+ },
+}
+
+\begin{LTXexample}
+$\co[reduced]{i}$,
+$\co[cech]{*}$,
+$\co[hyper,cech]{0}{\vX}$
+\end{LTXexample}
+
+The cohomology class also provides a nice way
+to implement derived functors:
+\begin{lstlisting}
+\newcohomology\Lder{\mathbb{L}}[nopar]
+\newcohomology\Rder{\mathbb{R}}[nopar]
+\end{lstlisting}
+\newcohomology\Lder{\mathbb{L}}[nopar]
+\newcohomology\Rder{\mathbb{R}}[nopar]
+For instance, we can write
+\begin{LTXexample}
+$\Lder{\vi}{\vf}$,
+$\Rder{0}{\vf}$
+\end{LTXexample}
+
+Alternatively, the user might prefer to use keyval syntax
+on the level of the function itself (\( \vf \)~in this case).
+This can be done the following way:
+\begin{lstlisting}
+\setupclass{var}{
+ valuekeys={
+ {Lder} {
+ innerreturn,leftreturn,
+ symbolputleft=\noexpand\mathbb{L}^{#1},
+ },
+ {Rder} {
+ innerreturn,leftreturn,
+ symbolputleft=\noexpand\mathbb{R}^{#1},
+ },
+ },
+ novaluekeys={
+ {Lder} {
+ innerreturn,leftreturn,
+ symbolputleft=\noexpand\mathbb{L},
+ },
+ {Rder} {
+ innerreturn,leftreturn,
+ symbolputleft=\noexpand\mathbb{R},
+ },
+ },
+}
+\end{lstlisting}
+\setupclass{var}{
+ valuekeys={
+ {Lder} {
+ innerreturn,leftreturn,
+ symbolputleft=\noexpand\mathbb{L}^{#1},
+ },
+ {Rder} {
+ innerreturn,leftreturn,
+ symbolputleft=\noexpand\mathbb{R}^{#1},
+ },
+ },
+ novaluekeys={
+ {Lder} {
+ innerreturn,leftreturn,
+ symbolputleft=\noexpand\mathbb{L},
+ },
+ {Rder} {
+ innerreturn,leftreturn,
+ symbolputleft=\noexpand\mathbb{R},
+ },
+ },
+}
+Then the syntax becomes:
+\begin{LTXexample}
+$\vF[Lder=\vi]$,
+$\vF[Lder]{\vX[*]}$,
+$\vF[Rder]{\vX[*]}$,
+$\Hom[Rder]{\vX,\vY}$
+\end{LTXexample}
+If you get tired of having to write \lstinline!\Hom[Rder]! all
+the time, you can create a shortcut:
+\begin{lstlisting}
+\newvar\RHom[copy=\Hom,Rder]
+\end{lstlisting}
+\newvar\RHom[copy=\Hom,Rder]
+The \lstinline!copy! key is like the \lstinline!parent! key,
+except it allows you to inherit the settings from an \emph{object} rather than a \emph{class}. Notice that we did not specify a symbol; the symbol argument is optional, and in this case, it was unnecessary, as the symbol was inherited from~\lstinline!\Hom!. Let us see it in action:
+\begin{LTXexample}
+$\RHom{\vX,\vY}$
+\end{LTXexample}
+
+\section{Keyval syntax in arguments (Example: Cohomology with coefficients)}
+
+\setupclass{var}{
+ argvaluekeys={
+ {coef}{ sep={;}{#1} },
+ },
+}
+
+Imagine we want to do cohomology with coefficients in some ring~\( \vR \).
+It is common to write this as~\( \co{*}{\vX,coef=\vR} \)
+with a semicolon instead of a comma. This can be implemented, too, with the syntax
+\begin{LTXexample}
+$\co{*}{\vX,coef=\vR}$
+\end{LTXexample}
+This shows that arguments of functions also support keyval syntax.
+In order to customize this, there are two extra keys:
+\begin{center}
+\lstinline!argnovaluekeys!
+\qquad\qquad\text{and}\qquad\qquad
+\lstinline!argvaluekeys!
+\end{center}
+These work exactly like \lstinline!novaluekeys! and~\lstinline!valuekeys!.
+\begin{lstlisting}
+\setupclass{var}{
+ argvaluekeys={
+ {coef}{ sep={;}{#1} },
+ },
+}
+\end{lstlisting}
+(But it will not quite work yet -- stay tuned for a moment!)
+The key \lstinline!sep! is a key that controls the separator
+between the current argument and the previous argument (it will only be printed if there was a previous argument). By default, this separator is a comma. So in the syntax~\lstinline!\co{*}{\vX,coef=\vR}!,
+there are two arguments, \lstinline!\vX! and~\lstinline!\vR!, and the separator is a semicolon.
+
+However, even with the above setup, the notation \lstinline!\co{*}{\vX,coef=\vR}! will not work
+just yet. For the keys you define using \lstinline!argvaluekeys!
+are turned off by default. To turn them on for the object~\lstinline!\co!, run the following code:
+\begin{lstlisting}
+\setupobject\co{
+ valuekeys={
+ {arg}{argwithkeyval={#1}},
+ },
+}
+\end{lstlisting}
+The reason the keys are turned off by default is that keys in arguments that support values are only used in very rare cases, like cohomology with coefficients. If such keys were turned on in general, it would mess up
+every occurrence of an equality sign in arguments, and the following
+would not work:
+\begin{LTXexample}
+$\Hom[\sheafO[\vU]]{
+ \sheafF[res=\vU],
+ \sheafG[res=\vU]
+}$
+\end{LTXexample}
+
+It should be noted that there are several predefined
+keys (of type \mbox{\lstinline!novaluekey!)} which are defined on the level
+of the class \lstinline!semantexvariable!. The full list is:\fxfatal{Finish this}
+
+\begin{itemize}
+ \item slot, \ldots
+\end{itemize}
+
+We should also talk about the \lstinline!arg! key.
+
+\section{The \texttt{binary} class type (Example: Derived tensor products and fibre products)}
+
+\newbinaryclass{binaryoperator}[
+ novaluekeys={
+ {Lder}{upper=L},
+ {Rder}{upper=R},
+ },
+ mathbin, % this makes sure that the output is wrapped in \mathbin
+]
+
+\newbinaryoperator\tens{\otimes}[
+ novaluekeys={
+ {der}{Lder},
+ },
+]
+
+\newbinaryoperator\fibre{\times}[
+ % Americans are free to call it \fiber instead
+ novaluekeys={
+ {der}{Rder},
+ },
+]
+
+The \semantex system has facilities for printing tensor products~\( \tens \) as well as derived tensor products~\( \tens[der] \).
+For this, we need the \lstinline!binary! class type.
+This has exactly the same syntax as the \lstinline!variable!
+class type, except that it cannot take an argument. In other words,
+its syntax is
+\begin{lstlisting}
+\command[options]
+\end{lstlisting}
+Let us try to use it to define tensor products and fibre products:
+\begin{lstlisting}
+\newbinaryclass{binaryoperator}[
+ novaluekeys={
+ {Lder}{upper=L},
+ {Rder}{upper=R},
+ },
+ mathbin,
+ % this makes sure that the output is wrapped in \mathbin
+]
+
+\newbinaryoperator\tens{\otimes}[
+ novaluekeys={
+ {der}{Lder},
+ },
+]
+
+\newbinaryoperator\fibre{\times}[
+ % Americans are free to call it \fiber instead
+ novaluekeys={
+ {der}{Rder},
+ },
+]
+\end{lstlisting}
+As you see, this is one of the few cases where I recommend adding keyval
+syntax on the level of subclasses. Also, notice that it does not have any~\lstinline!parent=var!, as I do not really see any reason to inherit all the keyval syntax from the \lstinline!var!~class.
+Now we first define keys \lstinline!Lder! and~\lstinline!Rder! for left and right derived binary operators. Next, we build in a shortcut in both \lstinline!\tens! and~\lstinline!\fibre!
+so that we can write simply~\lstinline!der! and get the correct notion of derived functor. Let us see it in action:
+\begin{LTXexample}
+$\vA \tens \vB$,
+$\vX[*] \tens[\vR] \vY[*]$
+$\vk \tens[\vA,der] \vk$,
+$\vX \fibre[\vY,der] \vX$
+\end{LTXexample}
+
+\chapter{The \texorpdfstring{\texttt{$\backslash$⟨classname⟩}}{classname} command}
+
+So far, we have learned that every mathematical entity should be treated
+as an object of some class. However, then we run into issues the moment we
+want to write expressions like
+\[
+ \var{\vf\circ\vg}[spar,der=\vn]{\vx}.
+\]
+We do not want to have to define a new variable
+with symbol~\( \vf\circ\vg \) in order to write something like this.
+Fortunately, once you have created the class~\lstinline!var!,
+you get an extra command~\lstinline!\var! that has the following syntax
+\begin{lstlisting}
+\var{symbol}[options]{argument}
+\end{lstlisting}
+In other words, it allows you to create a variable on the spot and give in an arbitrary symbol. So the above equation can be written
+\begin{LTXexample}
+$\var{\vf\circ\vg}[
+ spar,der=\vn]{\vx}$
+\end{LTXexample}
+More generally, whenever you create a class with name \lstinline!⟨classname⟩!, you automatically get a command
+named~\lstinline!\⟨classname⟩!.
+It has the same input syntax as the class in question,
+except that, as above, the first argument is the symbol:
+\begin{lstlisting}
+\⟨classname⟩{symbol}⟨usual syntax of class⟩
+\end{lstlisting}
+
+Actually, now might be the right time to reveal that the low-level machinery in \semantex does not actually see the difference between an object and a class. Yep, this is how it has been implemented, and there are probably some object-oriented purists who will say that this goes against some general programming philosophy nonsense. So when you create the class \lstinline!⟨classname⟩!, you really create the above object which has a special syntax. And now all other objects of that class simply inherit from this object. (As we saw from above, you can actually inherit from any object; you just write~\lstinline!copy=\objectname! instead of using \lstinline!parent!.)
+
+\chapter{Class types}
+
+The \semantex system uses several different \emph{class types}.
+We have been almost exclusively using the \lstinline!variable! class type (which is by far the most important one), but in the last section, we were introduced to the \lstinline!cohomology! and the \lstinline!binary! class types.
+
+In fact, all class types are identical internally; the low-level machinery of \semantex does not \enquote{know} what type a class has.
+The only difference between the class types is the \emph{input syntax}.
+In other words, it determines which arguments an object of that class
+can take. The syntax for creating new objects
+also varies.
+
+The current implementation has the following
+class types:
+
+\begin{itemize}
+ \item \lstinline!variable!:
+ A new class is declared with the
+ syntax
+ \begin{lstlisting}
+ \newvariableclass{⟨classname⟩}[options]
+ \end{lstlisting}
+ A new object is declared by
+ \begin{lstlisting}
+ \new⟨classname⟩\⟨objectname⟩{symbol}[options]
+ \end{lstlisting}
+ The syntax for this object is
+ \begin{lstlisting}
+ \⟨objectname⟩[options]{argument}
+ \end{lstlisting}
+ \item \lstinline!cohomology!:
+ A new class is declared with the
+ syntax
+ \begin{lstlisting}
+ \newcohomologyclassclass{⟨classname⟩}[options]
+ \end{lstlisting}
+ A new object is declared by
+ \begin{lstlisting}
+ \new⟨classname⟩\⟨objectname⟩{symbol}[options]
+ \end{lstlisting}
+ The syntax for this object is
+ \begin{lstlisting}
+ \⟨objectname⟩[options]{degree}{argument}
+ \end{lstlisting}
+ \item \lstinline!binary!:
+ A new class is declared with the
+ syntax
+ \begin{lstlisting}
+ \newdelimiterclass{⟨classname⟩}[options]
+ \end{lstlisting}
+ A new object is declared by
+ \begin{lstlisting}
+ \new⟨classname⟩\⟨objectname⟩{left bracket}{right bracket}[options]
+ \end{lstlisting}
+ The syntax for this object is
+ \begin{lstlisting}
+ \⟨objectname⟩[options]{argument}
+ \end{lstlisting}
+ \item \lstinline!delimiter!:
+ A new class is declared with the syntax
+ \begin{lstlisting}
+ \newtupleclass{⟨classname⟩}[options]
+ \end{lstlisting}
+ A new object is declared by
+ \begin{lstlisting}
+ \new⟨classname⟩\⟨objectname⟩{left bracket}{right bracket}[options]
+ \end{lstlisting}
+ The syntax for this object is
+ \begin{lstlisting}
+ \⟨objectname⟩[options]{argument}
+ \end{lstlisting}
+\end{itemize}
+
+Let me add that \semantex uses a very clear separation between the input syntax and the underlying machinery. Because of this, if the user needs a different kind of class type, it is not very hard to create one. You must simply open the source code of \semantex, find the class you want to modify, and then copy the definition of the command~\lstinline!\new⟨class type⟩class! and modify it in whatever way you want.
+
+\chapter{The \texorpdfstring{\texttt{delimiter}}{delimiter} class type}
+
+\newdelimiterclass{delim}[parent=var]
+\newdelim\norm{\lVert}{\rVert}
+\newdelim\inner{\langle}{\rangle}
+
+Delimiters are what they sound like: functions like \( \norm{slot} \) and~\( \inner{slot,slot} \)
+that are defined using brackets only. Let us define a class of type delimiter:
+\begin{lstlisting}
+\newdelimiterclass{delim}[parent=var]
+\end{lstlisting}
+Now we get a command \lstinline!\newdelim! with the following syntax:
+\begin{lstlisting}
+\newdelim\⟨objectname⟩{left bracket}{right bracket}[options]
+\end{lstlisting}
+Now we can do the following:
+\begin{lstlisting}
+\newdelim\norm{\lVert}{\rVert}
+\newdelim\inner{\langle}{\rangle}
+\end{lstlisting}
+Indeed:
+\begin{LTXexample}
+$\norm{\va}$,
+$\inner{\va,\vb}$,
+$\inner{slot,slot}$
+\end{LTXexample}
+We can also use it for more complicated constructions, like sets.
+\begin{lstlisting}
+\newcommand\where{
+ \nonscript\:
+ \semantexdelimsize\vert
+ \allowbreak
+ \nonscript\:
+ \mathopen{}
+}
+
+\newdelim\Set{\lbrace}{\rbrace}[
+ prearg={\,},postarg={\,},
+ % adds \, inside {...}, as recommended by D. Knuth
+ valuekeys={
+ {arg}{argwithoutkeyval={#1}},
+ % this turns off all keyval syntax in the argument
+ }
+]
+\end{lstlisting}
+\newcommand\where{
+ \nonscript\:
+ \semantexdelimsize\vert
+ \allowbreak
+ \nonscript\:
+ \mathopen{}
+}
+
+\newdelim\Set{\lbrace}{\rbrace}[
+ prearg={\,},postarg={\,},
+ % adds \, inside {...}, as recommended by D. Knuth
+ valuekeys={
+ {arg}{argwithoutkeyval={#1}},
+ % this turns off all keyval syntax in the argument
+ }
+]
+Now you can use
+\begin{LTXexample}
+$\Set{ \vx \in \vY \where
+\vx \ge 0 }$
+\end{LTXexample}
+Don't forget that anything created with \semantex
+outputs as a variable-type object. So you can do stuff like
+\begin{LTXexample}
+$\Set{
+ \vx \in \vY[\vi]
+ \where
+ \vx \ge 0
+}[conj,\vi\in\vI]$
+\end{LTXexample}
+
+
+Tuple-like commands are also possible:
+\begin{lstlisting}
+\newdelim\tup{(}{)} % tuples
+\newdelim\pcoor{[}{]}[ % projective coordinates
+ argsep=\mathpunct{:}, % changes the argument separator to :
+ argdots=\cdots, % changes what is inserted if you write "..."
+]
+\end{lstlisting}
+\newdelim\tup{(}{)} % tuples
+\newdelim\pcoor{[}{]}[ % projective coordinates
+ argsep=\mathpunct{:}, % changes the argument separator to :
+ argdots=\cdots, % changes what is inserted if you write "..."
+]
+Let us see them in action:
+\begin{LTXexample}
+$\tup{\va,\vb,...,\vz}$,
+$\pcoor{\va,\vb,...,\vz}$
+\end{LTXexample}
+
+One can also use tuples for other, less obvious purposes, like calculus differentials:
+\begin{lstlisting}
+\newdelimiterclass{calculusdifferential}[
+ parent=var,
+ argvaluekeys={
+ {default}{standardsep={d\!#1}},
+ },
+ argdots=\cdots,
+ ifpar=false,
+]
+
+\newcalculusdifferential\intD{(}{)}[argsep={\,},iffirstarg=false]
+
+\newcalculusdifferential\wedgeD{(}{)}[argsep=\wedge]
+\end{lstlisting}
+\newdelimiterclass{calculusdifferential}[
+ parent=var,
+ argvaluekeys={
+ {default}{standardsep={d\!#1}},
+ },
+ argdots=\cdots,
+ ifpar=false,
+]
+
+\newcalculusdifferential\intD{(}{)}[argsep={\,},iffirstarg=false]
+
+\newcalculusdifferential\wedgeD{(}{)}[argsep=\wedge]
+
+\begin{LTXexample}
+$\int \vf \intD{\vx[1],\vx[2],...,\vx[n]}$,
+
+$\int \vf \wedgeD{\vx[1],\vx[2],...,\vx[n]}$
+\end{LTXexample}
+
+\chapter{The \texttt{execute} and \texttt{parseoptions} keys}
+
+As you can see above, \semantex has a ``waterfall-like'' behaviour. It parses keys in the order it receives them. This works fine most of the time, but for some more complicated constructions, it is useful to be able to provide a data set in any order and have them printed in a fixed order. For this purpose, we have the \lstinline!execute! and \lstinline!parseoptions!~keys.
+
+\newvar\Mat{\operatorname{Mat}}[
+ execute={
+ \semantexdataprovide{rows}
+ \semantexdataprovide{columns}
+ },
+ valuekeys={
+ {rows}{
+ execute={
+ \semantexdataset{rows}{#1}
+ },
+ },
+ {columns}{
+ execute={
+ \semantexdataset{columns}{#1}
+ },
+ },
+ },
+ parseoptions={
+ execute={
+ \semantexstrifeq{\semantexdatagetexpnot{columns}}{\semantexdatagetexpnot{rows}}
+ {
+ \semantexsetkeysx{
+ lower={
+ \semantexdatagetexpnot{columns}
+ }
+ }
+ }
+ {
+ \semantexsetkeysx{
+ lower={
+ \semantexdatagetexpnot{rows}
+ \times
+ \semantexdatagetexpnot{columns}
+ }
+ }
+ }
+ },
+ },
+]
+
+Suppose we want to be able to write the set of \( \vn \times \vm \)-matrices with entries in~\( \vk \) as~\( \Mat[rows=\vn,columns=\vm]{\vk} \). We can in principle do the following:
+\begin{LTXexample}
+$ \Mat[\vn\times\vm]{\vk} $.
+\end{LTXexample}
+However, this is not quite as systematic and semantic as we might have wanted. Indeed, what if later you would like to change the notation to~\( \Mat[\vn,\vm]{\vk} \)?
+Therefore, we do something like the following instead (we explain the notation below):
+\begin{lstlisting}
+\newvar\Mat{\operatorname{Mat}}[
+ execute={
+ \semantexdataprovide{rows}
+ \semantexdataprovide{columns}
+ % provides data sets for number of rows and columns
+ % for this object
+ },
+ valuekeys={
+ {rows}{
+ execute={
+ \semantexdataset{rows}{#1}
+ },
+ },
+ {columns}{
+ execute={
+ \semantexdataset{columns}{#1}
+ },
+ },
+ },
+ parseoptions={
+ execute={
+ \semantexstrifeq{\semantexdatagetexpnot{columns}}
+ {\semantexdatagetexpnot{rows}}
+ % tests if rows = columns
+ {
+ \semantexsetkeysx{
+ lower={
+ \semantexdatagetexpnot{columns}
+ }
+ }
+ }
+ {
+ \semantexsetkeysx{
+ lower={
+ \semantexdatagetexpnot{rows}
+ \times
+ \semantexdatagetexpnot{colums}
+ }
+ }
+ }
+ },
+ },
+]
+\end{lstlisting}
+Now we can do the following:
+\begin{LTXexample}
+$ \Mat[rows=\vn,columns=\vm]{\vk} $, $ \Mat[rows=\vn,columns=\vn]{\vk} $
+\end{LTXexample}
+
+The key~\lstinline!execute! is a key that basically just executes code. You can in principle write any \TeX\ code there, and it will be applied right at the spot. However, inside the \lstinline!execute!~key, you can also use the following locally defined commands. These can be used to handle the data that is associated with the object in question:
+\begin{lstlisting}
+\semantexdataprovide{name} % provides a data set with this name
+\semantexdataset{name}{value} % sets the data set
+\semantexdatasetx{name}{value} % sets the data set, but fully expands the argument
+\semantexdataputright{name}{value} % adds something to the right of the data set
+\semantexdataputrightx{name}{value} % the same, but fully expands first
+\semantexdataputleft{name}{value} % adds something to the left of the data set
+\semantexdataputleftx{name}{value} % the same, but fully expands first
+\semantexdataget{name}{value} % outputs the data set
+\semantexdatagetexpnot{name}{value} % outputs the data set wrapped in a \noexpand
+\semantexdataclear{name} % clears the data set
+\semantexsetkeys{keys} % sets keys
+\semantexsetkeysx{keys} % sets keys after expanding
+\semantexstrifeq{str1}{str2}{if true}{if false} % tests if str1 = str2
+\semantexboolprovide{name} % provides a boolean
+\semantexboolsettrue{name} % sets the boolean to true
+\semantexboolsetfalse{name} % sets the boolean to false
+\semantexboolif{name}{if true}{if false} % tests the boolean
+\end{lstlisting}
+
+The key~\lstinline!parseoptions! is a key that is executed right before rendering the object. This is where you write whatever the system is supposed to \emph{do} with the data sets you provide.
+
+\chapter{Bugs}
+
+The most important current (known) bug happens if you create a variable whose symbol is a mathematical operator. For instance, write
+\begin{lstlisting}
+\newvar\Int{\int}
+\end{lstlisting}
+\newvar\Int{\int}
+
+\begin{LTXexample}
+$\int$ \\
+$\Int$ \\
+See the difference: \rlap{$\int$}$\Int$
+\end{LTXexample}
+It turns out to be equivalent to the difference between
+\lstinline!$\int$! and~\lstinline!${}\int$!. In other words, this~\lstinline!{}!
+affects the spacing a tiny bit.
+I more or less know where this bug appears, but cannot really solve it without breaking the expansion somewhere else. Suggestions and advice are more than welcome! Then again, even if it affects the spacing a little bit, it still looks fine, only a bit different.
+
+%\input{testground}
+
+\end{document} \ No newline at end of file