Debian Codegraph @

texmf-dist/doc/latex/tlc-article/tlc-article.tex

raw
1 \documentclass[12pt]{tlc-article}
2
3 % ------------------------------------------------------------------------------
4 \begin{document}
5
6 % ------------------------------------------------------------------------------
7 \tlcTitlePageAndTableOfContents
8 {tlc-article}
9 {Gary Allan Howard}
10 {The \tlcA\ `Getting Started Guide' covers how to install \tlcA\ both globally
11 and locally, describes the general use case, how to customize your \tlcA\
12 environment, describes the commands \tlcA\ implements, and reveals the
13 packages \tlcA\ depends upon.}
14
15 % ------------------------------------------------------------------------------
16 \section{Installation}
17 This section describes how to install \tlcA\ either globally to make it
18 available to your \LaTeX\ environment or locally to the document you are
19 authoring. And, this section identifies the prerequisites you must meet in
20 order to clone a repository from GitHub.com and install software on your
21 computer.
22
23 % ------------------------------------------------------------------------------
24 \subsection{Prerequisites}
25 The following prerequisites are needed.
26 \begin{description}[style=nextline]
27 \item[Administrative privilege] You will need administrative privileges to
28 install \tlcA\ globally because `sudo' is used.
29
30 \item[SSH key] You will need your private key to access \gitHub. Please refer
31 to \url{http://help.github.com/articles/generating-an-ssh-key} for
32 instructions on `Generating an SSH key'.
33
34 \item[Enable your SSH key] The following instructions enable your SSH key so
35 you to not have to enter the passphrase for each git command.
36 \end{description}
37
38 \begin{lstlisting}[language=bash]
39 eval \$(ssh-agent -s)
40 ssh-add ~/.ssh/your-private-key
41 \end{lstlisting}
42
43 % ------------------------------------------------------------------------------
44 \subsection{Local installation}
45 A local installation is done by installing \tlcA\ into
46 /the/path/to/your/document. Assuming your document is located at \tlcMyDoc\ the
47 following shell commands will make \tlcA\ available to your document.
48
49 \begin{lstlisting}[language=bash]
50 cd $HOME
51 git clone [email protected]:Traap/tlc-article.git
52 cd tlc-article
53 mkdir $HOME/mydoc
54 cp -v tlc-article.cls $HOME/mydoc/.
55 \end{lstlisting}
56
57 % ------------------------------------------------------------------------------
58 \clearpage
59 \subsection{Global installation}
60 A global installation is done by installing \tlcA\ into your /path/to/your/texmf
61 directory. Assuming a TexLive installation exists at \texDist\ the following
62 shell commands will make \tlcA\ available to your \LaTeX\ environment.
63
64 \begin{lstlisting}[language=bash]
65 cd $HOME
66 git clone [email protected]:Traap/tlc-article.git
67 cd tlc-article
68 sudo mkdir -p $(kpsewhich -var-value TEXMFLOCAL)/tex/latex/tlc-article
69 sudo cp -v tlc-article.cls $(kpsewhich -var-value TEXMFLOCAL)/tex/latex/tlc-article/.
70 sudo mktexlsr $(kpsewhich -var-value TEXMFLOCAL)
71 \end{lstlisting}
72
73 \bigskip
74
75 \todo[inline]{%
76 \tlcNote: You may remove your local installation by removing \tlcA.%
77 }%
78
79 % ------------------------------------------------------------------------------
80 \clearpage
81 \section{General Use Case}
82 The goal of \tlcA\ is to simplify document layout. \tlcA\ orchestrates a
83 logical arrangement for document header, footer, author, abstract, table of
84 contents, and margins. The following sections outline the default
85 implementation for each part \tlcA\ organizes.
86
87 \tlcNote\ This document was typeset using the instructions provided throughout
88 this section.
89
90 \subsection{Document Layout}
91 \begin{figure}[h]
92 \centering
93 \includegraphics{images/titlepage.png}
94 \caption{Document Layout}
95 \label{fig:layout}
96 \end{figure}
97
98 % ------------------------------------------------------------------------------
99 \subsection{documentclass \tlcA}
100 \tlcA\ extends the article document class. \tlcA\ provide options directly to
101 the article document class. As an example, the Author can specify the font as
102 follows:
103
104 \begin{lstlisting}[basicstyle=\tiny]
105 \documentclass[12pt]{tlc-article}
106 \end{lstlisting}
107
108 % ------------------------------------------------------------------------------
109 \subsection{Title, Author \& Abstract} \label{sec:TAA}
110 \tlcA\ has a macro \tlcTOC\ that can be used to set the document title, document
111 author, document abstract, and establish the Table of Contents. The sample
112 below reveals how to use \tlcTOC.
113
114 \begin{lstlisting}[basicstyle=\tiny]
115 \tlcTitlePageAndTableOfContents
116 {Document Title}
117 {Document Article}
118 {Document Abstract}
119 \end{lstlisting}
120
121 % ------------------------------------------------------------------------------
122 \subsection{Table of Contents}
123 The Table of Contents immediately follows the document abstract on page 1, uses
124 dark blue for content, dots separate table of contents sections and page number,
125 and uses roman numerals.
126
127 % ------------------------------------------------------------------------------
128 \subsection{Header \& Footer}
129 fancyhdr is used to render the header and footer. The Author can override the
130 \tlcA\ by providing an implementation in \tlcHF\, or augment \tlcA\
131 application by providing \tlcVE. The sections below show the placement \tlcA\
132 uses when writing objects, and where the objects are defined.
133
134 \bigskip
135
136 \todo[inline]{%
137 \tlcNote: \tlcA\ ignores \tlcVE\ when \tlcHF\ is defined.
138 }%
139
140
141
142 % ------------------------------------------------------------------------------
143 \subsubsection*{Header}
144 \begin{description}
145 \item[lhead] When \tlcLG\ is found, logo.
146 \item[chead] Document Title
147 \item[rhead] When \tlcVE\ is present, status, date, and version columns.
148 \end{description}
149
150 % ------------------------------------------------------------------------------
151 \subsubsection*{Footer}
152 \begin{description}
153 \item[lfoot] When \tlcVE\ is present, institution column.
154 \item[cfoot] When \tlcVE\ is present, permission column.
155 \item[rfoot] Page 1 of N.
156 \end{description}
157
158 % ------------------------------------------------------------------------------
159 \subsubsection*{Rule width}
160 A 0.1pt rule width is placed below the document header and above the document
161 footer.
162
163 % ------------------------------------------------------------------------------
164 \clearpage
165 \section{Customization}
166 This section describes how \tlcA\ can be customized by using the file-hooks
167 \tlcA\ check for. \tlcA\ default implementation will be used when the
168 file-hooks are not found.
169
170 \bigskip
171
172 \todo[inline]{%
173 \tlcNote: \tlcA\ consumes \tlcAL\ \& \tlcHF\ during the preamble compilation
174 phase.
175 }%
176
177 % ------------------------------------------------------------------------------
178 \subsection{\tlcAL}
179 \tlcA\ will use whatever \LaTeX\ definitions are found in \tlcAL\ when it
180 exists. The file-check is shown
181 below:
182
183 \begin{lstlisting}[basicstyle=\tiny]
184 \IfFileExists{data/additional-layout.tex}
185 {\input{data/additional-layout.tex}}
186 {}
187 \end{lstlisting}
188
189 % ------------------------------------------------------------------------------
190 \subsection{\tlcHF}
191 In the absence of \tlcAL\, \tlcA\ has a builtin header and footer strategy that
192 is base on \textit{fancyhdr}, \textit{titling}, and \textit{lastpage} \LaTeX\
193 packages. The default implementation is show below:
194
195 \begin{lstlisting}[basicstyle=\tiny]
196 \IfFileExists{\tlc@headerFooter}%
197 { % use the customer header and footer defined by \tlc@headerfooter
198 \input{\tlc@headerFooter}%
199 }%
200 { % Else : header and footer applied to all pages.
201 \IfFileExists{\tlc@logoFile}%
202 { % Typeset the logo in the left side of the document header.
203 \lhead{\includegraphics[width=3cm,height=1cm]{\tlc@logoFile}}%
204 }%
205 {% Else: no operation because tlc@logoFile does not exist.
206 }%
207 %
208 % Typeset the title in the center of the document header.
209 %
210 \chead{\large{\thetitle}}%
211 %
212 % Typeset version information in the right side of the document header.
213 %
214 \IfFileExists{\tlc@versionFile}%
215 {%
216 % document status, document date and document version.
217 \rhead{\tiny \tlc@status \\ \tlc@date \\ \tlc@version}%
218 % document owner. This maybe a person or company name.
219 \lfoot{\tiny \tlc@institution}%
220 % document license. This maybe a license or word like confidential.
221 \cfoot{\tiny \tlc@permission}%
222 }%
223 {% Else: no operation because tlc@versionFile does not exist.
224 }%
225 \renewcommand{\headrulewidth}{0.1pt}%
226 % Eliminate head height too small warning, which is occurring because
227 % we are using multiple lines in our header.
228 \setlength\headheight{34.0pt}%
229 % footer applied to all pages.
230 \rfoot{\tiny{Page \thepage~of~\pageref{LastPage}}}%
231 \renewcommand{\footrulewidth}{0.1pt}%
232 }%
233 \end{lstlisting}
234
235 The default implementation can be overridden by defining \tlcHF.
236
237 \tlcVspace
238
239 \todo[inline]{%
240 \tlcNote: When \tlcHF\ exists and is empty, your document will be typeset with
241 the defaults from document-class \tlcDarkblue{article}.
242 }%
243
244 % ------------------------------------------------------------------------------
245 \clearpage
246 \subsection{\tlcVE} \label{sec:version}
247 \tlcA\ will populate the builtin header and footer with information extracted
248 from \tlcVE\ when it is present. \tlcVE\ is a comma-separated-variable file
249 that uses the pipe character as the field delimiter. \tlcVE\ uses the following
250 column names:
251
252 \begin{description}[style=nextline]
253 \item[version] The version value is typeset in the rhead area. This field is
254 used to convey the version the document was at the date it reached its
255 current state.
256
257 \item[date] The date value is typeset in the rhead area. This field is used
258 to communicate when the document transitioned into its current state.
259
260 \item[status] The status value is typeset in the rhead area. This field is
261 used to convey the document state such as Approved, Draft, Effective, or
262 Obsolete.
263
264 \item[instatution] The institution value is typeset in the lfoot area. This
265 field is used to tell the reader the author name or company name.
266
267 \item[permission] The permission value is typeset in the cfoot area. This
268 field is used to identify confidentiality or a particular license.
269
270 \end{description}
271
272 The exaction methods are shown below.
273 \begin{lstlisting}[basicstyle=\tiny]
274 % Extract document status, document date and document version from
275 % \tlc@versionFile.
276 % Argument:
277 % 1 - the column name to extract from the data file.
278 \newcommand{\tlcVersionPart}[1]{
279 \csvreader[separator=pipe]
280 {\tlc@versionFile}{
281 1=\version,
282 2=\date,
283 3=\status,
284 4=\instatution,
285 5=\permission
286 }{#1}
287 }%
288
289 % Define extractions macros when \tlc@versionFile exists.
290 \IfFileExists{\tlc@versionFile}
291 {
292 \def\tlc@version{\tlcVersionPart{\version}}
293 \def\tlc@date{\tlcVersionPart{\date}}
294 \def\tlc@status{\tlcVersionPart{\status}}
295 \def\tlc@instatution{\tlcVersionPart{\version}}
296 \def\tlc@permission{\tlcVersionPart{\version}}
297 }
298 {% Else: no operation because tlc@versionFile does not exist.
299 }
300 \end{lstlisting}
301
302 % ------------------------------------------------------------------------------
303 \subsection{\tlcLG}
304 \tlcA\ will typeset the lhead area with \tlcLG\ when it is present. Make sure
305 your logo's height is not larger than 34pt to avoid `Package Fancyhdr Warning:
306 \\headheight is to small' warning.
307
308 % ------------------------------------------------------------------------------
309 \clearpage
310 \section{Definitions \& Commands}
311 \subsection{\tlcBL}
312 Page layout is rotated 90\textdegree\ clockwise resulting in a landscape page
313 orientation. Landscape orientation remains active until \tlcEL.
314
315 % ------------------------------------------------------------------------------
316 \subsection{\tlcEL}
317 Page layout is returned to portrait orientation when \tlcEL\ is reached.
318
319 % ------------------------------------------------------------------------------
320 \subsection{\tlcDB}
321 \tlcDB\ is used throughout this document to render text using rbg\{0,0,0.5\}.
322 \tlcDB\ is safe to use within your document.
323
324 % ------------------------------------------------------------------------------
325 \subsection{\tlcTOC}
326 \tlcTOC\ creates the document layout shown in Figure \ref{fig:layout}. Section
327 \ref{sec:TAA} shows an example implementation.
328
329 % ------------------------------------------------------------------------------
330 \subsection{\tlcNCT}
331 New \tlcNCT\ are Left, Center, and Right, respectively are
332 designed to use with longtable. Data is wrapped within a table cell. The
333 parameter defines the column width. As an example, L{2cm} yields a Left
334 aligned, ragged right, wrapped text within a 2cm wide cell.
335
336 \begin{lstlisting}[basicstyle=\tiny]
337 \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash}p{#1}}
338 \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash}p{#1}}
339 \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash}p{#1}}
340 \end{lstlisting}
341
342 % ------------------------------------------------------------------------------
343 \subsection{\tlcAL}
344 \tlcAL\ is an architectural hook the Author should use when it becomes necessary
345 to use packages not provided by \tlcA\, and to design commands that are specific
346 to your document.
347
348 % ------------------------------------------------------------------------------
349 \subsection{\tlcHF}
350 \tlcHF\ is an architectural hook the Author should use to completely override
351 the document layout \tlcA\ implements.
352
353 % ------------------------------------------------------------------------------
354 \clearpage
355 \subsection{\tlcVE}
356 \tlcVE\ is by used \tlcA\ to populate the document header \& footer. Refer to
357 section \ref{sec:version} for \tlcVE\ definitions. \tlcVE\ is not
358 used by \tlcA\ when \tlcHF\ is define. However, you might want to use the
359 version hook by defining \tlcVE\ and using the commands below to extract data
360 from \tlcVE\ in your \tlcHF.
361 \begin{enumerate}
362 \item \tlcVC\
363 \item \tlcDC\
364 \item \tlcSC\
365 \item \tlcIC\
366 \item \tlcPC\
367 \end{enumerate}
368
369 % ------------------------------------------------------------------------------
370 \subsection{\tlcLG}
371 \tlcA\ places \tlcLG\ in your header when defined.
372
373 % ------------------------------------------------------------------------------
374 \clearpage
375 \section{Required Packages}
376 This section documents the dependencies of the required package tlc-article has.
377 Package names are listed in alphabetical order. A complete description of each
378 package is found at \url{http://www.ctan.org/}. At this writing, you can type in
379 the package name and press the search button to learn more about each package.
380
381 % Render pckFile using pckStyle as a longtable.
382 \csvreader[tlcPkgStyle, separator=pipe]{\tlcPkgFile}{}{\name & \description}
383 % ------------------------------------------------------------------------------
384
385 \end{document}