Debian Codegraph @

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

raw
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % outlines.tex - Documentation for the outlines package
3 %
4 % Charles Pecheur, UCL, 2005 -- 2012
5 % [email protected]
6 %
7 % This work may be distributed and/or modified under the
8 % conditions of the LaTeX Project Public License, either version 1.3
9 % of this license or (at your option) any later version.
10 % The latest version of this license is in
11 % http://www.latex-project.org/lppl.txt
12 % and version 1.3 or later is part of all distributions of LaTeX
13 % version 2005/12/01 or later.
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 \documentclass[11pt]{article}
16
17 \usepackage{outlines}
18 \usepackage{fancyvrb}
19 \DefineShortVerb{\"}
20
21 \title{The \texttt{outlines} package}
22 \author{Charles Pecheur}
23 \date{Version 1.1 -- January 23, 2012}
24
25 \begin{document}
26
27 \maketitle
28
29 \begin{abstract}
30 The \texttt{outlines} package defines the \texttt{outline} environment,
31 that allows outline-style indented lists with freely mixed levels up
32 to four levels deep. It replaces the nested "begin"/"end" pairs by
33 different item tags "\1" to "\4" for each nesting level. This is very
34 convenient in cases where nested lists are used a lot, such as for to-do
35 lists or presentation slides.
36 \end{abstract}
37
38
39 \section{Examples}
40
41 \subsection{Basics}
42
43 {\small\begin{verbatim}
44 \begin{outline}
45 \1 This is a first item.
46 \1[!!!] This is a second, with a custom label.
47 \2 A level-2 item.
48 \3 A level 3.
49 \4 Deepest is level 4.
50 \2 Back to level 2.
51 \0 A normal paragraph in the middle.
52 \1 A couple more
53 \2 items.
54 \end{outline}
55 \end{verbatim}}
56
57 \noindent Produces:
58
59 {\small
60 \begin{outline}
61 \1 This is a first item.
62 \1[!!!] This is a second, with a custom label.
63 \2 A level-2 item.
64 \3 A level 3.
65 \4 Deepest is level 4.
66 \2 Back to level 2.
67 \0 A normal paragraph in the middle.
68 \1 A couple more
69 \2 items.
70 \end{outline}
71 }
72
73 \subsection{Changing List Styles at Each Level}
74
75 {\small\begin{verbatim}
76 \renewcommand{\outlineii}{enumerate}
77 \begin{outline}
78 \1 This is a first item.
79 \2 A level-2 item in enumerate style.
80 \2 And another.
81 \0 A normal paragraph in the middle.
82 \renewcommand{\outlineii}{description}
83 \1 More level-1.
84 \2[Descr] Level-2 in description style.
85 \end{outline}
86 \end{verbatim}}
87
88 \noindent Produces:
89
90 {\small
91 \renewcommand{\outlineii}{enumerate}
92 \begin{outline}
93 \1 This is a first item.
94 \2 A level-2 item in enumerate style.
95 \2 And another.
96 \0 A normal paragraph in the middle.
97 \renewcommand{\outlineii}{description}
98 \1 More level-1.
99 \2[Descr] Level-2 in description style.
100 \end{outline}
101 }
102
103 \subsection{Changing List Styles for the Whole Outline}
104
105 {\small\begin{verbatim}
106 \begin{outline}[enumerate]
107 \0 All in enumerate style.
108 \1 A level-1 enum.
109 \2 A level-2 enum.
110 \3 A level-3 enum.
111 \4 A level-4 enum.
112 \end{outline}
113 \end{verbatim}}
114
115 \noindent Produces:
116
117 {\small
118 \begin{outline}[enumerate]
119 \0 All in enumerate style.
120 \1 A level-1 enum.
121 \2 A level-2 enum.
122 \3 A level-3 enum.
123 \4 A level-4 enum.
124 \end{outline}
125 }
126
127 \subsection{With Custom List Styles}
128
129 \noindent For example, the following list environment provides a variant of "enumerate" that keeps increasing item numbers across different enumerations:
130
131 {\small\begin{verbatim}
132 \newcounter{cenum}
133 \newcounter{cenumsaved}
134 \setcounter{cenumsaved}{0}
135 \newcommand{\labelcenum}{\arabic{cenum}.}
136 \newenvironment{cenumerate}%
137 {\begin{list}{\labelcenum}{\usecounter{cenum}}%
138 \setcounter{cenum}{\value{cenumsaved}}}%
139 {\setcounter{cenumsaved}{\value{cenum}}%
140 \end{list}}
141 \end{verbatim}}
142
143 \newcounter{cenum}
144 \newcounter{cenumsaved}
145 \setcounter{cenumsaved}{0}
146 \newcommand{\labelcenum}{\arabic{cenum}.}
147 \newenvironment{cenumerate}%
148 {\begin{list}{\labelcenum}{\usecounter{cenum}}%
149 \setcounter{cenum}{\value{cenumsaved}}}%
150 {\setcounter{cenumsaved}{\value{cenum}}%
151 \end{list}}
152
153 \noindent This can be used as a list style in an outline as follows:
154
155 {\small\begin{verbatim}
156 \renewcommand{\outlineii}{cenumerate}
157 \begin{outline}
158 \1 This is a first item.
159 \2 A level-2 item in cenumerate style.
160 \2 And another.
161 \0 A normal paragraph in the middle.
162 \1 More level-1.
163 \2 Level-2 with continued numbering.
164 \end{outline}
165 \end{verbatim}}
166
167 \noindent Which produces:
168
169 {\small
170 \renewcommand{\outlineii}{cenumerate}
171 \begin{outline}
172 \1 This is a first item.
173 \2 A level-2 item in cenumerate style.
174 \2 And another.
175 \0 A normal paragraph in the middle.
176 \1 More level-1.
177 \2 Level-2 with continued numbering.
178 \end{outline}
179 }
180
181 \section{Usage}
182
183 \begin{outline}
184
185 \0 In the preamble:
186
187 \1 "\usepackage{outlines}"
188
189 loads this package (no options supported).
190
191 \0 In the document:
192
193 \1 "\begin{outline}["\emph{style}"]" \emph{body} "\end{outline}"
194
195 produces an \emph{outline} region, with a hierarchy of items up to four levels deep. The outline is formatted according to \emph{style}, which must be the name of a \LaTeX\ list environment. The default is "itemize". All levels use the same style.
196
197 \1 "\renewcommand{\outlinei}{"\emph{style}"}" \\
198 "\renewcommand{\outlineii}{"\emph{style}"}" \\
199 "\renewcommand{\outlineiii}{"\emph{style}"}" \\
200 "\renewcommand{\outlineiiii}{"\emph{style}"}"
201
202 change the list style to \emph{style} for levels 1, 2, 3 and 4.
203
204 \0 Inside \emph{body}:
205
206 \1 "\1["\emph{lbl}"]", "\2["\emph{lbl}"]", "\3["\emph{lbl}"]",
207 "\4["\emph{lbl}"]"
208
209 introduce outline items at the four nesting levels. They are
210 used the same way as "\item["\emph{lbl}"]" in list environments, where
211 \emph{lbl} is an optional custom item label.
212
213 \1 "\0"
214
215 introduces a normal, non-itemized paragraph.
216
217 \end{outline}
218
219 \section{Remarks}
220
221 \LaTeX\ list environments cannot begin with a nested list.
222 In outlines, that means that a level-$n$ item may only follow an item
223 of level $n-1$ or higher. For example, the following produces two
224 ``"missing \item"'' errors:
225
226 \begin{verbatim}
227 \begin{outline}
228 \2 Missing level 1,
229 \4 missing level 3.
230 \end{outline}
231 \end{verbatim}
232
233 Do not use outlines inside other outlines or other list environments.
234 Nested lists in outlines should work and be consistent with the current
235 level of the outline (e.g. a nested list following a level-2 outline
236 item will look as a level-3 list). The four-level limit applies overall.
237
238 Outside an outline, re-defining outline styles (by changing "\outlinei" etc.) will apply to all posterior outlines; inside an outline, it will apply only according to usual \LaTeX\ list scoping rules: for example, re-defining "\outlineii" at level 1 will apply to posterior level-2 sub-lists within this level-1 sublist only; re-defining "\outlineii" inside a level-2 sub-list will have no effect. Note that the \emph{style} parameter of the "outline" environment applies to non-redefined styles only.
239
240 \section{Implementation Notes}
241
242 The package is implemented in \LaTeX\ (no plain \TeX); it should be
243 easy to understand and customize even to a non-\TeX-pert. The main
244 programming trick is a set of commands "\ol@toz", \dots, "\ol@toiiii"
245 which are dynamically modified to contain the necessary list openings or closings to reach outline levels 0 to 4 from the current level.
246
247 Outlines expand to the corresponding hierarchy of nested lists of the
248 selected style. All custom list formatting and user-provided list styles
249 should be compatible with "outline" environments, as long as they keep
250 the "\item" syntax.
251
252 \paragraph{History}
253
254 \begin{description}
255
256 \item[v 1.1 (Jan 2012)] Added re-definition of individual list styles.
257
258 \item[(no version) (Mar 2005)] Initial release.
259
260 \end{description}
261
262 \section{Credits}
263
264 This package was developed by Charles Pecheur at Universit\'e catholique de Louvain, Belgium. It may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version ("http://www.latex-project.org/lppl.txt"). Charles Pecheur can be contacted at "[email protected]".
265
266 This package is independent from similar packages "outline.sty" and "outliner.sty", available on the CTAN archive.
267
268 \end{document}