Program Panel
The program content panel is used to include and highlight source code contained in a source file. There is also a program listing side panel, which is similar but it can be toggled between open and closed.
Program: countvowels.py |
The program command is defined below:
\program[keys]{filename}
valid keys:
page=path
linenum=#
lang=text]
link=fancy|top|text|hide
label=name
- filename
-
A required argument that provides the name of the attached file to be included and formatted. By default, the file extension is used to determine the source type.
- page
-
The link path to the page containing the attached file. By default the current page is assumed.
- label
-
Defines a reference label or name for the program listing content panel. The label can be used with the \ref{label} command to create a reference link to the panel.
- link
-
The type or style of the link used to download the attachment. The default is text.
Value Description fancy produces a gui tab like link at the top of the listing. text includes a text based link below the listing, similar to a figure caption. top same as text, but the caption is placed at the top. hide omit or hide the attachment link. - lang
-
The name of the language for the code contained within the block. The list of languages is the same as those used with the source environment. If no language is provided, then the default specified by the global variable $SourceCodeDefaultLang is used.
- linenum
-
Enables the use of line numbers. By default, line numbers are not included in the source code. If provided with a number linenum=2, the value indicates which line numbers should be boldfaced. For a value of 2, every other line number would be boldfaced. The default is for every 5th line number to be boldfaced.
The ADT Definition panel shown above is produced from the following syntax
\program{countvowels.py}