Skip to content
beala edited this page Sep 9, 2012 · 1 revision

LaMark supports two different types of tags: binary and unary. Binary tags have an opening tag and a closing tag (similar to div in HTML). Unary tags only have an opening tag (similar to br in HTML).

Binary:

{% TAG_NAME %} [TEXT] {% end %}

Unary:

{% TAG_NAME %}

The opening tag of both unary and binary tags have the same syntax:

{% TAG_NAME [ARG1 [ARG2 [...]]]] [ARG1_NAME="ARG1_VAL" [ARG2_NAME="ARG2_VAL" [...]]] %}

Where each argument is separated by a space, positional arguments come before keyword arguments, and the value of a keyword argument must be wrapped in double quotes. Most sane whitespacing is allowed. For example, the following is valid:

{% math
            "http://media.usrsb.in/"
            "Some LaTeX"
            imgZoom="2500"
%}
a^2
{%end%}

At this time, tags cannot contain %}, and keyword values cannot contain ".

LaMark tags can be escaped with a backslash. Consider the following LaMark:

\{%math%}
a^2
\{%end%}

This will be rendered as:

{%math%}
a^2
{%end%}

Backslashes are only escape characters if they come before a LaMark tag. In all other cases, they carry no special meaning and will be left alone by the LaMark processor.

Nesting of tags is allowed. Nested tags are evaluated from the inner-most tag outward. So, first the inner-most tag is evaluated, and the result is returned/embedded in the tag it's nested in. The evaluation continues up the chain.

Clone this wiki locally