Debian Codegraph @

texmf-dist/source/latex/outlining/outlining.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2017 by Dimitri Block <[email protected]>
4 % -------------------------------------------------------
5 %
6 % This file may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.3
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in:
10 %
11 % http://www.latex-project.org/lppl.txt
12 %
13 % and version 1.3 or later is part of all distributions of LaTeX
14 % version 2005/12/01 or later.
15 %
16 % \fi
17 %
18 % \iffalse
19 %<*driver>
20 \ProvidesFile{outlining.dtx}
21 %</driver>
22 %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
23 %<package>\ProvidesPackage{outlining}
24 %<*package>
25 [2017/10/23 v0.1 initial version]
26 %</package>
27 %
28 %<*driver>
29 \documentclass{ltxdoc}
30 \usepackage{outlining}
31 \EnableCrossrefs
32 \CodelineIndex
33 \RecordChanges
34 \begin{document}
35 \DocInput{outlining.dtx}
36 \PrintChanges
37 %\PrintIndex
38 \end{document}
39 %</driver>
40 % \fi
41 %
42 % \CheckSum{88}
43 %
44 % \CharacterTable
45 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
46 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
47 % Digits \0\1\2\3\4\5\6\7\8\9
48 % Exclamation \! Double quote \" Hash (number) \#
49 % Dollar \$ Percent \% Ampersand \&
50 % Acute accent \' Left paren \( Right paren \)
51 % Asterisk \* Plus \+ Comma \,
52 % Minus \- Point \. Solidus \/
53 % Colon \: Semicolon \; Less than \<
54 % Equals \= Greater than \> Question mark \?
55 % Commercial at \@ Left bracket \[ Backslash \\
56 % Right bracket \] Circumflex \^ Underscore \_
57 % Grave accent \` Left brace \{ Vertical bar \|
58 % Right brace \} Tilde \~}
59 %
60 %
61 % \changes{v0.1}{2017/10/23}{Initial version}
62 %
63 % \GetFileInfo{outlining.dtx}
64 %
65 % \DoNotIndex{\newcommand,\newenvironment, \listoftodos, \DeclareOption, \clearpage, \AtBeginDocument, \AtEndDocument, \newcounter}
66 %
67 %
68 % \title{The \textsf{outlining} package\thanks{This document
69 % corresponds to \textsf{outlining}~\fileversion, dated \filedate.}}
70 % \author{Dimitri Block \\ \texttt{[email protected]}}
71 %
72 % \maketitle
73 %
74 % \section{Introduction}
75 %
76 % Every scientifc document requires outlining before it is written.
77 % The following paragraph shows outline plus final text.
78 %
79 % \outlineTopics
80 % \topic{Best-practices outlines}
81 % A best-practices are three level outlines.
82 % \major{Each pararagraph shall have a single topic}
83 % \major{Each topic consists of multiple major points}
84 % \major{Major may have optional minor points}
85 %
86 % \fbox{\begin{minipage}{0.5\textwidth}
87 % \listOutline
88 % \end{minipage}}
89 %
90 %
91 % \StopEventually{}
92 %
93 % \section{Implementation}
94 % Some internal macros:
95 % \begin{macrocode}
96 \newcommand{\@disableOutlining}{}
97 \newcommand{\@disableTopics}{}
98 \newcommand{\@disableMajors}{}
99 \newcommand{\@disableMinors}{}
100 \newcommand{\@outlineAtBegin}{}
101 \newcommand{\@outlineAtEnd}{}
102 % \end{macrocode}
103 % \begin{macro}{disable}
104 % Disable all package output
105 % \begin{macrocode}
106 \DeclareOption{disable}{\renewcommand{\@disableOutlining}{disable}}
107 % \end{macrocode}
108 % \end{macro}
109 %
110 % \begin{macro}{outlineatbegin}
111 % Outline at document begin
112 % \begin{macrocode}
113 \DeclareOption{outlineatbegin}{\renewcommand{\@outlineAtBegin}{\listOutline}}
114 % \end{macrocode}
115 % \end{macro}
116 %
117 % \begin{macro}{outlineatend}
118 % Outline at document end
119 % \begin{macrocode}
120 \DeclareOption{outlineatend}{\renewcommand{\@outlineAtEnd}{\listOutline}}
121 % \end{macrocode}
122 % \end{macro}
123 %
124 % \begin{macrocode}
125 \ProcessOptions\relax
126 \usepackage[obeyFinal, \@disableOutlining]{todonotes}
127 \newcounter{majornum}
128 \newcounter{minornum}
129 \AtBeginDocument{\@outlineAtBegin}
130 \AtEndDocument{\@outlineAtEnd}
131 % \end{macrocode}
132 %
133 % \begin{macro}{\outlineTopics}
134 % Activate topics and deactive major and minor points
135 % \begin{macrocode}
136 \newcommand{\outlineTopics}{
137 \renewcommand{\@disableTopics}{}
138 \renewcommand{\@disableMajors}{disable}
139 \renewcommand{\@disableMinors}{disable}
140 }
141 % \end{macrocode}
142 % \end{macro}
143 % \begin{macro}{\outlineTopicsMajors}
144 % Activate topic and major points and deactive minor points
145 % \begin{macrocode}
146 \newcommand{\outlineTopicsMajors}{
147 \renewcommand{\@disableTopics}{}
148 \renewcommand{\@disableMajors}{}
149 \renewcommand{\@disableMinors}{disable}
150 }
151 % \end{macrocode}
152 % \end{macro}
153 % \begin{macro}{\outlineTopicsMajorsMinors}
154 % Activate topics, major and minor points
155 % \begin{macrocode}
156 \newcommand{\outlineTopicsMajorsMinors}{
157 \renewcommand{\@disableTopics}{}
158 \renewcommand{\@disableMajors}{}
159 \renewcommand{\@disableMinors}{}
160 }
161 % \end{macrocode}
162 % \end{macro}
163 % \begin{macro}{\topic}
164 % Topic
165 % \begin{macrocode}
166 \newcommand{\topic}[1]
167 {\setcounter{majornum}{0}\setcounter{minornum}{0}\todo[color=red!40, size=\footnotesize, inline,\@disableTopics]
168 {\textbf{#1}}}
169 % \end{macrocode}
170 % \end{macro}
171 % \begin{macro}{\major}
172 % Major point
173 % \begin{macrocode}
174 \newcommand{\major}[1]
175 {\stepcounter{majornum}\setcounter{minornum}{0}\todo[color=green!10, size=\footnotesize, inline,\@disableMajors]
176 {\themajornum \; #1}}
177 % \end{macrocode}
178 % \end{macro}
179 % \begin{macro}{\minor}
180 % Minor point
181 % \begin{macrocode}
182 \newcommand{\minor}[1]
183 {\stepcounter{minornum}\todo[color=gray!10, size=\footnotesize, inline, \@disableMinors]
184 {\themajornum.\theminornum \; #1}}
185 % \end{macrocode}
186 % \end{macro}
187 % \begin{macro}{\listOutline}
188 % Outline list
189 % \begin{macrocode}
190 \newcommand{\listOutline}{
191 \clearpage
192 \listoftodos[Document Outline]
193 \clearpage
194 }
195 % \end{macrocode}
196 % \end{macro}
197 %
198 %
199 % \Finale
200 \endinput