CADiZ

Reference manual / Latex mark-up


Contents of this page

Introduction

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.

ISO Standard mark-up

White space and comments

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.

Mark-up directives

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\num, 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.

Greek letters

The Greek letters of the core Z language are converted according to the following mark-up directives.

Z character LATEX mark-up
\Delta %%Zchar \Delta U+0394
\Xi %%Zchar \Xi U+039E
\theta %%Zchar \theta U+03B8
\lambda %%Zchar \lambda U+03BB
\mu %%Zchar \mu U+03BC

Other letters

Other letters of the core Z language are converted according to the following mark-up directives.

Z character LATEX mark-up
\arithmos %%Zchar \arithmos U-0001D538
\nat %%Zchar \nat U+2115
\power %%Zprechar \power U+2119

Special characters

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}
\ldata %%Zchar \ldata U+300A
\rdata %%Zchar \rdata U+300B
\lblot %%Zchar \lblot U+2989
\rblot %%Zchar \rblot U+298A

Superscripts and subscripts are marked-up as follows.

^\langlesingle LATEX token\rangle

LATEX mark-up Z characters
\nearrow\langleZ character sequence\rangle\swarrow ^{\langleLATEX tokens\rangle} \nearrow\langleZ character sequence\rangle\swarrow

_\langlesingle LATEX token\rangle \searrow\langleZ character sequence\rangle\nwarrow
_{\langleLATEX tokens\rangle} \searrow\langleZ character sequence\rangle\nwarrow

For example, \exists1 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

Symbol characters of the core Z language are converted according to the following mark-up directives.

Z character LATEX mark-up
\vdash %%Zchar \vdash U+22A2
\land %%Zinchar \land U+2227
\lor %%Zinchar \lor U+2228
\implies %%Zinchar \implies U+21D2
\iff %%Zinchar \iff U+21D4
\lnot %%Zprechar \lnot U+00AC
\forall %%Zprechar \forall U+2200
\exists %%Zprechar \exists U+2203
\cross %%Zinchar \cross U+00D7
\in %%Zinchar \in U+2208
\ %%Zinchar \hide U+29F9
\project %%Zinchar \project U+2A21
\semi %%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

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 header mark-up

Section headers are enclosed in a LATEzsection 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

Paragraph mark-up

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.

Axiomatic description paragraph mark-up

Mathematical representation


DeclPart
\where
Predicate

Z characters

AXCHAR DeclPart | Predicate ENDCHAR

Latex mark-up

\begin{axdef} DeclPart \where Predicate \end{axdef}

Generic axiomatic description paragraph mark-up

Mathematical representation

[Formals]

DeclPart
\where \where \where
Predicate

Z characters

GENCHAR AXCHAR [Formals] DeclPart | Predicate ENDCHAR

Latex mark-up

\begin{gendef}[Formals] DeclPart \where Predicate \end{gendef}

Schema definition paragraph mark-up

Mathematical representation

NAME

DeclPart
\where \where \where
Predicate
\end{schema}

Z characters

SCHCHAR NAME DeclPart | Predicate ENDCHAR

Latex mark-up

\begin{schema}{NAME} DeclPart \where Predicate \end{schema}

Generic schema definition paragraph mark-up

Mathematical representation

NAME [Formals]

DeclPart
\where \where \where
Predicate
\end{schema}

Z characters

GENSCH NAME [Formals] DeclPart | Predicate END

Latex mark-up

\begin{schema}{NAME}[Formals] DeclPart \where Predicate \end{schema}

CADiZ-specific mark-up

CADi\num 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\num would conform better to the standard if this mark-up were introduced in a separate CADi\num-specific section.

Greek Letters

CADi\num 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

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
\dagger %%Zinchar \dagger U+2020
\zovr %%Zinchar \zovr U+E01E
\xor %%Zinchar \xor U+22BB

Core words

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
\vdash? %%Zinword \thrm \vdash?
undecor %%Zpreword \undecor undecor

Paragraph mark-up

CADi\num recognises \ST as a synonym for \where.

For non-outlined paragraphs, CADi\num 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.

Tool directives

The LATEX mark-up recognised by cadiz also includes that of various tool directives.


IT 20-Jan-2002