☰ Click for Table of Contents
BookWiki Documentation
Copyright 2026
Rance D. Necaise

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.

Listing
  1. # countvowels.py
  2. # This program iterates through a string and counts the number of
  3. # vowels it contains.
  4.  
  5. # Extract a string from the user.
  6. text = raw_input( "Enter a string to be evaluated: " )
  7.  
  8. # Iterate through the string.
  9. numVowels = 0
  10. for ch in text :
  11.    if ch in "aeiou" :
  12.       numVowels = numVowels + 1
  13.      
  14. # Print the results.
  15. print "There are " + str( numVowels ) + " vowels in the string."

The program command is defined below:

panels module
\program[keys]{filename}

     valid keys:   
              page=path 
              linenum=# 
              lang=text]
              link=fancy|top|text|hide
              label=name
Include a program's source listing from an attached file. This command serves as a wrapper around the command that allows for styling a common look to the program listings similar to other content panels.
Argument:
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.

Keys:
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.

ValueDescription
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.

Plugin:  ProgramPanel

The ADT Definition panel shown above is produced from the following syntax

\program{countvowels.py}
  August 19, 2026 at 02:46 PM