| 1 |
This note describes the various LaTeX environments used for "code" |
| 2 |
(in a broad sense) in the tex sources for the Gretl User's Guide. |
| 3 |
|
| 4 |
First note that there are two types of code material in the Guide: |
| 5 |
|
| 6 |
(1) Chunks or one-liners interspersed in the text. |
| 7 |
|
| 8 |
(2) Hansl code and/or output packaged as a "float" using |
| 9 |
the "script" environment defined in gretl.sty (on the |
| 10 |
pattern of the figure and table environments). |
| 11 |
|
| 12 |
We currently use the environments code, script, scode, scodebit |
| 13 |
and outbit (the last being new as of December 2020). |
| 14 |
|
| 15 |
* Use of "code" looks like: |
| 16 |
|
| 17 |
\begin{code} |
| 18 |
stuff goes here |
| 19 |
\end{code} |
| 20 |
|
| 21 |
The content of this environment is shown in a small monospace |
| 22 |
font and indented relative to the surrounding text. It is |
| 23 |
primarily intended for use (1) above. |
| 24 |
|
| 25 |
* "scode": This is used within the script environment, when the |
| 26 |
only content of the float is program code (no output included). |
| 27 |
|
| 28 |
\begin{script}[...] |
| 29 |
\caption{...} |
| 30 |
\label{...} |
| 31 |
\begin{scode} |
| 32 |
Code goes here |
| 33 |
\end{scode} |
| 34 |
\end{script} |
| 35 |
|
| 36 |
The content is shown in a small monospace font, colored teal, with |
| 37 |
rules at top and bottom. |
| 38 |
|
| 39 |
* "scodebit": This should be used within the script environment, |
| 40 |
along with "outbit", when the float contains both program code |
| 41 |
and output: |
| 42 |
|
| 43 |
\begin{script}[...] |
| 44 |
\caption{...} |
| 45 |
\label{...} |
| 46 |
can put short text here |
| 47 |
\begin{scodebit} |
| 48 |
Code goes here |
| 49 |
\end{scodebit} |
| 50 |
can put short text here |
| 51 |
\begin{outbit} |
| 52 |
Output goes here |
| 53 |
\end{outbit} |
| 54 |
\end{script} |
| 55 |
|
| 56 |
The appearance of content within scodebit (and outbit) is the same |
| 57 |
as scode, except that the rules are omitted. |
| 58 |
|
| 59 |
* "outbit": Used in the script environment rather than scodebit to |
| 60 |
signal that its content should not be included when we auto- |
| 61 |
extract scripts from the Guide chapter files. |
| 62 |
|
| 63 |
Last revised 2020-12-06 |