Debian Codegraph @

texmf-dist/doc/latex/listing/listing.tex

raw
1 \documentclass[DIV=9, parskip=half, pagesize=auto]{scrartcl}
2
3 \usepackage{fixltx2e}
4 \usepackage{etex}
5 \usepackage{xspace}
6 \usepackage{lmodern}
7 \usepackage[T1]{fontenc}
8 \usepackage{textcomp}
9 \usepackage{array}
10 \usepackage{microtype}
11 \usepackage{hyperref}
12
13 \newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
14 \newcommand*{\pkg}[1]{\textsf{#1}}
15 \newcommand*{\cls}[1]{\textsf{#1}}
16 \newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
17 \makeatletter
18 \newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}}
19 \makeatother
20 \newcommand*{\env}[1]{\texttt{#1}}
21 \newcommand*{\opt}[1]{\texttt{#1}}
22 \newcommand*{\myllap}[1]{%
23 \quitvmode
24 \setbox0=\hbox{#1}%
25 \kern-\wd0
26 #1%
27 }
28
29 \deffootnote{1em}{0em}{\textsuperscript{\thefootnotemark}\,}
30 \addtokomafont{title}{\rmfamily}
31
32 \title{The \pkg{listing} package\thanks{This manual corresponds to \pkg{listing}~V1.2, dated~1999/05/25.}}
33 \subtitle{\LaTeX\ package for typesetting listings.}
34 \author{%
35 Matthew Hebley\thanks{Matthew is no longer available for contact, email or otherwise}%
36 \and Volker Kuhlmann\thanks{University of Canterbury\newline EEE Dept\newline Christchurch, New Zealand\newline E-Mail: \mail{[email protected]}}%
37 }
38 \date{1999/05/25}
39
40
41 \begin{document}
42
43 \maketitle
44
45 \begin{quote}
46 \footnotesize
47 This program can be redistributed and/or modified under the terms
48 of the \LaTeX\ Project Public License, distributed from CTAN
49 archives as \href{http://www.ctan.org/pub/tex-archive/macros/latex/base/lppl.txt}{\texttt{macros/latex/base/lppl.txt}}; either
50 version~1 of the License, or (at your option) any later version.
51 \end{quote}
52
53
54 \minisec{History:}
55
56 \begin{tabular}{@{}ll>{\raggedright\arraybackslash}p{10cm}@{}}
57 1.2 & 25 May 1999 & Re-published under the LPPL\@. No other change. \\
58 1.1 & 07 Feb 96 & Added setting of \cmd{\thelisting} with the \cls{book} and \cls{report} document classes. \\
59 1.0 & 19 Aug 94 & Created.
60 \end{tabular}
61
62
63 \minisec{Load with:}
64
65 \verb+\usepackage{listing}+\\
66 or\\
67 \verb+\usepackage[bigcaptions]{listing}+
68
69
70 \minisec{Package option:}
71
72 \begin{labeling}{\opt{bigcaptions}}
73 \item[\opt{bigcaptions}] If present, captions appear as for sections
74 (or chapters when using the ``\cls{book}'' or ``\cls{report}''
75 classes).
76 If not present, captions appear as for captions
77 in the \env{figure} or \env{table} environment.
78 \end{labeling}
79
80
81 \minisec{Available control sequences:}
82
83 \begin{labeling}{\cmd{\listlistingname}}
84 \item[\cmd{\begin\{listing\}}] A new environment for listings is provided.
85 Unlike \env{figure} and \env{table}, listing is \textls[40]{NOT}
86 a floating environment.
87 \item[\cmd{\caption}] As usual. (only inside listing!)
88 \item[\cmd{\label}] As usual. (only inside listing; after \cmd{\caption}!)
89 \item[\cmd{\ref}] As usual.
90 \item[\cmd{\listoflistings}] As for \cmd{\listoftables}, \cmd{\listoffigures}.
91 \item[\cmd{\listingname}] Produces the ``Listing'' text for the caption.
92 \item[\cmd{\listlistingname}] Produces the ``List of Listings'' text.
93 \end{labeling}
94
95 A \texttt{*.lol} file is produced similar to \texttt{*.lot}, \texttt{*.lof} files.
96
97 Does not change \cmd{\@makecaption} (unless option ``bigcaptions'' is used),
98 so packages that change the layout of \cmd{\caption} still work.
99 \pkg{listing.sty} works together with \pkg{hangcaption.sty}.
100
101 \begin{quote}
102 \myllap{``}Documentation is like sex.
103 If it is good, it is \textls[50]{REALLY} good,
104 and if it is bad, it is better than nothing!''
105
106 \hfill[Gabe Helou]
107 \end{quote}
108
109 \end{document}