Articles I've written for customers on IT issues.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1928 lines
57 KiB

4 years ago
  1. % \iffalse
  2. % $Id: erdc.dtx,v 1.31 2009-07-24 19:46:11 boris Exp $
  3. %
  4. % Copyright 2008, Boris Veytsman
  5. % This work may be distributed and/or modified under the
  6. % conditions of the LaTeX Project Public License, either
  7. % version 1.3 of this license or (at your option) any
  8. % later version.
  9. % The latest version of the license is in
  10. % http://www.latex-project.org/lppl.txt
  11. % and version 1.3 or later is part of all distributions of
  12. % LaTeX version 2005/12/01 or later.
  13. %
  14. % This work has the LPPL maintenance status `maintained'.
  15. %
  16. % The Current Maintainer of this work is Boris Veytsman,
  17. % <borisv@lk.net>
  18. %
  19. % This work consists of the file erdc.dtx and the
  20. % derived file erdc.cls
  21. %
  22. % \fi
  23. % \CheckSum{1374}
  24. %
  25. %
  26. %% \CharacterTable
  27. %% {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
  28. %% 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
  29. %% Digits \0\1\2\3\4\5\6\7\8\9
  30. %% Exclamation \! Double quote \" Hash (number) \#
  31. %% Dollar \$ Percent \% Ampersand \&
  32. %% Acute accent \' Left paren \( Right paren \)
  33. %% Asterisk \* Plus \+ Comma \,
  34. %% Minus \- Point \. Solidus \/
  35. %% Colon \: Semicolon \; Less than \<
  36. %% Equals \= Greater than \> Question mark \?
  37. %% Commercial at \@ Left bracket \[ Backslash \\
  38. %% Right bracket \] Circumflex \^ Underscore \_
  39. %% Grave accent \` Left brace \{ Vertical bar \|
  40. %% Right brace \} Tilde \~}
  41. %
  42. %\iffalse
  43. % Taken from xkeyval.dtx and amsdtx.dtx
  44. %\fi
  45. %\makeatletter
  46. %\def\DescribeOption#1{\leavevmode\@bsphack
  47. % \marginpar{\raggedleft\PrintDescribeOption{#1}}%
  48. % \SpecialOptionIndex{#1}\@esphack\ignorespaces}
  49. %\def\PrintDescribeOption#1{\strut\emph{option}\\\MacroFont #1\ }
  50. %\def\SpecialOptionIndex#1{\@bsphack
  51. % \index{#1\actualchar{\protect\ttfamily#1}
  52. % (option)\encapchar usage}%
  53. % \index{options:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar
  54. % usage}\@esphack}
  55. %\def\DescribeOptions#1{\leavevmode\@bsphack
  56. % \marginpar{\raggedleft\strut\emph{options}%
  57. % \@for\@tempa:=#1\do{%
  58. % \\\strut\MacroFont\@tempa\SpecialOptionIndex\@tempa
  59. % }}\@esphack\ignorespaces}
  60. % \def\cls#1{\texttt{#1}}
  61. % \def\cs#1{\textbackslash\texttt{#1}}
  62. % \let\cn\cs
  63. %\makeatother
  64. % \newcommand{\progname}[1]{\textsf{#1}}
  65. %
  66. % \MakeShortVerb{|}
  67. % \GetFileInfo{erdc.dtx}
  68. % \title{\LaTeX{} Style For Technical Information
  69. % Reports of the Engineer Research and
  70. % Development Center
  71. % \thanks{\copyright 2009, Boris Veytsman}}
  72. % \author{Boris Veytsman\thanks{%
  73. % \href{mailto:borisv@lk.net}{\texttt{borisv@lk.net}},
  74. % \href{mailto:boris@varphi.com}{\texttt{boris@varphi.com}}}}
  75. % \date{\filedate, \fileversion}
  76. % \maketitle
  77. % \begin{abstract}
  78. % This package provides class for typesetting Technical Information
  79. % Reports of the Engineer Research and Development Center, US Army
  80. % Corps of Engineers.
  81. % \end{abstract}
  82. % \tableofcontents
  83. %
  84. % \clearpage
  85. % \changes{v0.1}{2009/03/20}{First fully functional version}
  86. % \changes{v1.0}{2009/07/22}{Bug fixes}
  87. % \changes{v1.1}{2009/07/22}{Documentation Update}
  88. %
  89. %\section{Introduction}
  90. %\label{sec:intro}
  91. %
  92. % Technical publications for Engineer Research and Development Center,
  93. % US Army Corps of Engineers follow an elaborate
  94. % style~\cite{ERDC_Guide}. This style is accompanied by templates for
  95. % a popular word processor software. In this class, commissioned by US
  96. % Army Corps of Engineers, we try to recreate this style for \LaTeX.
  97. %
  98. % There are several kinds of documents described by~\cite{ERDC_Guide}:
  99. % Technical Report, Technical Note, Miscellaneous Paper, Contract
  100. % Report, Letter Report, Monograph, Special Report, Brochure. In this
  101. % class we follow the guidelines for Technical Reports (TR). However,
  102. % it can be used for other kinds of documents as long as they do not
  103. % differ much from Technical Reports.
  104. %
  105. %
  106. %\section{User Guide}
  107. %\label{sec:user_guide}
  108. %
  109. %
  110. %
  111. %\subsection{Installation}
  112. %\label{sec:ug_install}
  113. %
  114. % The class uses a number of \LaTeX{} packages. Normally they should be
  115. % present in any up-to-date distribution. If you do not have them,
  116. % you can download them using the links below prior to using the class.
  117. %
  118. % You will need \progname{mathgifg}~\cite{Mathgifg}: the
  119. % \LaTeX{} package providing the access to Microsoft Georgia and ITC
  120. % Franklin Gothic.
  121. % Of course you will need the fonts themselves. You will also need
  122. % \progname{graphics} bundle~\cite{Carlisle05:Graphics}, packages
  123. % \progname{geometry}~\cite{Umeki08:Geometry},
  124. % \progname{caption}~\cite{Sommerfeldt07:Caption},
  125. % \progname{ragged2e}~\cite{Schroeder03:Ragged2e},
  126. % \progname{longtable}~\cite{Carlisle04:Longtable},
  127. % \progname{dcolumn}~\cite{Carlisle01:Dcolumn}.
  128. % \progname{fancyhdr}~\cite{Oostrum04:Fancyhdr},
  129. % \progname{natbib}~\cite{Daly07:Natbib} and
  130. % \progname{amsmath}~\cite{amsldoc}.
  131. %
  132. %
  133. % The installation of the class follows the usual
  134. % practice~\cite{TeXFAQ} for \LaTeX{} packages:
  135. % \begin{enumerate}
  136. % \item Run \progname{latex} on |erdc.ins|. This will produce the
  137. % \LaTeX{} class |erdc.cls|.
  138. % \item Put the files |erdc.cls|, |red_corps_castle2.eps| and
  139. % |red_corps_castle2.pdf| to the place where \LaTeX{} can find it
  140. % (see \cite{TeXFAQ} or the documentation for your \TeX{}
  141. % system).\label{item:install}
  142. % \item Update the database of file names. Again, see \cite{TeXFAQ}
  143. % or the documentation for your \TeX{} system for the system-specific
  144. % details.\label{item:update}
  145. % \item The file |erdc.pdf| provides the documentation for the
  146. % package (this is the file you are probably reading now).
  147. % \end{enumerate}
  148. % As an alternative to items~\ref{item:install} and~\ref{item:update}
  149. % you can just put the file |erdc.cls| in the working directory
  150. % where your |.tex| file is.
  151. %
  152. %
  153. %\subsection{Invocation}
  154. %\label{sec:ug_invocation}
  155. %
  156. % To use the class, put in the preamble of your document
  157. % \begin{flushleft}
  158. % |\documentclass[|\meta{options}|]{erdc}|
  159. % \end{flushleft}
  160. %
  161. % The class should work both with |latex| and |pdflatex| work flows.
  162. % Accordingly it is supplied with US Army Corps of Engineers in both
  163. % EPS and PDF formats.
  164. %
  165. %
  166. % The class recoginzes the standard \LaTeX{} options, shared by the
  167. % most document classes~\cite{Lamport94}.
  168. % \DescribeOptions{8pt,9pt,10pt,11pt,12pt} The default font size
  169. % changing options (|8pt|, |9pt|, \dots, |12pt|) have no effect other
  170. % than producing a warning in the log since the font sizes of the
  171. % class are fixed by the guidelines~\cite{ERDC_Guide}.
  172. %
  173. %
  174. %\subsection{Front Matter}
  175. %\label{sec:ug_frontmatter}
  176. %
  177. % \DescribeMacro{\frontmatter}.
  178. % The command |\frontmatter| starts the \emph{Front Matter} of the
  179. % document. This part includes title page, table of contents, list of
  180. % figures, list of tables.
  181. %
  182. % \DescribeMacro{\laboratory}
  183. % The cover page of the Technical Report should have the center name
  184. % for Center-level reports or laboratory name for laboratory level
  185. % reports. By default a technical report is assumed to be a
  186. % Center-level one, and the center name (Engineering Research and
  187. % Development Center) is printed in the cover page. The macro
  188. % |\laboratory|\marg{Laboratory Name} overrides this default, for example:
  189. % \begin{verbatim}
  190. % \laboratory{Cold Regions Research and Engineering Laboratory}
  191. % \end{verbatim}
  192. % A line break command |\\| can be used inside this command to achieve
  193. % a desirable line break in the laboratory name if the automatic one
  194. % is not right.
  195. %
  196. %
  197. % \DescribeMacro{\reportnum}
  198. % The command |\reportnum|\marg{Report Number} is used to store the
  199. % project number. For example,
  200. % \begin{verbatim}
  201. % \reportnum{ERDC/CRREL SR-05-78}
  202. % \end{verbatim}
  203. % The report number should include the laboratory abbreviation as its
  204. % prefix.
  205. %
  206. % \DescribeMacro{\program}
  207. % The command |\program|\marg{Program Title} is used to store the
  208. % title of the program. For example,
  209. % \begin{verbatim}
  210. % \program{Military Engineering Technology}
  211. % \end{verbatim}
  212. %
  213. % \DescribeMacro{\title} The command |\title| is used to store project
  214. % name: |\title|\marg{Title}. For example:
  215. % \begin{verbatim}
  216. % \title{A New Project}
  217. % \end{verbatim}
  218. %
  219. % \DescribeMacro{\subtitle}
  220. % The command |\subtitle|\marg{Sub Title} us used to store the project
  221. % subtitle. For example,
  222. % \begin{verbatim}
  223. % \subtitle{Model Investigation}
  224. % \end{verbatim}
  225. %
  226. % \DescribeMacro{\date}
  227. % The macro |\date| stores the date of the document, for example
  228. % \begin{verbatim}
  229. % \date{March 2009}
  230. % \end{verbatim}
  231. %
  232. %
  233. % \DescribeMacro{\author}
  234. % \DescribeMacro{\affiliation}
  235. % \DescribeMacro{\and}
  236. % The macro |\author|\marg{Authors} stores the
  237. % names of authors that share the same affiliation. The authors with
  238. % the same affiliation
  239. % should be listed in the same |\author| macro, separated by the
  240. % keyword |\and|. Do not put commas and the word ``and'' between the
  241. % authors' names: \LaTeX{}
  242. % will take care of the proper punctuation. The macro
  243. % |\affiliation|\marg{Affiliation} stores the affiliation of the
  244. % authors immediately preceding this command. If a report is prepared
  245. % by several laboratories, or a laboratory and an outside contractor,
  246. % then you should list the authors with the same affiliation, then
  247. % show the affiliation, then repeat for the next affiliation. For example:
  248. % \begin{verbatim}
  249. % \author{A. U. Thor \and C. O. R. Respondent \and C. O. Author}
  250. % \affiliation{Construction Engineering Research Laboratory\\
  251. % U.S. Army Engineer Research and Development Center\\
  252. % 2902 Newmark Drive\\
  253. % Champaign, IL 61826-9005}
  254. % \author{John M. Smith}
  255. % \affiliation{Coastal and Hydraulics Laboratory\\
  256. % U.S. Army Engineer Research and Development Center\\
  257. % 3909 Halls Ferry Road\\
  258. % Vicksburg, MS 39180-6199}
  259. % \end{verbatim}
  260. % Note that the guidelines~\cite{ERDC_Guide} do not say how to typeset
  261. % the authors that have several affiliations. Accordingly we do not
  262. % deal with this case here.
  263. %
  264. % \DescribeMacro{\coverart}
  265. % It is recommended to put some artwork on the cover of the title
  266. % page. It is set up by
  267. % the command |\coverart[|\meta{options}|]|\marg{file}. The syntax of the
  268. % command is the same as the syntax of the command |\includegraphics|
  269. % of the \progname{graphicx} package~\cite{Carlisle05:Graphics}. The
  270. % obligatory argument \marg{file} is the name of the graphics file
  271. % with the logo, and \oarg{options}, if present, may, for example, set
  272. % the dimensions of the graphics. By default the graphics is scaled
  273. % to cover the full width of the page. Note that our class uses the
  274. % ``extended'' version \progname{graphicx} of the package with its
  275. % ``key-value'' syntax. For example,
  276. % \begin{verbatim}
  277. % \coverart[width=2in]{red_corps_castle2.eps}
  278. % \end{verbatim}
  279. % The format of the graphics file depends on the \TeX{} engine used.
  280. % If you use
  281. % \progname{latex}$\to$\progname{dvips}$\to$\progname{pstopdf} route,
  282. % then you need PostScript files (PS or EPS). If you use
  283. % \progname{pdflatex} engine, then you need graphics files in JPEG,
  284. % PNG or PDF formats (see~\cite{TeXFAQ} for more information).
  285. %
  286. %
  287. % \DescribeMacro{\reporttype}
  288. % The type of the report is stored in the macro
  289. % |\reporttype|\marg{type}, for example:
  290. % \begin{verbatim}
  291. % \reporttype{Final Report}
  292. % \end{verbatim}
  293. %
  294. % \DescribeMacro{\distribution}
  295. % All reports should have a distribution statement. There are several
  296. % standard distribution statements, approved by Department of Defense
  297. % Directive~5230.24~\cite{DoD5230.24}. By default the reports have
  298. % Statement~A: \emph{Approved for public release; distribution is
  299. % unlimited.} To change the default, use the macro
  300. % |\distribution|\marg{Distribution Statement}, for example
  301. % \begin{verbatim}
  302. % \distribution{Distribution authorized to U.S. Government Agencies
  303. % only; Test and Evaluation; November 2005. Other requests should be
  304. % referred to U.S. Army Engineer Research and Development Center}
  305. % \end{verbatim}
  306. %
  307. % \DescribeMacro{\preparedfor}
  308. % By default the reports have the phrase \emph{Prepared for U.S. Army
  309. % Corps of Engineers, Washington, DC 20314-1000} on the title page.
  310. % To change this designation, use the command |\preparedfor|, for
  311. % example,
  312. % \begin{verbatim}
  313. % \preparedfor{U.S. Army Engineer Research and Development Center\\
  314. % 3909 Halls Ferry Road, Vicksburg, MS 39180-6199}
  315. % \end{verbatim}
  316. % To delete this phrase altogether, use |\preparedfor{}|.
  317. %
  318. % \DescribeMacro{\contractnum}
  319. % Contract or work unit number is set by |\contractnum| command, for example
  320. % \begin{verbatim}
  321. % \contractnum{Work Unit 33143}
  322. % \end{verbatim}
  323. %
  324. % \DescribeMacro{\monitoredby}
  325. % Contract reports are monitored by a controlling laboratory. Its
  326. % name and address is set by this command, for example
  327. % \begin{verbatim}
  328. % \monitoredby{U.S. Army Engineer Research and Development Center\\
  329. % 3909 Halls Ferry Road, Vicksburg, MS 39180-6199}
  330. % \end{verbatim}
  331. %
  332. %
  333. %
  334. % \DescribeMacro{\additionalinfo}
  335. % The command |\additionalinfo|\marg{Additional Information} is used
  336. % to store additional information for the title page, for example,
  337. % \begin{verbatim}
  338. % \additionalinfo{Supercedes TR-2345-12345}
  339. % \end{verbatim}
  340. %
  341. % \DescribeMacro{abstract}
  342. % The abstract of the report is set using the environment |abstract|:
  343. % \begin{verbatim}
  344. % \begin{abstract}
  345. % This report disusses spins of electrons, protons and other
  346. % fermions.
  347. % \end{abstract}
  348. % \end{verbatim}
  349. %
  350. % \DescribeMacro{\disclaimer}
  351. % By default all reports have the standard disclaimer. If its text
  352. % should be changed for any reason, use the macro
  353. % |\disclaimer|\marg{New Disclaimer}, for example
  354. % \begin{verbatim}
  355. % \disclaimer{The contents of this report are not to be used for
  356. % advertising, publication, or promotional purposes. Citation of trade
  357. % names does not constitute an official endorsement or approval of the
  358. % use of such commercial products. All product names and trademarks
  359. % cited are the property of their respective owners. The findings of
  360. % this report are not to be construed as an official Department of the
  361. % Army position unless so designated by other authorized documents.
  362. %
  363. % \textbf{DESTROY THIS REPORT WHEN NO LONGER NEEDED. DO NOT RETURN IT
  364. % TO THE ORIGINATOR.}}
  365. % \end{verbatim}
  366. %
  367. %
  368. % \DescribeMacro{\maketitle}
  369. % The command |\maketitle| typesets the cover page, title page and
  370. % abstract page
  371. % of the report based on the data supplied by the macros above. It
  372. % should therefore be issued \emph{after} these macros.
  373. %
  374. %
  375. % \DescribeMacro{\tableofcontents}
  376. % \DescribeMacro{\listoffigures}
  377. % \DescribeMacro{\listoftables}
  378. % \DescribeMacro{\listoffiguresandtables}
  379. % Table of contents is typeset with
  380. % the usual \LaTeX{} command~\cite{Lamport94} |\tableofcontents|.
  381. % This situation with the list of tables and the list of figures is
  382. % slightly more involved. The guidelines~\cite{ERDC_Guide} require
  383. % the authors to combine the lists into the common list called
  384. % ``Figures and Tables'', which is subdivided into Figures and
  385. % Tables. The heading of this joint list is a chapter heading, while
  386. % the headings of the sublists are on the section level. However, the
  387. % guidelines say nothing about the situation where a report has only
  388. % figures or only tables. Therefore we chose the following solution:
  389. % \begin{enumerate}
  390. % \item If you have \emph{both} figures and tables, use
  391. % |\listoffiguresandtables|. It will automatically typeset both
  392. % lists according to the requirements~\cite{ERDC_Guide}
  393. % \item If you have \emph{only} figures or \emph{only} tables, use either
  394. % |\listoffigures| or |\listoftables| correspondingly. In this case
  395. % the heading will be typeset on the chapter level.
  396. % \item If you have neither (probably a rare situation), do not use
  397. % any of these commands.
  398. % \end{enumerate}
  399. %
  400. % \DescribeMacro{\chapter}
  401. % In the front matter the command |\chapter| produces an
  402. % \emph{unnumbered} chapter, so the commands |\chapter{Preface}| and
  403. % |\chapter*{Preface}| give the same result (see also
  404. % Section~\ref{sec:ug_mainmatter} below).
  405. %
  406. %
  407. %\subsection{Main Matter}
  408. %\label{sec:ug_mainmatter}
  409. %
  410. % \DescribeMacro{\mainmatter}
  411. % The main matter starts with the macro |\mainmatter|. The text is
  412. % divided into chapters, sections and subsections in the usual
  413. % \LaTeX{} manner.
  414. % All familiar \LaTeX{} commands and packages should work without
  415. % problems. Note that unlike articles, reports have chapters as the
  416. % highest subdivisions. The chapters are numbered, while sections and
  417. % subsections are not.
  418. %
  419. % \DescribeMacro{\chapter}
  420. % \DescribeMacro{\chapter*}
  421. % One important difference between the standard \LaTeX{} and our class
  422. % is the following. In standard \LaTeX{} the starred command
  423. % |\chapter*| produces an unnumbered chapter, that does not go into
  424. % the table of contents. In our class \emph{all} chapters, numbered
  425. % or not, go into the table of contents.
  426. %
  427. % Tables should have the caption \emph{above} the tabular material
  428. % rather than below it as in standard \LaTeX. The class automatically
  429. % sets the proper spacing for this arrangement, but it is the user's
  430. % responsibility to put the |\caption| command before the |tabular|
  431. % environment, for example
  432. % \begin{verbatim}
  433. % \begin{table}
  434. % \centering
  435. % \caption{Yearly Dividens}
  436. % \label{tab:dividends}
  437. % \footnotesize\sffamily
  438. % \begin{tabular}{||l|D{.}{.}{2.2}||}
  439. % \hline\hline
  440. % \textbf{Year} & \multicolumn{1}{|c||}{\textbf{Dividends, \%}}\\
  441. % \hline\hline
  442. % $1880$ & 2.50 \\
  443. % \hline
  444. % $1881$ & 12.1 \\
  445. % \hline
  446. % $1882$ & 2.6 \\
  447. % \hline\hline
  448. % \end{tabular}
  449. % \end{table}
  450. % \end{verbatim}
  451. % Note that the guidelines~\cite{ERDC_Guide} recommend excessive rules
  452. % in the tables, with borders around the cells, as shown in the
  453. % example above. This is usually frowned upon in the good typesetting
  454. % practice.
  455. %
  456. % The guidelines~\cite{ERDC_Guide} recommend use footnotesize sans
  457. % serif entries in the tables itself. The class does \emph{not} do
  458. % this automatically: the users should put |\footnotesize\sffamily|
  459. % before |\begin{tabular}|, as shown in the example above.
  460. %
  461. % The guidelines require the centering of numerical columns on decimal
  462. % point. The class automatically loads \progname{dcolumn} package, so
  463. % to get aligned columns use the special column designator
  464. % |D{.}{.}|\marg{n.m} where $n$ and $m$ are the numbers of decimal
  465. % points before and after the dot correspondingly. It is possible to
  466. % achieve other effects with this package like centering on the
  467. % multiplication sign; see the
  468. % documentation~\cite{Carlisle01:Dcolumn} for further information.
  469. %
  470. % \DescribeMacro{\fbox}
  471. % The guidelines~\cite{ERDC_Guide} require the graphics to be
  472. % surrounded by a hairline box. This is done by the standard |\fbox|
  473. % command, for example
  474. % \begin{verbatim}
  475. % \begin{figure}
  476. % \centering
  477. % \fbox{\includegraphics[width=3in]{plot}}
  478. % \caption{Plot of $f(x)$}
  479. % \label{fig:plot}
  480. % \end{figure}
  481. % \end{verbatim}
  482. %
  483. % The guidelines~\cite{ERDC_Guide} require equations to be
  484. % individually centered.
  485. % This probably precludes the use of |eqnarray| environment and such
  486. % \progname{amsmath} constructions as |align|, |aligned|, |alignedat|
  487. % etc.
  488. %
  489. %
  490. %
  491. %\subsection{Back Matter}
  492. %\label{sec:ug_backmatter}
  493. %
  494. % \DescribeMacro{\appendix}
  495. % Back matter in ERDC reports consists of
  496. % the bibliography, appendices and distribution forms. The standard
  497. % \LaTeX{} command |\appendix| changes the numeration of chapters
  498. % according to the rules~\cite{ERDC_Guide}. It should be issued after
  499. % the bibliography, but before the appendices.
  500. %
  501. %
  502. % The reports should contain Form~298 (see, for example,
  503. % \url{http://www.ntis.gov/pdf/rdpform.pdf}). This form should be
  504. % typeset separately.
  505. %
  506. %\StopEventually{%
  507. %
  508. %\subsection{Acknowledgements}
  509. %\label{sec:ack}
  510. %
  511. % The class was commissioned and paid for by US Army Corps of
  512. % Engineers, Engineer Research and Development Center, 3909 Halls
  513. % Ferry Road, Vicksburg, MS 39180-6199.
  514. %
  515. % I am grateful to Gordon L. Cohen, ERDC-ITL-IL for the detailed
  516. % explanations of the ERDC guidelines, to Christopher E. Kees,
  517. % ERDC-CHL-MS and Ryan E. North, ERDC-GSL-MS, for the formatting
  518. % suggestions and the patient
  519. % recompilation of the reports with each new version of the style.
  520. %
  521. % \clearpage
  522. % \bibliography{erdc}
  523. % \bibliographystyle{unsrt}}
  524. % \clearpage
  525. %\section{Implementation}
  526. %\label{sec:impl}
  527. %
  528. %\subsection{Identification}
  529. %\label{sec:ident}
  530. %
  531. % We start with the declaration who we are. Most |.dtx| files put
  532. % driver code in a separate driver file |.drv|. We roll this code into the
  533. % main file, and use the pseudo-guard |<gobble>| for it.
  534. % \begin{macrocode}
  535. %<class>\NeedsTeXFormat{LaTeX2e}
  536. %<*gobble>
  537. \ProvidesFile{erdc.dtx}
  538. %</gobble>
  539. %<class>\ProvidesClass{erdc}
  540. [2009/07/22 v1.1 Typesetting Technical Information Reports of
  541. the Engineer Research and Development Center (ERDC),
  542. US Army Corps of Engineers]
  543. % \end{macrocode}
  544. %
  545. % And the driver code:
  546. % \begin{macrocode}
  547. %<*gobble>
  548. \documentclass{ltxdoc}
  549. \usepackage{array}
  550. \usepackage{url,amsfonts}
  551. \usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,
  552. pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}
  553. \PageIndex
  554. \CodelineIndex
  555. \RecordChanges
  556. \EnableCrossrefs
  557. \begin{document}
  558. \DocInput{erdc.dtx}
  559. \end{document}
  560. %</gobble>
  561. %<*class>
  562. % \end{macrocode}
  563. %
  564. %
  565. %\subsection{Options}
  566. %\label{sec:options}
  567. %
  568. % \begin{macro}{\erdc@size@warning}
  569. % The font-changing options are not used in our setup, so we just
  570. % produce a warning:
  571. % \begin{macrocode}
  572. \long\def\erdc@size@warning#1{%
  573. \ClassWarning{erdc}{Size-changing option #1 will not be
  574. honored}}%
  575. \DeclareOption{8pt}{\erdc@size@warning{\CurrentOption}}%
  576. \DeclareOption{9pt}{\erdc@size@warning{\CurrentOption}}%
  577. \DeclareOption{10pt}{\erdc@size@warning{\CurrentOption}}%
  578. \DeclareOption{11pt}{\erdc@size@warning{\CurrentOption}}%
  579. \DeclareOption{12pt}{\erdc@size@warning{\CurrentOption}}%
  580. % \end{macrocode}
  581. % \end{macro}
  582. %
  583. % All other options are just sent to the main class:
  584. % \begin{macrocode}
  585. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
  586. \ProcessOptions\relax
  587. % \end{macrocode}
  588. %
  589. %\subsection{Loading Class and Packages}
  590. %\label{sec:loading}
  591. %
  592. % We start with the base class and some packages
  593. % \begin{macrocode}
  594. \LoadClass[12pt,twoside]{report}
  595. \RequirePackage{graphicx,color,caption,longtable}
  596. % \end{macrocode}
  597. %
  598. %
  599. % \changes{v0.2}{2009/07/07}{Added dcolumn}
  600. % We use \progname{dcolumn} for dot-centered columns:
  601. % \begin{macrocode}
  602. \RequirePackage{dcolumn}
  603. % \end{macrocode}
  604. %
  605. % \changes{v0.3}{2009/07/18}{Added natbib}
  606. % We use \progname{natbib}~\cite{Daly07:Natbib} for bibliography
  607. % formatting:
  608. % \begin{macrocode}
  609. \RequirePackage{natbib}
  610. \renewcommand{\bibfont}{\fontsize{10pt}{12pt}\selectfont}
  611. \setlength{\bibhang}{0.5in}
  612. \setlength{\bibsep}{12pt}
  613. % \end{macrocode}
  614. %
  615. % \changes{v0.3}{2009/07/18}{Added amsmath}
  616. % We load \progname{amsmath} since we want to change the equation
  617. % numbering scheme: \progname{amsmath} redefines it.
  618. % \begin{macrocode}
  619. \RequirePackage{amsmath}
  620. % \end{macrocode}
  621. %
  622. % \changes{v0.2}{2009/07/07}{Added ragged2e}
  623. % We do not want the option |document| with \progname{ragged2e}: this
  624. % calls \progname{footmisc}, while we want our own footnotes:
  625. % \begin{macrocode}
  626. \RequirePackage[originalcommands]{ragged2e}
  627. \setlength\RaggedRightParindent{\parindent}
  628. \RaggedRight
  629. % \end{macrocode}
  630. %
  631. %\subsection{Fonts}
  632. %\label{sec:fonts}
  633. %
  634. %\begin{macro}{\normalsize}
  635. % \changes{v0.2}{2009/07/07}{Changed line spacing}
  636. % The size is basically from~\cite{classes}, but with some changes
  637. % according to our fonts:
  638. % \begin{macrocode}
  639. \renewcommand\normalsize{%
  640. \@setfontsize\normalsize\@xiipt{16}%
  641. \abovedisplayskip 16\p@ \@plus3\p@ \@minus7\p@
  642. \abovedisplayshortskip \z@ \@plus3\p@
  643. \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
  644. \belowdisplayskip \abovedisplayskip
  645. \let\@listi\@listI}
  646. \normalsize
  647. % \end{macrocode}
  648. %\end{macro}
  649. %
  650. %
  651. % \changes{v0.2}{2009/07/07}{Changed fonts}
  652. %
  653. % We use Georgia for the main font, matching Franklin Gothic for
  654. % the sans serifed font, and Courier for the monospaced font:
  655. % \begin{macrocode}
  656. \usepackage{mathgifg}
  657. \usepackage{courier}
  658. % \end{macrocode}
  659. %
  660. % \begin{macro}{\@laboratoryfont}
  661. % \changes{v0.2}{2009/07/07}{Introduced the macro}
  662. % Font to typeset the laboratory on the cover
  663. % \begin{macrocode}
  664. \def\@laboratoryfont{%
  665. \sffamily\bfseries\fontsize{22pt}{25pt}\selectfont}
  666. % \end{macrocode}
  667. % \end{macro}
  668. %
  669. % \begin{macro}{\@reportnumfont}
  670. % \changes{v0.2}{2009/07/07}{Introduced the macro}
  671. % Font to typeset the report number on the cover
  672. % \begin{macrocode}
  673. \def\@reportnumfont{%
  674. \sffamily\bfseries\fontsize{18pt}{22pt}\selectfont}
  675. % \end{macrocode}
  676. % \end{macro}
  677. %
  678. %
  679. % \begin{macro}{\@programfont}
  680. % \changes{v0.2}{2009/07/07}{Introduced the macro}
  681. % \changes{v0.3}{2009/07/18}{Changhed weight to Book}
  682. % Font to typeset the program on the cover
  683. % \begin{macrocode}
  684. \def\@programfont{%
  685. \sffamily\fontseries{k}\itshape\normalsize\selectfont}
  686. % \end{macrocode}
  687. % \end{macro}
  688. %
  689. % \begin{macro}{\@titlefont}
  690. % \changes{v0.2}{2009/07/07}{Introduced the macro}
  691. % Font to typeset the title on the cover \emph{and} chapter numbers
  692. % \begin{macrocode}
  693. \def\@titlefont{%
  694. \sffamily\fontseries{h}\fontsize{20pt}{25pt}\selectfont}
  695. % \end{macrocode}
  696. % \end{macro}
  697. %
  698. % \begin{macro}{\@distributionfont}
  699. % \changes{v0.3}{2009/07/18}{Introduced the macro}
  700. % Font to typeset the distribution statement
  701. % \begin{macrocode}
  702. \def\@distributionfont{%
  703. \sffamily\fontseries{k}\fontsize{9pt}{11pt}\selectfont}
  704. % \end{macrocode}
  705. % \end{macro}
  706. %
  707. %
  708. % \begin{macro}{\@eqtagfont}
  709. % \changes{v0.3}{2009/07/18}{Introduced the macro}
  710. % The font for the equations
  711. % \begin{macrocode}
  712. \def\@eqtagfont{\sffamily\bfseries\footnotesize}
  713. % \end{macrocode}
  714. %
  715. % \end{macro}
  716. %
  717. %\subsection{Page Dimensions and Paragraphing}
  718. %\label{sec:page}
  719. %
  720. % \changes{v1.1}{2009/07/22}{Changed bottom margin to 0.7''}
  721. %
  722. % The requirements are 1.25'' (top), 0.7'' (bottom), 1.5'' (left), and
  723. % 1.5'' (right). However, we need to add for the headers.
  724. % \begin{macrocode}
  725. \RequirePackage[letterpaper, top=1in, bottom=0.7in,
  726. left=1.5in, right=1.5in]{geometry}
  727. % \end{macrocode}
  728. %
  729. %
  730. % \begin{macro}{\parindent}
  731. % The paragraphs have no indentation\dots
  732. % \begin{macrocode}
  733. \setlength{\parindent}{0pt}
  734. % \end{macrocode}
  735. % \end{macro}
  736. %
  737. % \begin{macro}{\parskip}
  738. % \dots and there is one baseline skip between paragraphs
  739. % \begin{macrocode}
  740. \setlength{\parskip}{\baselineskip}
  741. % \end{macrocode}
  742. % \end{macro}
  743. %
  744. % \begin{macro}{\labelwidth}
  745. % \changes{v1.1}{2009/07/22}{Changed defaults}
  746. % The width of label for enumerate and itemize environments
  747. % \begin{macrocode}
  748. \setlength\labelwidth{1em}
  749. % \end{macrocode}
  750. %
  751. % \end{macro}
  752. %
  753. %
  754. % \begin{macro}{\leftmargini}
  755. % \changes{v1.1}{2009/07/22}{Changed defaults}
  756. % We align lists with the body
  757. % \begin{macrocode}
  758. \setlength\leftmargini\z@
  759. \addtolength\leftmargini\labelwidth
  760. \addtolength\leftmargini\labelsep
  761. % \end{macrocode}
  762. %
  763. % \end{macro}
  764. %
  765. % \begin{macro}{\itemize}
  766. % \changes{v1.1}{2009/07/22}{Changed defaults}
  767. % We want left-aligned bullets:
  768. % \begin{macrocode}
  769. \def\itemize{%
  770. \ifnum \@itemdepth >\thr@@\@toodeep\else
  771. \advance\@itemdepth\@ne
  772. \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
  773. \expandafter
  774. \list
  775. \csname\@itemitem\endcsname
  776. {\def\makelabel##1{##1}}%
  777. \fi}
  778. % \end{macrocode}
  779. % \end{macro}
  780. %
  781. %
  782. % \begin{macro}{\enumerate}
  783. % \changes{v1.1}{2009/07/22}{Changed defaults}
  784. % We left-align numbers
  785. % \begin{macrocode}
  786. \def\enumerate{%
  787. \ifnum \@enumdepth >\thr@@\@toodeep\else
  788. \advance\@enumdepth\@ne
  789. \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
  790. \expandafter
  791. \list
  792. \csname label\@enumctr\endcsname
  793. {\usecounter\@enumctr\def\makelabel##1{##1}}%
  794. \fi}
  795. % \end{macrocode}
  796. % \end{macro}
  797. %
  798. %
  799. % \begin{macro}{\widowpenalty}
  800. % \begin{macro}{\clubpenalty}
  801. % \changes{v1.1}{2009/07/22}{Changed settings}
  802. % We forbid widows and clubs. To prevent too extended pages we use
  803. % |\raggedbottom|:
  804. % \begin{macrocode}
  805. \widowpenalty=10000
  806. \clubpenalty=10000
  807. \raggedbottom
  808. % \end{macrocode}
  809. %
  810. % \end{macro}
  811. % \end{macro}
  812. %
  813. %
  814. %\subsection{Headers and Footers}
  815. %\label{sec:headers}
  816. %
  817. % We use \progname{fancyhdr}:
  818. % \begin{macrocode}
  819. \RequirePackage{fancyhdr}
  820. % \end{macrocode}
  821. %
  822. %
  823. % \begin{macro}{\headrulewidth}
  824. % \changes{v0.3}{2009/07/18}{Chaneged thickness}
  825. % \begin{macro}{\footrulewidth}
  826. % Decorative rules:
  827. % \begin{macrocode}
  828. \renewcommand{\headrulewidth}{0.5pt}
  829. \renewcommand{\footrulewidth}{0pt}
  830. % \end{macrocode}
  831. % \end{macro}
  832. % \end{macro}
  833. % \begin{macro}{\fancyhfoffset}
  834. % Headers are wider than the text
  835. % \begin{macrocode}
  836. \fancyhfoffset{35pt}
  837. % \end{macrocode}
  838. %
  839. % \end{macro}
  840. %
  841. % We do not have headers:
  842. % \begin{macrocode}
  843. \pagestyle{fancy}
  844. \lhead{\textsf{\textbf{\footnotesize\@reportnum}}}
  845. \rhead{\textsf{\textbf{\footnotesize\thepage}}}
  846. \chead{}
  847. % \end{macrocode}
  848. %
  849. % We do not have footers:
  850. % \begin{macrocode}
  851. \lfoot{}
  852. \cfoot{}
  853. \rfoot{}
  854. % \end{macrocode}
  855. %
  856. %
  857. %
  858. %\subsection{Main Subdivisions}
  859. %\label{sec:subdivisions}
  860. %
  861. % \begin{macro}{\if@frontmatter}
  862. % The switch whether we are in the frontmatter
  863. % \begin{macrocode}
  864. \newif\if@frontmatter
  865. \@frontmatterfalse
  866. % \end{macrocode}
  867. % \end{macro}
  868. %
  869. % \begin{macro}{\if@appendix}
  870. % The switch whether we are in the appendix
  871. % \begin{macrocode}
  872. \newif\if@appendix
  873. \@appendixfalse
  874. % \end{macrocode}
  875. %
  876. % \end{macro}
  877. %
  878. % \begin{macro}{\frontmatter}
  879. % Starting front matter
  880. % \begin{macrocode}
  881. \def\frontmatter{%
  882. \pagenumbering{roman}%
  883. \@frontmattertrue
  884. \@appendixfalse}
  885. % \end{macrocode}
  886. % \end{macro}
  887. %
  888. %
  889. % \begin{macro}{\mainmatter}
  890. % Starting main matter
  891. % \begin{macrocode}
  892. \def\mainmatter{%
  893. \cleardoublepage
  894. \pagenumbering{arabic}%
  895. \@frontmatterfalse
  896. \@appendixfalse}
  897. % \end{macrocode}
  898. % \end{macro}
  899. %
  900. %
  901. % \begin{macro}{\appendix}
  902. % Start appendices
  903. % \begin{macrocode}
  904. \def\appendix{%
  905. \clearpage
  906. \@frontmatterfalse
  907. \@appendixtrue
  908. \@addtoreset{table}{chapter}%
  909. \@addtoreset{equation}{chapter}%
  910. \@addtoreset{figure}{chapter}%
  911. \setcounter{chapter}{0}%
  912. \setcounter{section}{0}%
  913. \gdef\@chapapp{\appendixname}%
  914. \gdef\thechapter{\@Alph\c@chapter}%
  915. \gdef\thefigure{\@Alph\c@chapter\@arabic\c@figure}%
  916. \gdef\thetable{\@Alph\c@chapter\@arabic\c@table}%
  917. \gdef\theequation{\@Alph\c@chapter\@arabic\c@equation}}
  918. % \end{macrocode}
  919. %
  920. % \end{macro}
  921. %
  922. %\subsection{Cover and Title Pages}
  923. %\label{sec:cover_title}
  924. %
  925. %
  926. %
  927. %
  928. % \begin{macro}{\laboratory}
  929. % This macro sets up the laboratory name:
  930. % \begin{macrocode}
  931. \def\laboratory#1{\gdef\@laboratory{#1}}
  932. \laboratory{Engineer Research and\\Development Center}
  933. % \end{macrocode}
  934. % \end{macro}
  935. %
  936. % \begin{macro}{\reportnum}
  937. % Report number:
  938. % \begin{macrocode}
  939. \def\reportnum#1{\gdef\@reportnum{#1}}
  940. \reportnum{ERDC TR-01-01}
  941. % \end{macrocode}
  942. % \end{macro}
  943. %
  944. % \begin{macro}{\program}
  945. % Program:
  946. % \begin{macrocode}
  947. \def\program#1{\gdef\@program{#1}}
  948. \program{}
  949. % \end{macrocode}
  950. % \end{macro}
  951. %
  952. %
  953. % \begin{macro}{\subtitle}
  954. % Subtitle:
  955. % \begin{macrocode}
  956. \newcommand{\subtitle}[1]{\gdef\@subtitle{#1}}
  957. \def\@subtitle{}
  958. % \end{macrocode}
  959. % \end{macro}
  960. %
  961. %
  962. % The author and affiliation processing follows the ideas
  963. % of~\cite{Downes04:amsart}. We lift most of the code from there.
  964. % \begin{quotation}
  965. % \em
  966. % The general function to convert a list of items in the form
  967. %\begin{verbatim}
  968. % A\and B\and C\and D
  969. %\end{verbatim}
  970. % to the form `A, B, C, and D' is \cs{xandlist}:
  971. %\begin{verbatim}
  972. % \xandlist{, }{ and }{, and }{A\and B\and C\and D}
  973. %\end{verbatim}
  974. % This is a completely expandable macro, with the return value being
  975. % the converted list. There is also a `no-execute' version whose
  976. % fourth argument should be a macro; the text to be converted will be
  977. % taken from that macro and after conversion will be put back as the
  978. % macro's new replacement text.
  979. %\begin{verbatim}
  980. % \nxandlist{, }{ and }{, and }\result
  981. %\end{verbatim}
  982. % I don't think I want to explain this except by recommending that
  983. % you watch it in operation with \cs{tracingmacros} if you're
  984. % interested. [mjd,1994/10/19]
  985. % \begin{macrocode}
  986. \newcommand{\xandlist}[4]{\@andlista{{#1}{#2}{#3}}#4\and\and}
  987. \def\@andlista#1#2\and#3\and{\@andlistc{#2}\@ifnotempty{#3}{%
  988. \@andlistb#1{#3}}}
  989. \def\@andlistb#1#2#3#4#5\and{%
  990. \@ifempty{#5}{%
  991. \@andlistc{#2#4}%
  992. }{%
  993. \@andlistc{#1#4}\@andlistb{#1}{#3}{#3}{#5}%
  994. }}
  995. \let\@andlistc\@iden
  996. \newcommand{\nxandlist}[4]{%
  997. \def\@andlistc##1{\toks@\@xp{\the\toks@##1}}%
  998. \toks@{\toks@\@emptytoks \@andlista{{#1}{#2}{#3}}}%
  999. \the\@xp\toks@#4\and\and
  1000. \edef#4{\the\toks@}%
  1001. \let\@andlistc\@iden}
  1002. % \end{macrocode}
  1003. %
  1004. % \begin{macro}{andify}
  1005. %
  1006. % The \cs{andify} function is provided as a convenient abbreviation
  1007. % for the most common case. See also \cs{author@andify} (for
  1008. % \cls{amsart} and \cls{amsproc} only), which gives better results
  1009. % in cases with a large number of authors. Provide a substitutable
  1010. % text string to simplify language-specific modifications.
  1011. % \begin{macrocode}
  1012. \def\@@and{and}
  1013. \newcommand{\andify}{%
  1014. \nxandlist{\unskip, }{\unskip{} \@@and~}{\unskip, \@@and~}}
  1015. % \end{macrocode}
  1016. % Override the funny default definition of \cn{and} from \LaTeX.
  1017. % This is not actually used by AMS classes, however.
  1018. % \begin{macrocode}
  1019. \def\and{\unskip{ }\@@and{ }\ignorespaces}
  1020. % \end{macrocode}
  1021. % \end{macro}
  1022. % \end{quotation}
  1023. % This requires some other AMS math macros:
  1024. % \begin{macrocode}
  1025. \let\@xp\expandafter\relax
  1026. \let\@nx=\noexpand
  1027. \def\@oparg#1[#2]{\@ifnextchar[{#1}{#1[#2]}}
  1028. \long\def\@ifempty#1{\@xifempty#1@@..\@nil}
  1029. \long\def\@xifempty#1#2@#3#4#5\@nil{%
  1030. \ifx#3#4\@xp\@firstoftwo\else\@xp\@secondoftwo\fi}
  1031. \long\def\@ifnotempty#1{\@ifempty{#1}{}}
  1032. \def\setboxz@h{\setbox\z@\hbox}
  1033. \def\@addpunct#1{%
  1034. \relax\ifhmode
  1035. \ifnum\spacefactor>\@m \else#1\fi
  1036. \fi}
  1037. \newtoks\@emptytoks
  1038. % \end{macrocode}
  1039. %
  1040. %
  1041. % \begin{macro}{\authors}
  1042. % The full authors lists
  1043. % \begin{macrocode}
  1044. \def\authors{}
  1045. % \end{macrocode}
  1046. % \end{macro}
  1047. %
  1048. % \begin{macro}{\addresses}
  1049. % The list of authors \emph{and} addresses
  1050. % \begin{macrocode}
  1051. \def\addresses{}
  1052. % \end{macrocode}
  1053. %
  1054. % \end{macro}
  1055. %
  1056. % \begin{macro}{\author}
  1057. % This also follows AMS ideas
  1058. % \begin{macrocode}
  1059. \def\author#1{%
  1060. \ifx\@empty\authors\gdef\authors{#1}\else
  1061. \g@addto@macro{\authors}{\and#1}\fi
  1062. \ifx\@empty\@addresses\gdef\addresses{\author{#1}}\else
  1063. \g@addto@macro{\addresses}{\par\author{#1}}\fi}
  1064. % \end{macrocode}
  1065. % \end{macro}
  1066. %
  1067. % \begin{macro}{\affiliation}
  1068. % And affiliation
  1069. % \begin{macrocode}
  1070. \def\affiliation#1{%
  1071. \ifx\@empty\@addresses\gdef\addresses{#1\par}\else
  1072. \g@addto@macro{\addresses}{#1\par\vspace{\baselineskip}}\fi}
  1073. % \end{macrocode}
  1074. %
  1075. % \end{macro}
  1076. %
  1077. % \begin{macro}{\today}
  1078. % We use only month and year in |\today|:
  1079. % \begin{macrocode}
  1080. \def\today{\ifcase\month\or
  1081. January\or February\or March\or April\or May\or June\or
  1082. July\or August\or September\or October\or November\or December\fi
  1083. \space \number\year}
  1084. % \end{macrocode}
  1085. % \end{macro}
  1086. %
  1087. % \begin{macro}{\coverart}
  1088. % \changes{v0.2}{2009/07/08}{Changed the width of cover art}
  1089. % The |\logo| command has the same format as |\includegraphics|. It
  1090. % actually sets up |\includegraphics| in |\maketitle|.
  1091. % \begin{macrocode}
  1092. \newcommand{\coverart}[2][]{%
  1093. \def\@tempa{#1}%
  1094. \ifx\@empty\@tempa
  1095. \gdef\@coverart{\includegraphics[width=435\p@]{#2}}\else
  1096. \gdef\@coverart{\includegraphics[#1]{#2}}\fi}
  1097. \def\@coverart{}%
  1098. % \end{macrocode}
  1099. % \end{macro}
  1100. %
  1101. % \begin{macro}{\reporttype}
  1102. % Type of the report
  1103. % \begin{macrocode}
  1104. \def\reporttype#1{\gdef\@reporttype{#1}}
  1105. \reporttype{}
  1106. % \end{macrocode}
  1107. % \end{macro}
  1108. %
  1109. %
  1110. % \begin{macro}{\distribution}
  1111. % Distribution of the report
  1112. % \begin{macrocode}
  1113. \def\distribution#1{\gdef\@distribution{#1}}
  1114. \distribution{Approved for public release; distribution is unlimited.}
  1115. % \end{macrocode}
  1116. % \end{macro}
  1117. %
  1118. % \begin{macro}{\preparedfor}
  1119. % The organization that ordered the report
  1120. % \begin{macrocode}
  1121. \def\preparedfor#1{\gdef\@preparedfor{#1}}
  1122. \preparedfor{U.S. Army Corps of Engineers\\ Washington, DC 20314-1000}
  1123. % \end{macrocode}
  1124. % \end{macro}
  1125. %
  1126. % \begin{macro}{\contractnum}
  1127. % Contract number
  1128. % \begin{macrocode}
  1129. \def\contractnum#1{\gdef\@contractnum{#1}}
  1130. \contractnum{}
  1131. % \end{macrocode}
  1132. % \end{macro}
  1133. %
  1134. % \begin{macro}{\monitoredby}
  1135. % Controlling lab
  1136. % \begin{macrocode}
  1137. \def\monitoredby#1{\gdef\@monitoredby{#1}}
  1138. \monitoredby{}
  1139. % \end{macrocode}
  1140. % \end{macro}
  1141. %
  1142. %
  1143. % \begin{macro}{\additionalinfo}
  1144. % Anything else on the title page
  1145. % \begin{macrocode}
  1146. \def\additionalinfo#1{\gdef\@additionalinfo{#1}}
  1147. \additionalinfo{}
  1148. % \end{macrocode}
  1149. % \end{macro}
  1150. %
  1151. %
  1152. % \begin{macro}{\abstract}
  1153. % \changes{v0.4}{2009/07/20}{Increased parsep}
  1154. % We save abstract till later. Again, this is uses code
  1155. % from~\cite{Downes04:amsart}.
  1156. % \begin{macrocode}
  1157. \newbox\abstractbox
  1158. \renewenvironment{abstract}{%
  1159. \global\setbox\abstractbox=\vtop \bgroup
  1160. \normalfont
  1161. \list{}{\labelwidth\z@
  1162. \leftmargin\z@ \rightmargin\leftmargin
  1163. \listparindent\z@ \itemindent\z@
  1164. \parsep16\p@ \topsep\z@
  1165. \let\fullwidthdisplay\relax
  1166. }%
  1167. \item[\hskip\labelsep\bfseries Abstract:]%
  1168. }{%
  1169. \endlist\egroup}
  1170. % \end{macrocode}
  1171. % \end{macro}
  1172. %
  1173. %
  1174. % \begin{macro}{\disclaimer}
  1175. % And disclaimer
  1176. % \begin{macrocode}
  1177. \long\def\disclaimer#1{\long\gdef\@disclaimer{#1}}
  1178. \disclaimer{The contents of this report are not to be used for
  1179. advertising, publication, or promotional purposes. Citation of trade
  1180. names does not constitute an official endorsement or approval of the
  1181. use of such commercial products. All product names and trademarks
  1182. cited are the property of their respective owners. The findings of
  1183. this report are not to be construed as an official Department of the
  1184. Army position unless so designated by other authorized documents.
  1185. \textbf{DESTROY THIS REPORT WHEN NO LONGER NEEDED. DO NOT RETURN IT
  1186. TO THE ORIGINATOR.}}
  1187. % \end{macrocode}
  1188. % \end{macro}
  1189. %
  1190. %
  1191. % \begin{macro}{@coverlist}
  1192. % \changes{v0.2}{2009/07/08}{Made slightly thinner}
  1193. % The title page consists of boxes, which are extended beyond the
  1194. % margins. Here we define the margins
  1195. % \begin{macrocode}
  1196. \newenvironment{@coverlist}{\begin{list}{}{%
  1197. \leftmargin40\p@\rightmargin-85\p@%
  1198. \topsep\z@\partopsep\z@\labelwidth\z@\labelsep\z@}\item{}}{%
  1199. \end{list}}
  1200. % \end{macrocode}
  1201. % \end{macro}
  1202. %
  1203. % \begin{macro}{@titlelist}
  1204. % Similar to |@coverlist|, but for title page
  1205. % \begin{macrocode}
  1206. \newenvironment{@titlelist}{\begin{list}{}{%
  1207. \leftmargin-20\p@\rightmargin100\p@%
  1208. \topsep\z@\partopsep\z@\labelwidth\z@\labelsep\z@}\item{}}{%
  1209. \end{list}}
  1210. % \end{macrocode}
  1211. % \end{macro}
  1212. %
  1213. %
  1214. % \begin{macro}{\if@titleblock}
  1215. % Title block consists of Prepared for, Work Under and Monitored By
  1216. % statements. We need to decide whether to print it:
  1217. % \begin{macrocode}
  1218. \newif\if@titleblock
  1219. % \end{macrocode}
  1220. % \end{macro}
  1221. %
  1222. % \begin{macro}{@titleblock}
  1223. % This is the macro for title block:
  1224. % \begin{macrocode}
  1225. \newenvironment{@titleblock}{%
  1226. \list{}{\labelwidth80\p@\labelsep10\p@ \leftmargin70\p@
  1227. \rightmargin-150\p@
  1228. \let\makelabel\@titleblocklabel}}{\endlist}
  1229. % \end{macrocode}
  1230. % \end{macro}
  1231. % \begin{macro}{\@titleblocklabel}
  1232. % Small labels:
  1233. % \begin{macrocode}
  1234. \newcommand*{\@titleblocklabel}[1]{\hfill\small#1}
  1235. % \end{macrocode}
  1236. %
  1237. % \end{macro}
  1238. %
  1239. % \begin{macro}{\maketitle}
  1240. % \changes{v0.2}{2009/07/07}{Changed fonts}
  1241. % \changes{v0.2}{2009/07/08}{Made slightly thinner}
  1242. % \changes{v0.3}{2009/07/18}{Increased box for the laboratory}
  1243. % \changes{v0.3}{2009/07/18}{Changhed weight to Book}
  1244. % \changes{v0.3}{2009/07/18}{Aligned the distribution line}
  1245. % \changes{v0.3}{2009/07/18}{Changed font sizes}
  1246. % \changes{v0.3}{2009/07/18}{Changed disclaimer width}
  1247. % \changes{v0.4}{2009/07/20}{Made the gap between red and black
  1248. % stripes on the cover exactly 4.5pt (added 2.75pt)}
  1249. % \changes{v0.4}{2009/07/20}{Moved boxes around}
  1250. % \changes{v1.1}{2009/07/22}{Added drop between authors and addresses}
  1251. % \changes{v1.1}{2009/07/22}{Compensated for top margin change}
  1252. % The |\maketitle| macro performs all the work of typesetting the
  1253. % information above.
  1254. %
  1255. % First, we typeset the cover page
  1256. % \begin{macrocode}
  1257. \def\maketitle{%
  1258. \thispagestyle{empty}%
  1259. \enlargethispage{0.34in}%
  1260. \vspace*{-0.95in}
  1261. \makebox[0cm][r]{%
  1262. \raisebox{-720\p@}[\z@][\z@]{%
  1263. \rotatebox{90}{\makebox[\z@][l]{%
  1264. \colorbox{red}{\color{white}\parbox{720\p@}{%
  1265. \rule{0\p@}{85\p@}%
  1266. \hspace{28\p@}\raisebox{40\p@}{%
  1267. \parbox[c]{350\p@}{\@laboratoryfont\@laboratory}%
  1268. \hspace{10\p@}%
  1269. \parbox[c]{300\p@}{\hfill\@reportnumfont\@reportnum}}}}}}}%
  1270. \hspace*{-14\p@}}%
  1271. \makebox[0cm][r]{\raisebox{-720\p@}[\z@][\z@]{\rule{8\p@}{726\p@}%
  1272. \hspace{-26.75\p@}}}%
  1273. \begin{@coverlist}%
  1274. \sffamily\fontseries{k}\selectfont%
  1275. \hfill\parbox{145\p@}{
  1276. \includegraphics[width=65\p@]{red_corps_castle2}\\
  1277. {\bfseries
  1278. US Army Corps\\
  1279. of Engineers\raisebox{-1\p@}{\scriptsize\textregistered}}\\
  1280. Engineering Research and\\
  1281. Development Center}\par
  1282. \vspace{0.5cm}%
  1283. {\@programfont\@program\par}%
  1284. \vspace{0.3cm}%
  1285. {\raggedright\@titlefont\@title\par
  1286. \vspace{0.3cm}%
  1287. \normalsize\bfseries\@subtitle\par}%
  1288. \vspace{0.3cm}%
  1289. \begin{minipage}[t]{300\p@}\raggedright
  1290. \nxandlist{\unskip, }{\unskip{} \@@and~}{\unskip{} \@@and~}\authors
  1291. \authors\end{minipage}%
  1292. \begin{minipage}[t]{135\p@}\flushright\@date\end{minipage}\par
  1293. \vspace{0.3cm}%
  1294. \@coverart
  1295. \end{@coverlist}%
  1296. \vfill
  1297. \begin{@coverlist}%
  1298. \@distributionfont\@distribution
  1299. \end{@coverlist}%
  1300. \newpage\thispagestyle{empty}\hbox{}\newpage
  1301. % \end{macrocode}
  1302. %
  1303. %
  1304. % Now title page
  1305. % \begin{macrocode}
  1306. %
  1307. \thispagestyle{empty}%
  1308. \setcounter{page}{1}%
  1309. \vspace*{-1.5in}%
  1310. \vspace*{-\topmargin}%
  1311. \begin{@titlelist}%
  1312. \sffamily\fontseries{k}\selectfont
  1313. \begin{minipage}[t]{275\p@}%
  1314. \bfseries\@program
  1315. \end{minipage}%
  1316. \begin{minipage}[t]{175\p@}%
  1317. \bfseries\flushright\@reportnum\\\@date
  1318. \end{minipage}\rule[-0.5in]{\z@}{0.625in}\par
  1319. \begin{minipage}{\textwidth}
  1320. \vspace*{1cm}%
  1321. {\@titlefont\raggedright\@title\par}
  1322. \vspace*{3\p@}%
  1323. \bfseries\@subtitle\par
  1324. \end{minipage}\rule[-0.7in]{\z@}{1in}\par
  1325. % \end{macrocode}
  1326. %
  1327. %
  1328. % Inside title page we use special processing for authors' names
  1329. % \begin{macrocode}
  1330. \def\author##1{%
  1331. \def\@tempa{##1}%
  1332. \nxandlist{\unskip, }{\unskip{} \@@and~}{\unskip{} \@@and~}\@tempa
  1333. {\upshape\normalsize\@tempa}\par\vspace{6\p@}}%
  1334. \begin{minipage}{\textwidth}
  1335. \textit{\footnotesize\addresses}\par
  1336. \end{minipage}\rule[-2.7in]{\z@}{3.7in}\par
  1337. \begin{minipage}{\textwidth}
  1338. \@reporttype\par\vspace*{3\p@}%
  1339. {\@distributionfont\@distribution\par}%
  1340. \end{minipage}
  1341. \end{@titlelist}%
  1342. \vfill
  1343. \begin{@titlelist}%
  1344. \sffamily\normalsize\fontseries{k}\selectfont
  1345. \ifx\@additionalinfo\@empty\else\@additionalinfo\par\fi
  1346. \@titleblockfalse
  1347. \ifx\@empty\@preparedfor\relax\else\@titleblocktrue\fi
  1348. \ifx\@empty\@contractnum\relax\else\@titleblocktrue\fi
  1349. \ifx\@empty\@monitoredby\relax\else\@titleblocktrue\fi
  1350. \if@titleblock
  1351. \begin{@titleblock}%
  1352. \ifx\@empty\@preparedfor\else
  1353. \item[Prepared for]\@preparedfor
  1354. \fi
  1355. \ifx\@empty\@contractnum\else
  1356. \item[Under]\@contractnum
  1357. \fi
  1358. \ifx\@empty\@monitoredby\else
  1359. \item[Monitored by]\@monitoredby
  1360. \fi
  1361. \end{@titleblock}
  1362. \fi
  1363. \end{@titlelist}%
  1364. \clearpage
  1365. % \end{macrocode}
  1366. %
  1367. %
  1368. % Now half title page. Again see~\cite{Downes04:amsart}
  1369. % \begin{macrocode}
  1370. \ifvoid\abstractbox
  1371. \else
  1372. \box\abstractbox
  1373. \prevdepth\z@
  1374. \fi
  1375. \vfill
  1376. \bgroup
  1377. \setlength{\fboxsep}{5\p@}%
  1378. \makebox[\textwidth]{\fbox{\parbox{6.5in}{%
  1379. \fontsize{8.5\p@}{9.5\p@}\selectfont
  1380. \parskip\baselineskip
  1381. \textbf{Disclaimer:} \@disclaimer}}}%
  1382. \egroup
  1383. \clearpage}
  1384. % \end{macrocode}
  1385. % \end{macro}
  1386. %
  1387. %
  1388. %
  1389. %
  1390. %
  1391. %\subsection{Sectioning}
  1392. %\label{sec:sectioning}
  1393. % \changes{v0.5}{2009/07/22}{Changed numbering of sections}
  1394. %
  1395. % \begin{macro}{\cl@chapter}
  1396. % We do \emph{not} reset equation counters when stepping chapters, except
  1397. % in appendices:
  1398. % \begin{macrocode}
  1399. \def\cl@chapter{}
  1400. % \end{macrocode}
  1401. % \end{macro}
  1402. % However, we do reset section and subsection counters
  1403. % \begin{macrocode}
  1404. \@addtoreset{section}{chapter}%
  1405. \@addtoreset{subsection}{chapter}%
  1406. \@addtoreset{subsection}{section}%
  1407. % \end{macrocode}
  1408. %
  1409. %
  1410. % \begin{macro}{\chapter}
  1411. % \changes{v0.2}{2009/07/07}{Changed font}
  1412. % We redefine |\chapter| to suppress empty page style on chapter
  1413. % opening:
  1414. % \begin{macrocode}
  1415. \renewcommand\chapter{%
  1416. \clearpage
  1417. \global\@topnum\z@
  1418. \@afterindentfalse
  1419. \secdef\@chapter\@schapter}
  1420. % \end{macrocode}
  1421. % \end{macro}
  1422. %
  1423. % \begin{macro}{\@chapter}
  1424. % \changes{v1.1}{2009/07/22}{Changed wrapping}
  1425. % Non-starred chapter:
  1426. % \begin{macrocode}
  1427. \def\@chapter[#1]#2{%
  1428. \if@frontmatter
  1429. \addcontentsline{toc}{chapter}{#1}%
  1430. \@makechapterhead{#2}%
  1431. \else
  1432. \refstepcounter{chapter}%
  1433. \typeout{\@chapapp\space\thechapter.}%
  1434. \if@appendix
  1435. \addcontentsline{toc}{chapter}%
  1436. {\@chapapp\space\thechapter: #1}%
  1437. \@makechapterhead{\@chapapp\space\thechapter: #2}%
  1438. \else
  1439. \addcontentsline{toc}{chapter}%
  1440. {\protect\numberline{\thechapter}#1}%
  1441. \@makechapterhead{\makebox[35\p@]{\thechapter\hfill}#2}%
  1442. \fi
  1443. \fi
  1444. \@afterheading}
  1445. % \end{macrocode}
  1446. % \end{macro}
  1447. %
  1448. % \begin{macro}{\@schapter}
  1449. % Starred chapter:
  1450. % \begin{macrocode}
  1451. \def\@schapter#1{%
  1452. \if@appendix
  1453. \addcontentsline{toc}{chapter}{\@chapapp: #1}%
  1454. \@makeschapterhead{\@chapapp: #1}%
  1455. \else
  1456. \addcontentsline{toc}{chapter}{#1}%
  1457. \@makeschapterhead{#1}%
  1458. \fi
  1459. \@afterheading}
  1460. % \end{macrocode}
  1461. % \end{macro}
  1462. %
  1463. %
  1464. % \begin{macro}{\@makechapterhead}
  1465. % \changes{v1.1}{2009/07/22}{Changed wrapping}
  1466. % This is the macro that actually prints the chapter:
  1467. % \begin{macrocode}
  1468. \def\@makechapterhead#1{%
  1469. \vspace*{5\p@}%
  1470. {\hskip-35\p@%
  1471. \parindent\z@\raggedright
  1472. \interlinepenalty\@M
  1473. \@titlefont #1\par\nobreak
  1474. \vspace*{10\p@}%
  1475. }}
  1476. % \end{macrocode}
  1477. % \end{macro}
  1478. %
  1479. % \begin{macro}{\@makeschapterhead}
  1480. % \changes{v1.1}{2009/07/22}{Wrote the macro}
  1481. % This is like |\makechapterhead|, but does not create hanging
  1482. % indent:
  1483. % \begin{macrocode}
  1484. \def\@makeschapterhead#1{%
  1485. \vspace*{5\p@}%
  1486. {%
  1487. \parindent\z@\raggedright
  1488. \interlinepenalty\@M
  1489. \leftskip-35\p@\@titlefont #1\par\nobreak
  1490. \vspace*{10\p@}%
  1491. }}
  1492. % \end{macrocode}
  1493. %
  1494. % \end{macro}
  1495. %
  1496. % \begin{macro}{\theequation}
  1497. % We do not use chapter number in equations, except in appendices:
  1498. % \begin{macrocode}
  1499. \renewcommand \theequation {\@arabic\c@equation}
  1500. % \end{macrocode}
  1501. %
  1502. % \end{macro}
  1503. %
  1504. %
  1505. %
  1506. % \begin{macro}{tocdepth}
  1507. % Only chapters, sections, subsections are in TOC:
  1508. % \begin{macrocode}
  1509. \setcounter{tocdepth}{2}
  1510. % \end{macrocode}
  1511. % \end{macro}
  1512. %
  1513. % \begin{macro}{\section}
  1514. % Sections are in 14\,pt bold.
  1515. % \begin{macrocode}
  1516. \renewcommand\section{%
  1517. \addpenalty\@secpenalty\nobreak
  1518. \secdef\@section\@ssection}
  1519. % \end{macrocode}
  1520. % \end{macro}
  1521. %
  1522. % \begin{macro}{\@section}
  1523. % \changes{v0.4}{2009/07/20}{Made sections numbered}
  1524. % \changes{v1.1}{2009/07/22}{Changed wrapping}
  1525. % This is for numbered sections:
  1526. % \begin{macrocode}
  1527. \def\@section[#1]#2{%
  1528. \ifnum1>\c@secnumdepth
  1529. \addcontentsline{toc}{section}{#1}%
  1530. \else
  1531. \refstepcounter{section}%
  1532. \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
  1533. \fi
  1534. {\hskip-35\p@\raggedright\interlinepenalty\@M
  1535. \large\sffamily\bfseries
  1536. \ifnum1>\c@secnumdepth\else\makebox[35\p@]{\thesection\hfill}\fi#2\nobreak\par}
  1537. \@afterheading
  1538. \nobreak\par}
  1539. % \end{macrocode}
  1540. % \end{macro}
  1541. % \begin{macro}{\@ssection}
  1542. % \changes{v0.4}{2009/07/20}{Wrote the macro}
  1543. % \changes{v1.1}{2009/07/22}{Changed wrapping}
  1544. % Unnumbered sections:
  1545. % \begin{macrocode}
  1546. \def\@ssection#1{
  1547. \addcontentsline{toc}{section}{#1}%
  1548. {\raggedright\interlinepenalty\@M
  1549. \large\sffamily\bfseries\leftskip-35\p@#1\nobreak\par}
  1550. \@afterheading
  1551. \nobreak\par}
  1552. % \end{macrocode}
  1553. % \end{macro}
  1554. %
  1555. %
  1556. % \begin{macro}{\subsection}
  1557. % Subsections are also bold
  1558. % \begin{macrocode}
  1559. \renewcommand\subsection{\par
  1560. \addpenalty\@secpenalty\nobreak
  1561. \secdef\@subsection\@ssubsection}
  1562. % \end{macrocode}
  1563. % \end{macro}
  1564. %
  1565. % \begin{macro}{\@subsection}
  1566. % \changes{v0.4}{2009/07/20}{Made subsections numbered}
  1567. % Numbered subsections:
  1568. % \begin{macrocode}
  1569. \def\@subsection[#1]#2{%
  1570. \ifnum2>\c@secnumdepth
  1571. \addcontentsline{toc}{subsection}{\itshape#1}%
  1572. \else
  1573. \refstepcounter{subsection}%
  1574. \addcontentsline{toc}{subsection}{\itshape\fontsize{9}{12}\selectfont
  1575. \protect\numberline{\thesubsection}%
  1576. #1}%
  1577. \fi
  1578. {\noindent\raggedright\interlinepenalty\@M
  1579. \normalsize\sffamily\bfseries
  1580. \ifnum2>\c@secnumdepth\else\thesubsection\hspace{1em}\fi#2}\nobreak\par}
  1581. % \end{macrocode}
  1582. % \end{macro}
  1583. %
  1584. % \begin{macro}{\@ssubsection}
  1585. % \changes{v0.4}{2009/07/20}{Wrote the macro}
  1586. % Unnumbered subsections
  1587. % \begin{macrocode}
  1588. \def\@ssubsection#1{%
  1589. \addcontentsline{toc}{subsection}{\itshape\fontsize{9}{12}\selectfont#1}%
  1590. {\noindent\raggedright\interlinepenalty\@M
  1591. \normalsize\sffamily\bfseries#1}\nobreak\par}
  1592. % \end{macrocode}
  1593. % \end{macro}
  1594. %
  1595. %
  1596. %
  1597. %\subsection{Special Chapters and Sections}
  1598. %\label{sec:special}
  1599. %
  1600. % Since our unnumbered sections go to the TOC, we need to have
  1601. % special ones that do not.
  1602. %
  1603. % \begin{macro}{\specialchapter}
  1604. % A chapter that does not go into TOC\dots
  1605. % \begin{macrocode}
  1606. \def\specialchapter#1{%
  1607. \clearpage
  1608. \global\@topnum\z@
  1609. \@afterindentfalse
  1610. \@makeschapterhead{#1}\par
  1611. \@afterheading}
  1612. % \end{macrocode}
  1613. % \end{macro}
  1614. %
  1615. %
  1616. %
  1617. %\subsection{Front Page Lists}
  1618. %\label{sec:frontlists}
  1619. %
  1620. % Here we define tables of contents, lists of figures, tables and the
  1621. % combined lists.
  1622. %
  1623. % \begin{macro}{\@dotsep}
  1624. % Separation between dots in tables
  1625. % \begin{macrocode}
  1626. \def\@dotsep{0.5}
  1627. % \end{macrocode}
  1628. % \end{macro}
  1629. %
  1630. %
  1631. %
  1632. % \begin{macro}{\l@chapter}
  1633. % \changes{v0.3}{2009/07/18}{Deleted leaders}
  1634. % \changes{v0.4}{2009/07/20}{Added leaders}
  1635. % \changes{v1.1}{2009/07/22}{Changed wrapping}
  1636. % Here we define chapter entry in TOC. Note the leaders to the end:
  1637. % \begin{macrocode}
  1638. \renewcommand\l@chapter[2]{%
  1639. \def\numberline##1{\makebox[1.9em]{##1\hfill}}%
  1640. \addpenalty{-\@highpenalty}%
  1641. \vskip5\p@
  1642. \bgroup
  1643. \parindent\z@\rightskip\@pnumwidth
  1644. \parfillskip-\@pnumwidth
  1645. \leavevmode\bfseries
  1646. \leftskip1.9em%
  1647. \hskip-\leftskip
  1648. #1\nobreak\leaders\hbox{$\m@th\mkern\@dotsep
  1649. mu\hbox{.}\mkern\@dotsep
  1650. mu$}\hfill\nobreak{\hfil\,#2}\par
  1651. \vskip5\p@
  1652. \penalty\@highpenalty
  1653. \egroup}
  1654. % \end{macrocode}
  1655. % \end{macro}
  1656. %
  1657. % \begin{macro}{\@dottedtocline}
  1658. % \changes{v0.4}{2009/07/20}{Redefined}
  1659. % \changes{v0.4}{2009/07/21}{Deleted hanging indent}
  1660. % \changes{v1.1}{2009/07/22}{Changed wrapping}
  1661. % We redefine the standard macro to allow page number font to be
  1662. % right and to continue leaders to the end:
  1663. % \begin{macrocode}
  1664. \def\@dottedtocline#1#2#3#4#5{%
  1665. \bgroup
  1666. \def\numberline##1{\makebox[#3]{##1\hfill}}%
  1667. \ifnum #1>\c@tocdepth \else
  1668. \vskip \z@ \@plus.2\p@
  1669. {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
  1670. \parindent #2\relax\@afterindenttrue
  1671. \interlinepenalty\@M
  1672. \leavevmode
  1673. \@tempdima #3\relax
  1674. \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
  1675. #4\nobreak
  1676. \leaders\hbox{$\m@th
  1677. \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
  1678. mu$}\hfill
  1679. \nobreak
  1680. {\hfil \normalcolor \,#5}%
  1681. \par}%
  1682. \fi
  1683. \egroup}
  1684. % \end{macrocode}
  1685. % \end{macro}
  1686. %
  1687. % \begin{macro}{\@dottedtoclineLF}
  1688. % \changes{v0.4}{2009/07/21}{Wrote macro}
  1689. % This is the version of |\@dottedtocline| used in LOT and LOF
  1690. % \begin{macrocode}
  1691. \def\@dottedtoclineLF#1#2#3#4#5{%
  1692. \bgroup
  1693. \ifnum #1>\c@tocdepth \else
  1694. \vskip \z@ \@plus.2\p@
  1695. {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
  1696. \parindent #2\relax\@afterindenttrue
  1697. \interlinepenalty\@M
  1698. \leavevmode
  1699. \@tempdima #2\relax
  1700. \advance\leftskip \@tempdima \null\nobreak\hskip -\@tempdima
  1701. #4\nobreak
  1702. \leaders\hbox{$\m@th
  1703. \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
  1704. mu$}\hfill
  1705. \nobreak
  1706. {\hfil \normalcolor \,#5}%
  1707. \par}%
  1708. \fi
  1709. \egroup}
  1710. % \end{macrocode}
  1711. % \end{macro}
  1712. %
  1713. %
  1714. % \begin{macro}{\l@section}
  1715. % \changes{v0.4}{2009/07/20}{Changed defaults}
  1716. % \changes{v1.1}{2009/07/22}{Changed wrapping}
  1717. % Section formatting in TOC
  1718. % \begin{macrocode}
  1719. \renewcommand*\l@section{\@dottedtocline{1}{2em}{2.5em}}
  1720. % \end{macrocode}
  1721. % \end{macro}
  1722. %
  1723. % \begin{macro}{\l@subsection}
  1724. % \changes{v0.4}{2009/07/20}{Changed defaults}
  1725. % \changes{v1.1}{2009/07/22}{Changed wrapping}
  1726. % Subsection formatting in TOC
  1727. % \begin{macrocode}
  1728. \renewcommand*\l@subsection{\@dottedtocline{2}{4.7em}{3em}}
  1729. % \end{macrocode}
  1730. % \end{macro}
  1731. %
  1732. %
  1733. % \begin{macro}{\l@figure}
  1734. % \changes{v0.4}{2009/07/21}{Redefined}
  1735. % Figure in lot
  1736. % \begin{macrocode}
  1737. \renewcommand*\l@figure{\@dottedtoclineLF{1}{0em}{2.3em}}
  1738. % \end{macrocode}
  1739. % \end{macro}
  1740. %
  1741. % \begin{macro}{\l@table}
  1742. % \changes{v0.4}{2009/07/21}{Redefined}
  1743. % Table in lot
  1744. % \begin{macrocode}
  1745. \let\l@table\l@figure
  1746. % \end{macrocode}
  1747. % \end{macro}
  1748. %
  1749. %
  1750. % \begin{macro}{\contentsname}
  1751. % \changes{v0.4}{2009/07/20}{Changed defaults}
  1752. % Contents...
  1753. % \begin{macrocode}
  1754. \renewcommand\contentsname{Table of Contents}
  1755. % \end{macrocode}
  1756. %
  1757. % \end{macro}
  1758. %
  1759. %
  1760. % \begin{macro}{\tableofcontents}
  1761. % TOC:
  1762. % \begin{macrocode}
  1763. \renewcommand\tableofcontents{%
  1764. \specialchapter{\contentsname}%
  1765. \def\numberline##1{\hb@xt@\@pnumwidth{##1\hfill}}%
  1766. {\parskip2.5\p@\footnotesize\sffamily\fontseries{k}\selectfont\raggedright
  1767. \@starttoc{toc}}}
  1768. % \end{macrocode}
  1769. % \end{macro}
  1770. % \begin{macro}{\listoffigures}
  1771. % LOF:
  1772. % \begin{macrocode}
  1773. \renewcommand\listoffigures{%
  1774. \chapter{\listfigurename}%
  1775. \def\numberline##1{Figure ##1. }%
  1776. {\parskip2.5\p@\footnotesize\sffamily\fontseries{k}\selectfont\raggedright
  1777. \@starttoc{lof}}}
  1778. % \end{macrocode}
  1779. % \end{macro}
  1780. % \begin{macro}{\listoftables}
  1781. % LOT:
  1782. % \begin{macrocode}
  1783. \renewcommand\listoftables{%
  1784. \chapter{\listtablename}%
  1785. \def\numberline##1{Table ##1. }%
  1786. {\parskip2.5\p@\footnotesize\sffamily\fontseries{k}\selectfont\raggedright
  1787. \@starttoc{lot}}}
  1788. % \end{macrocode}
  1789. % \end{macro}
  1790. %
  1791. % \begin{macro}{\listfiguretablename}
  1792. % The name for the combined list
  1793. % \begin{macrocode}
  1794. \def\listfiguretablename{Figures and Tables}
  1795. % \end{macrocode}
  1796. %
  1797. % \end{macro}
  1798. %
  1799. % \begin{macro}{\listoffiguresandtables}
  1800. % \changes{v0.3}{2009/07/18}{Added some vertical space}
  1801. % And the combined LOF and TOC
  1802. % \begin{macrocode}
  1803. \newcommand\listoffiguresandtables{%
  1804. \chapter{\listfiguretablename}
  1805. {\sffamily\bfseries\normalsize Figures\par}%
  1806. \vspace*{10pt}%
  1807. \def\numberline##1{Figure ##1. }%
  1808. {\parskip2.5\p@\footnotesize\sffamily\fontseries{k}\selectfont\raggedright
  1809. \@starttoc{lof}}%
  1810. {\sffamily\bfseries\normalsize Tables\par}%
  1811. \vspace*{10pt}%
  1812. \def\numberline##1{Table ##1. }%
  1813. {\parskip2.5\p@\footnotesize\sffamily\fontseries{k}\selectfont\raggedright
  1814. \@starttoc{lot}}}
  1815. % \end{macrocode}
  1816. % \end{macro}
  1817. %
  1818. % \begin{macro}{\bibname}
  1819. % We use ``References'' for bibliography
  1820. % \begin{macrocode}
  1821. \renewcommand\bibname{References}
  1822. % \end{macrocode}
  1823. % \end{macro}
  1824. %
  1825. %
  1826. %
  1827. %
  1828. %
  1829. %\subsection{Figures and Tables}
  1830. %\label{sec:floats}
  1831. %
  1832. % \begin{macro}{\@fptop}
  1833. % \changes{v0.5}{2009/07/21}{Redefined}
  1834. % We want the figures on figures-only page to be vertically
  1835. % top-aligned rather than centered:
  1836. % \begin{macrocode}
  1837. \setlength{\@fptop}{0pt}%
  1838. % \end{macrocode}
  1839. % \end{macro}
  1840. %
  1841. %
  1842. % \begin{macro}{\thefigure}
  1843. % We do not use chapter numbers in figures, except in appendix:
  1844. % \begin{macrocode}
  1845. \renewcommand \thefigure {\@arabic\c@figure}
  1846. % \end{macrocode}
  1847. % \end{macro}
  1848. %
  1849. % \begin{macro}{\thetable}
  1850. % We do not use chapter numbers in tables either:
  1851. % \begin{macrocode}
  1852. \renewcommand \thetable {\@arabic\c@table}
  1853. % \end{macrocode}
  1854. % \end{macro}
  1855. %
  1856. %
  1857. % \changes{v0.2}{2009/07/07}{Changed caption skips}
  1858. % Setting up captions:
  1859. % \begin{macrocode}
  1860. \captionsetup{justification=centering,font={footnotesize,sf,bf},
  1861. labelsep=period,aboveskip=3pt}
  1862. \captionsetup[table]{position=top}
  1863. % \end{macrocode}
  1864. %
  1865. %
  1866. % \begin{macro}{\arraystretch}
  1867. % Increase array stretch:
  1868. % \begin{macrocode}
  1869. \def\arraystretch{1.3}
  1870. % \end{macrocode}
  1871. %
  1872. % \end{macro}
  1873. %
  1874. %
  1875. %
  1876. %
  1877. %
  1878. %
  1879. % \subsection{Equation Numbering}
  1880. % \label{sec:eqnum}
  1881. %
  1882. % \begin{macro}{\maketag@@@}
  1883. % \changes{v0.3}{2009/07/18}{Introduced the macro}
  1884. % We change the \progname{amsmath} definition:
  1885. % \begin{macrocode}
  1886. \let\maketag@@@@\maketag@@@
  1887. \def\maketag@@@#1{\hbox{\m@th\@eqtagfont#1}}
  1888. % \end{macrocode}
  1889. % \end{macro}
  1890. %
  1891. % \begin{macro}{\eqref}
  1892. % \changes{v0.3}{2009/07/18}{Introduced the macro}
  1893. % We also change |\eqref|, otherwise the references will be in the
  1894. % wrong font:
  1895. % \begin{macrocode}
  1896. \renewcommand{\eqref}[1]{\textup{\tagform@@{\ref{#1}}}}
  1897. % \end{macrocode}
  1898. % \end{macro}
  1899. %
  1900. %
  1901. % \begin{macro}{\tagform@@}
  1902. % \changes{v0.3}{2009/07/18}{Introduced the macro}
  1903. % This is the original \progname{amsmath} version:
  1904. % \begin{macrocode}
  1905. \def\tagform@@#1{\maketag@@@@{(\ignorespaces#1\unskip\@@italiccorr)}}
  1906. % \end{macrocode}
  1907. % \end{macro}
  1908. %
  1909. %
  1910. %
  1911. %
  1912. %
  1913. % \subsection{The final word}
  1914. %\label{sec:final}
  1915. %
  1916. % \begin{macrocode}
  1917. %</class>
  1918. % \end{macrocode}
  1919. %
  1920. %\Finale
  1921. %\clearpage
  1922. %
  1923. %\PrintChanges
  1924. %\clearpage
  1925. %\PrintIndex
  1926. %
  1927. \endinput