• No results found

The vdmlisting Package Kenneth Lausdahl Dept. of Engineering Aarhus University Denmark.

N/A
N/A
Protected

Academic year: 2021

Share "The vdmlisting Package Kenneth Lausdahl Dept. of Engineering Aarhus University Denmark."

Copied!
4
0
0

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

Hele tekst

(1)

The vdmlisting Package

Kenneth Lausdahl

Dept. of Engineering

Aarhus University

Denmark.

kenneth@lausdahl.com

10 Novemberl 2020

Version 1.1

Abstract

The vdmlistingpackage is a Vienna Development Method (VDM) source code printer for LATEX. The package uses the listings package and provides a

num-ber of new listing environments for the three VDM dialects: VDM-SL,VDM-PP and VDM-RT. If one wants to typeset VDM with a mathematical syntax instead of the ASCII syntax used here then use the vdm package instead.

Contents

1 Getting started 1

1.1 A minimal example . . . 1 1.2 Typesetting VDM with listings . . . 2 1.3 Previous versions . . . 3

2 Package loading 3

3 Installing the vdmlisting files 4

4 The License 4

1

Getting started

Before using the vdmlistingpackage, you should be familiar with the LATEXtypesetting

system and the listings package which this packages depends upon.

1.1

A minimal example

Here is a minimal file for vdmlistingshowing a VDM function:

(2)

\documentstyle{article} \usepackage{vdmlisting}

\begin{document} \begin{vdmsl}

add : int * int -> add(a,b) == a+b; \end{vdmsl}

\end{document}

1.2

Typesetting VDM with listings

This package defined three listing environments that can be used to typeset VDM. The environments are defined as:

\begin{listing-name}[options] VDM specification

\end{listing-name}

The options are parsed directly to the lstlisting environment and could be used to e.g. set the label or caption like label=lst:mymodel,caption=My special specification. The listing-name may be any of the following:

vdmsl The vdmslenvironment configures the listing environment to use the VDM-SL language definition: \begin{vdmsl}[label=lst:mymodule,caption=My module] module MyModule end MyModule \end{vdmsl} it typesets as follows:  module MyModule end MyModule   Listing 1: My module

(3)

it typesets as follows:  class MyClass end MyClass   Listing 2: My Class

vdmrt The vdmrtenvironment configures the listing environment to use the VDM-RT language definition: \begin{vdmrt}[label=lst:myclass,caption=My System] system MySystem end MySystem \end{vdmrt} it typesets as follows:  system MySystem end MySystem   Listing 3: My System

Furthermore, the environments are configured with escapeinside={(*@}{@*)} enabling the command \vdmnotcovered{ VDM specification} to be used to mark execution coverage for the VDM specification displayed.

1.3

Previous versions

This package includes all environments from the previous version 1.0 of this pack-age. All environments and language definitions can be post fixed with 10 to get the previous version.

2

Package loading

As usual in LATEX, the package is loaded by \usepackage[optionsi]{vdmlisting},

where [optionsi] is optional and gives a comma separated list of options:

color This loads the color package and defines the vdmnotcovered command to use a red color.

notimes This package loads the times package, by default, so if you do not want that to happen use this option to skip the load of times.

(4)

3

Installing the vdmlisting files

Place the file vdmlisting.sty in your standard directory for LATEX style files (your

system administrator will know where this is).

4

The License

The vdmlisting.sty and vdmlisting.tex file is copyright 2012–2020 Kenneth Lausdahl and is released under the LaTeX Project Public License 1.3 or later.

Referenties

GERELATEERDE DOCUMENTEN

Does not change \@makecaption (unless option “bigcaptions” is used), so packages that change the layout of \caption still work. listing.sty works together

30 \hook_use_once:n {pdfmanagement/add}.. Redefine \DeclareDocumentMetadata so that it only process the keys. This function is documented on page 1 .) 2.2 Container for

\TABcell{}{} – presents the cell content in the prevailing mode (text or math) and style set by stackengine and tabstackengine \TABcellBox{}{} – presents the cell content, in

We also assign a non zero value \lccode to the apostrophe that in Friulan is being used for marking a vocalic elision; by giving it a non zero value; the hyphenation algorithm

Although the T1 font encoding ligatures solve the problem, there are some cir- cumstances where even the T1 font encoding cannot be used, either because the author/typesetter wants

\DTMbretondatetimesep The separator between the date and time blocks in the full format (either text or numeric).

\DTMcatalandatetimesep The separator between the date and time blocks in the full format (either text or numeric).

timezonesep The separator between the time and zone for the full date-time for- mat (as used by \DTMdisplay) for both the finnish and finnish-numeric styles.. This defaults