• No results found

stricttex – strictly balanced brackets and numbers in command names (v0.2β)

N/A
N/A
Protected

Academic year: 2021

Share "stricttex – strictly balanced brackets and numbers in command names (v0.2β)"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

stricttex

– strictly balanced brackets and numbers

in command names (v0.2β)

Sebastian Ørsted (sorsted@gmail.com)

September 8, 2020

The stricttex package is a small, LuaLATEX-only package providing you with

three, sometimes useful features:

• It allows you to make brackets[...]“strict”, meaning that each[must

be balanced by a].

• It allows you to use numbers in command names, so that you can do stuff like\newcommand\pi12{\pi_{12}}.

• It allows you to use numbersand primes in command names, so that you

can do stuff like\newcommand\pi’12{\pi ’_{12}}.

Making brackets strict

The package provides the commands

\StrictBracketsOn \StrictBracketsOff

Between these two commands, all left brackets[are replaced by[{, and all

right brackets]by}]. This forces the brackets to be properly balanced. This is extremely useful in come packages, such as SemanTEX, where you can then do things that would otherwise cause errors, e.g.

\StrictBracketsOn

$ \vf [ upper = \vx [ upper = 2,lower =3 ]] $ \StrictBracketsOff

Normal brackets can still be accessed by using the standard TEX commands

\lbrackand\rbrack. The replacement algorithm has two important exceptions:

No replacements apply to the commands\[...\], which can therefore

be used as normal.

• If you absolute need ordinary brackets, you can write<[> and<]>to

access them. This works in all contexts, so e.g.\<[>and\<]>will work

just like\[and\].

(2)

Allowing numbers (and possibly primes) in commands

The package provides the commands

\NumbersInCommandsOn \NumbersInCommandsOff

\NumbersAndPrimesInCommandsOn \NumbersAndPrimesInCommandsOff

The first pair of commands allows you to define commands containing numbers. So the following will work:

\NumbersInCommandsOn \newcommand\pi12 { \pi _{ 12 }} \newcommand\pi13 { \pi _{ 13 }} \newcommand\pi23 { \pi _{ 23 }} \newcommand\pi12comma34 { \pi _{ 12,34 }} \NumbersInCommandsOff

Internally, what happens is that if a command is immediately followed by a number, that numbers is replaced by a text string, i.e. 0 gets replaced

bynumberZERO,1gets replaced bynumberONE, etc. These long names have been

chosen to prevent name clashes. In other words, the code that is eventually passed to TEX is \newcommand\pinumberONEnumberTWO { \pi _{ 12 }} \newcommand\pinumberONEnumberTHREE { \pi _{ 13 }} \newcommand\pinumberTWOnumberTHREE { \pi _{ 23 }} \newcommand\pinumberONEnumberTWOcommanumberTHREEnumberFOUR { \pi _{ 12,34 }}

Needless to say, stuff like\kern11ptwill no longer work and will have to be

replaced by\kern 11pt.

The commands\NumbersAndPrimesInCommandsOnand\...Offwork almost

the same way, except they also allow you to useprimes. So the following will

work:

\NumbersAndPrimesInCommandsOn \newcommand\pi’12 { \pi ’ _{ 12 }} \NumbersAndPrimesInCommandsOff

Internally, the algorithm works as before, except the prime’gets replaced by symbolPRIME. So what is eventually passed to TEX is

\newcommand\pisymbolPRIMEnumberONEnumberTWO { \pi ’ _{ 12 }}

Referenties

GERELATEERDE DOCUMENTEN

Daarentegen wordt in culturen die een lage waarde hebben voor de cultuurdimensie tijd en daarbij op de toekomst zijn georiënteerd meer moderne doelstellingen geformuleerd, dan

Daarentegen wordt in culturen waarbij een hoge mate van collectivisme heerst meer doelstellingen geformuleerd die in het belang zijn van de stakeholders, dan in culturen met een

• The option interline-all changes the default value of interline used by the current com- mand \Cascade and all the possible nested commands \Cascade..

The sloped square brackets usually found on italic fonts are, if anything, even less useful than sloped parentheses.. If, perish the thought, there were a book or film entitled The

(2) In stmaryrd.sty, the commands \binampersand and \bindnasrepma are defined as delimiters, but their names clearly imply that they are intended to be binary operations (and

9 But it should be mentioned that the archive from the vaulted building gives specific information on the location of the royal granaries, from which we learn that not all

The complex of names represented by the antler or stag includes the probably Luwian Kuruntiya or Runtiya, as opposed to the clearly Hittite Innara.34 Here the Hittite name,

We therefore conclude that, when measuring BTP, replacing the ZTPI future scale by the BTPS future scale is a first step when aiming at strengthening the role that mindfulness plays