Define new shorthand


The "shorthand" pragma is used to define a custom shorthand symbol and its compiled long form.


The syntax for the shorthand pragma consists of:

  • An exclamation point !
  • The keyword shorthand
  • A symbol attribute, specifying a single character which will be used as the new shorthand identifier.
  • A name attribute, specifying the name that will be emitted in place of the shorthand symbol when the document is compiled.
!shorthand *symbol=character *name=string
Syntax for defining a new shorthand symbol


Here is what the shorthand pragma looks in a manuscript.

!shorthand *symbol=@ *name=tabindex
!shorthand *symbol=& *name=name
!shorthand *symbol=P *name=placeholder
!shorthand *symbol=Φ *name=value

form {
input @1 &firstname P'Given' Φ'Amelia'
input @2 &lastname P'Family' Φ'Earhart'
Using the shorthand pragma

And here is its compiled output:

<input tabindex=1 name=firstname placeholder='Given' value='Amelia'/>
<input tabindex=2 name=lastname placeholder='Family' value='Earhart'/>
Equivalent compiled output

syntax > pragmas > shorthandDefine new shorthand

🔗 🔎