A LATEX mark-up for Z specifications is defined here by its conversion to a sequence of Z (UCS) characters. Cadiz performs this conversion to Z characters, which it then lexes. Only the core Z notation is considered here; the LATEX mark-up of symbols defined in the toolkit is documented elsewhere.
Spaces, tabs and newlines are soft space: they separate tokens of the mark-up, without generating any space characters to be lexed. Braces are also soft space, affecting the interpretation of neighbouring mark-up (unless escaped with \).
The following mark-up is converted to spaces to be lexed.
LATEX command | Rendering | Z character |
~ | interword space | SPACE |
\, | thin space | SPACE |
\: | medium space | SPACE |
\; | thick space | SPACE |
\(space) | interword space | SPACE |
\\ | newline | NLCHAR |
\t1 | tab stop 1 | SPACE |
\t2 | tab stop 2 | SPACE |
\t3 | tab stop 3 | SPACE |
\t4 | tab stop 4 | SPACE |
\t5 | tab stop 5 | SPACE |
\t6 | tab stop 6 | SPACE |
\t7 | tab stop 7 | SPACE |
\t8 | tab stop 8 | SPACE |
\t9 | tab stop 9 | SPACE |
\also | small vertical space | NLCHAR |
\znewpage | new page | NLCHAR |
A % character in the mark-up introduces a comment: all text from that % to the end of the line, and any following spaces and tabs at the beginning of the next line, are ignored.
Each LATEXcommand needs to have a mark-up directive
to define its conversion to a sequence of Z characters.
These mark-up directives are usually written immediately before
the definition of the corresponding Z symbol.
For example, those for toolkit symbols are in toolkit sections,
and those for the core notation are in the prelude section.
Hence you have to write mark-up directives only for
new symbols that you define in your sections of your Z specification.
The conversions defined by these mark-up directives should be consistent with
the rendering produced by the LATEX typesetting tool.
It is your responsibility to ensure that the rendering by LATEX is
consistent with the conversion by CADi, as required by the Z standard.
The conversion of a LATEXcommand to a specific UCS character is defined by a mark-up directive like the following.
%%Zchar \Delta U+0394 %%Zchar \arithmos U-0001D538
If the LATEXcommand is to be used as an operator, spaces will be needed in its conversion according to its fixity.
%%Zinchar \rel U+2194 %%Zprechar \finset U-0001D53D %%Zpostchar \rangle U+3009
If a LATEXcommand is to be converted to more than one character, a directive like the following is used.
%%Zinword \partition partition %%Zpreword \dom dom %%Zpostword \star ^*
In the following sections, mark-up directives are given to define the conversions of all the LATEXcommands for the core notation. Any core notation for which no LATEXcommand is defined is ASCII and is marked-up as itself.
The Greek letters of the core Z language are converted according to the following mark-up directives.
Z character | LATEX mark-up |
![]() | %%Zchar \Delta U+0394 |
![]() | %%Zchar \Xi U+039E |
![]() | %%Zchar \theta U+03B8 |
![]() | %%Zchar \lambda U+03BB |
![]() | %%Zchar \mu U+03BC |
Other letters of the core Z language are converted according to the following mark-up directives.
Z character | LATEX mark-up |
![]() | %%Zchar \arithmos U-0001D538 |
![]() | %%Zchar \nat U+2115 |
![]() | %%Zprechar \power U+2119 |
Special characters of the core Z language are converted according to the following mark-up directives.
Z character | LATEX mark-up |
_ | %%Zchar \_ U+005F |
{ | %%Zchar \{ U+007B |
) | %%Zchar \ U+007D} |
![]() | %%Zchar \ldata U+300A |
![]() | %%Zchar \rdata U+300B |
![]() | %%Zchar \lblot U+2989 |
![]() | %%Zchar \rblot U+298A |
Superscripts and subscripts are marked-up as follows.
LATEX mark-up | Z characters | ![]() ![]() ![]() ![]() ![]() ![]() | ![]() ![]() ![]() ![]() |
_![]() ![]() | ![]() ![]() ![]() ![]() |
_{![]() ![]() | ![]() ![]() ![]() ![]() |
For example, 1 is marked-up as \exists_1.
The LATEX mark-up from which box characters are converted is discussed below.
The LATEX mark-up for NLCHAR and SPACE characters is discussed above.
Symbol characters of the core Z language are converted according to the following mark-up directives.
Z character | LATEX mark-up |
![]() | %%Zchar \vdash U+22A2 |
![]() | %%Zinchar \land U+2227 |
![]() | %%Zinchar \lor U+2228 |
![]() | %%Zinchar \implies U+21D2 |
![]() | %%Zinchar \iff U+21D4 |
![]() | %%Zprechar \lnot U+00AC |
![]() | %%Zprechar \forall U+2200 |
![]() | %%Zprechar \exists U+2203 |
![]() | %%Zinchar \cross U+00D7 |
![]() | %%Zinchar \in U+2208 |
\ | %%Zinchar \hide U+29F9 |
![]() | %%Zinchar \project U+2A21 |
![]() | %%Zinchar \semi U+2A1F |
>> | %%Zinchar \pipe U+2A20 |
The character is marked-up as an at character
(not formalized here due to typesetting problems).
Core words may be marked-up using the following commands, so that neighbouring spaces are converted implicitly.
Z characters | LATEX mark-up |
if | %%Zpreword \IF if |
then | %%Zinword \THEN then |
else | %%Zinword \ELSE else |
let | %%Zpreword \LET let |
pre | %%Zpreword \pre pre |
function | %%Zinword \function function |
generic | %%Zinword \generic generic |
relation | %%Zinword \relation relation |
leftassoc | %%Zinword \leftassoc leftassoc |
rightassoc | %%Zinword \rightassoc rightassoc |
,, | %%Zinword \listarg ,, |
_ | %%Zinword \varg _ |
Section headers are enclosed in a LATEX zsection environment.
\begin{zsection} \SECTION name \parents ... \end{zsection}
These \begin and \end brackets are converted to ZEDCHAR and ENDCHAR respectively.
Within a zsection environment, the only LATEXcommands that are converted are those of white space, _, and the following.
Z characters | LATEX mark-up |
section | %%Zpreword \SECTION section |
parents | %%Zinword \parents parents |
Each formal Z paragraph is enclosed in a LATEX environment, the \begin being converted to box characters (ZEDCHAR if the paragraph has no outline), and the \end being converted to an ENDCHAR character. Any middle line in an outlined paragraph may be marked-up using the \where command, which is converted to a | character with SPACE characters around it.
For each outlined paragraph, its mathematical representation, Z characters, and LATEX mark-up are given below.
Mathematical representation
DeclPart | ||
![]() |
![]() |
![]() |
Predicate |
Z characters
AXCHAR DeclPart | Predicate ENDCHAR
Latex mark-up
\begin{axdef} DeclPart \where Predicate \end{axdef}
Mathematical representation
[Formals] | ||
![]() |
![]() | |
![]() |
![]() | |
DeclPart | ||
![]() |
![]() |
![]() |
Predicate | ||
Z characters
GENCHAR AXCHAR [Formals] DeclPart | Predicate ENDCHAR
Latex mark-up
\begin{gendef}[Formals] DeclPart \where Predicate \end{gendef}
Mathematical representation
NAME | ||||
![]() |
![]() |
![]() | ||
![]() | ||||
DeclPart | ||||
![]() |
![]() |
![]() | ||
Predicate | ||||
![]() | ||||
![]() |
Z characters
SCHCHAR NAME DeclPart | Predicate ENDCHAR
Latex mark-up
\begin{schema}{NAME} DeclPart \where Predicate \end{schema}
Mathematical representation
NAME [Formals] | ||||
![]() |
![]() |
![]() | ||
![]() | ||||
![]() |
![]() |
![]() | ||
![]() | ||||
DeclPart | ||||
![]() |
![]() |
![]() | ||
Predicate | ||||
![]() | ||||
![]() |
Z characters
GENSCH NAME [Formals] DeclPart | Predicate END
Latex mark-up
\begin{schema}{NAME}[Formals] DeclPart \where Predicate \end{schema}
CADi can convert the following additional LATEX mark-up.
This is all defined in the prelude section,
and is not noticed by the -ws option.
CADi
would conform better to the standard if this mark-up were introduced in a separate CADi
-specific section.
CADi recognises the usual LATEX mark-up
of the whole of the rest of the Greek alphabet.
Each is defined by a %%Zchar directive.
Symbol characters of the core Z language are converted according to the following mark-up directives.
Z character | LATEX mark-up |
![]() | %%Zinchar \spot U+2981 |
| | %%Zinchar \mid U+007C |
![]() | %%Zinchar \dagger U+2020 |
![]() | %%Zinchar \zovr U+E01E |
![]() | %%Zinchar \xor U+22BB |
Core words may be marked-up using the following commands, so that neighbouring spaces are converted implicitly.
Z characters | LATEX mark-up |
comment | %%Zword \comment comment |
post | %%Zpreword \post post |
![]() | %%Zinword \thrm \vdash? |
undecor | %%Zpreword \undecor undecor |
CADi recognises \ST as a synonym for \where.
For non-outlined paragraphs, CADi recognises an alternative
to the zed environment called the syntax environment.
They differ only in that in the syntax environment,
the ampersand character is treated as white space
(allowing LATEX to use it as mark-up of columns to be aligned).
To mark-up an ampersand character in the syntax environment,
precede it with a backslash.
The LATEX mark-up recognised by cadiz also includes that of various tool directives.