Command-Line Referece

The syntax of the command-line version is the same on Linux and Windows[15].

Note that the command line syntax below is a superset of the command-line options of the mscgen tool. This means that by renaming msc-gen to mscgen you can use Msc-generator’s extra features and rich language in every tool that is integrated with mscgen. These tools include Doxyge, Sphinx and Msctexen.

Usage: msc-gen [-T type] [-o file] [infile] [-Wno] [-Pno] [--pedantic] 
               [-p[=page size] [-m{lrud}=margin]] [-a[h]]
               [[-x=width] [-y=height] | [-s=scale]]
               [-F font] [-D design_file] [--nodesigns]
               [--chart_option=value] [--chart_design]
       msc-gen -l
-T type

Specifies the output file type, which maybe one of png, eps, pdf, svg, ismap, lmap or emf (on Windows only). Default is png. Output type ismap generates an NCSA format ismap file contain link information, see Links. You can also specify lmap, which will not generate any graphics either, but a text file listing each label in the chart with their coordinates. This is useful if you want to assign tooltips of clickable regions. See Label Maps below for details.

-o file

Write output to the named file. If omitted the input filename will be appended by the appropriate extension and used as output. If neither input nor output file is given, mscgen_out.{png,eps,pdf,svg,emf} will be used.

infile

The file from which to read input. If omitted or specified as -, input will be read from the standard input.

-p=[page size]

Full-page output. (PDF only now.) In this case the chart is drawn on fixed-size pages (following pagination) with one pixel equalling to 1/72 inches. If a chart page is larger than a physcal page it is simply cropped with a warning. Setting the scale with the -s option enables zooming. Page size can be set to ISO sizes from A0 to A6, and to US sizes, such as letter, legal, ledger and tabloid. Append a ‘p’ or an ‘l’ for portrait and landscape, respectively (except for ‘tabloid’ and ‘ledger’, which are by definition portrait and landscape, resp.). E.g., use ‘A4p’, ‘A2l’ or ‘letter_l’. Deafult is ‘A4p’.

-m{lrud}=‘margin

Useful only for full-page output, specifies the margin. A separate option is needed to specify the left, right, upwards and downwards margins, denoted by the second letter of the option. Margins are to be specified in inches (number only) or in centimeters, if appended with ’cm’ (no spaces). The default margin is half inches everywhere.

-va=<center|up|down> , -ha=<center|left|right>

Set the vertical and horizontal alignment within a page for full-page output.

-a[h]

Automatic pagination. Used only with full-page output. If specified, scale cannot be ‘auto’. Specifying -ah will insert a heading after automatically inserted page breaks.

--pedantic

When used all entities are expected to be declared before being used. Arrows with entities not declared before will trigger an error. (But the entity will be implicitly declared and the arrow included.)

-x=width

Specifies chart width (in pixels). Meant to be used for bitmaps (PNG and BMP), but works for all graphics output.

-y=height

Specifies chart height (in pixels). If only one of -x or -y is specified, the aspect ratio is kept. Meant to be used for bitmaps (PNG and BMP), but works for all graphics output.

-s=scale

Can be used to scale chart size up or down. Default is 1.0. Cannot be used together with any of -x or -y. Meant to beused for bitmaps (PNG and BMP) or full-page output (-p), but works for all graphics output. For full-page output, you can set scale to ‘width’ which results in the chart width being set to the page width, or ‘auto’, which scales such that all pages fits. For full-page output, you can specify multiple -s options, which makes msc-gen to try them in the order specified until one is found for which no pages need to be cropped. If none is such, the last one will be used and a warning will be given.

-F font

Use specified font. This must be a font name available in the local system, and overrides the MSCGEN_FONT environment variable if that is also set.

-D design_file

Load file containing additional chart design definitions. You can have multiple of this option to load several design files, after the default ones. See Chart Designs for more info.

--nodesigns

If you specify this no design files will be loaded (no even the ones you specify with -D. This is useful to increase performance when you do not use them anyway.

--chart_option=value

Any chart option (see Chart Options) can be specified on the command line. These are overridden by options in the file. Do not use any space before or after the equal sign.

--chart_design

The design pattern of the chart can be specified on the command line (see Chart Designs). This will overridde any design specified in the file.

-Wno

No warnings displayed.

-Pno

No progress indicator displayed.

-l

Display program licence and exit.

-h

Display program help and exit.

Label Maps

When you specify lmap as output file format, Msc-generator creates a text file with one line for each text label in the chart[16] (and no graphics output). The default extension will be .map. The lines in the output file contains the followin information separated by space.

<type> <page> <x1> <y1> <x2> <y2> <first line>

The type character tells, what chart element contained this label. The following characters are possible

A

Arrow, including block arrows (including boxes collapsed to arrows)

E

Entity heading. Each appeareance of the entities will result in one line.

B

Box that has content (unless collapsed)

b

Box that contains just a label (or collapsed)

P

Pipes

V

Verticals (all forms, including boxes, block arrows, ranges, braces and brackets)

D

Divides, titles, subtitles, discontinuity lines and plain text (like [label="aaa"];).

N

Floating notes

C

Comments (on the side or at the end)

The second item page gives which page the label is on. One label is mentioned only once even if it spans multiple pages.

The following four numbers give the upper left and lower right corner of the bounding box of the label (and not the corresponding element). It is given in pixels for bitmap output and in logical coordinates matching the logical size of the output image for vector graphics output. The coordinates are relative to the top left corner of the page origin and are rounded to integers for ease of use. So if you run Msc-generator twice, once with a graphics output format and once with label map output (leaving all scaling and other swicthes the same), the coordinates of the label map shall match the graphics output perfectly.

Finally the line ends with the first line of the label (which may contain spaces), potentially with the number prepended (if any) in the number format used in the chart (e.g., roman numbers). Note that the coordinates specify the bounding box of the entire label, not just the first line given here.



[15] The only two exceptions are in how pathnames are written on the two systems and the fact that the Windows version will look for a designlib.signalling file for design definitions, while the Linux version will not.

[16] Note that box tags are not included in the label map.