| 1 |
% \iffalse |
| 2 |
% Title pages for Navy technical reports. |
| 3 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 4 |
% This is file `navydocs.dtx', the documentation file for the `navydocs' |
| 5 |
% package. |
| 6 |
% |
| 7 |
% Copyright (C) 2016 Peter Andrew Rochford. |
| 8 |
% |
| 9 |
% The navydocs package may be distributed and/or modified under the |
| 10 |
% conditions of the LaTeX Project Public License, version 1.3c |
| 11 |
% (LPPL, 2008-05-04) of this license or (at your option) any later version. |
| 12 |
% The latest version of this license can be found at: |
| 13 |
% https://latex-project.org/lppl/ |
| 14 |
% |
| 15 |
% The navydocs package is distributed in the hope that it will be |
| 16 |
% useful, but `as is', WITHOUT WARRANTY OF ANY KIND, either expressed |
| 17 |
% or implied, including, but not limited to, the implied warranties of |
| 18 |
% MERCHANTABILITY and FITNESS FOR A PARTICULAR PURPOSE. See the LaTeX |
| 19 |
% Project Public License for more details. |
| 20 |
% |
| 21 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 22 |
% @LaTeX-style-file{ |
| 23 |
% Author = "Peter A. Rochford", |
| 24 |
% Version = "1.1", |
| 25 |
% Date = "2017/7/1", |
| 26 |
% Time = "22:51:25", |
| 27 |
% Filename = "navydocs.sty", |
| 28 |
% Address = "Acorn Science & Innovation, Inc. |
| 29 |
% 1616 Anderson Road, Suite 213 |
| 30 |
% McLean, VA 22102, USA", |
| 31 |
% Telephone = "+1 703-995-9872", |
| 32 |
% Email = "[email protected]", |
| 33 |
% CodeTable = "ISO/ASCII", |
| 34 |
% Keywords = "LaTeX, standard forms, navydocs, report documentation", |
| 35 |
% Supported = "yes", |
| 36 |
% Abstract = "LaTeX package for generating title pages and other leading |
| 37 |
% pages as prescribed for Navy technical reports, for instance, |
| 38 |
% as part of a document delivered on a U.S. Government |
| 39 |
% contract.'' |
| 40 |
% } |
| 41 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 42 |
% |
| 43 |
% \fi |
| 44 |
% |
| 45 |
% \iffalse |
| 46 |
%<*driver> |
| 47 |
\ProvidesFile{navydocs.dtx} |
| 48 |
\documentclass[letterpaper]{ltxdoc} |
| 49 |
\usepackage{navydocs} |
| 50 |
\usepackage{afterpage} |
| 51 |
\advance\textheight2\baselineskip |
| 52 |
\setlength\hfuzz{26pt} |
| 53 |
\newcounter{savepage} |
| 54 |
%</driver> |
| 55 |
% |
| 56 |
%<*ltxdoc> |
| 57 |
\AtBeginDocument{ |
| 58 |
\EnableCrossrefs |
| 59 |
\RecordChanges |
| 60 |
\CodelineIndex} |
| 61 |
\AtEndDocument{ |
| 62 |
\PrintChanges |
| 63 |
\PrintIndex} |
| 64 |
\begin{document} |
| 65 |
\DocInput{navydocs.dtx} |
| 66 |
\end{document} |
| 67 |
%</ltxdoc> |
| 68 |
% |
| 69 |
% \fi |
| 70 |
% |
| 71 |
% \newcommand*{\Lopt}[1]{\textsf{#1}} |
| 72 |
% \newcommand*{\Lfile}[1]{\texttt{#1}} |
| 73 |
% \newcommand*{\Lpack}[1]{\textsf{#1}} |
| 74 |
% |
| 75 |
% \changes{v1.0}{11 Jan 2000}{Initial revision.} |
| 76 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 77 |
% \DoNotIndex{\ ,\(,\),\@car,\@date,\@empty,\@gobble,\@ifnextchar} |
| 78 |
% \DoNotIndex{\@ifundefined,\@nil,\@tempa,\@tempboxa,\@tempskipa} |
| 79 |
% \DoNotIndex{\@viiipt,\@vpt,\@vipt,\@xipt,\@xivpt,\@warning,\@xpt,\\} |
| 80 |
% \DoNotIndex{\2,\AtEndDocument,\addtocounter,\advance,\arabic} |
| 81 |
% \DoNotIndex{\baselineskip,\baselinestretch,\begin,\bf,\c@page} |
| 82 |
% \DoNotIndex{\cleardoublepage,\csname,\date,\day,\DeclareFixedFont} |
| 83 |
% \DoNotIndex{\def,\documentclass,\documentpackage,\edef,\else,\end} |
| 84 |
% \DoNotIndex{\endcsname,\evensidemargin,\ExecuteOptions,\expandafter} |
| 85 |
% \DoNotIndex{\fi,\font,\fontdimen,\footnote,\framebox,\global,\hbox} |
| 86 |
% \DoNotIndex{\headheight,\headsep,\hrule,\hskip,\hss,\if,\if@twoside} |
| 87 |
% \DoNotIndex{\ifdim,\IfFileExists,\ifodd,\ifx,\InputIfFileExists,\LARGE} |
| 88 |
% \DoNotIndex{\large,\leftskip,\let,\line,\lineskip,\linethickness} |
| 89 |
% \DoNotIndex{\linewidth,\makeatletter,\makeatother,\makebox,\maketitle} |
| 90 |
% \DoNotIndex{\month,\NeedsTeXFormat,\newcommand,\newcounter,\newif} |
| 91 |
% \DoNotIndex{\newpage,\noindent,\normalbaselineskip,\null,\number} |
| 92 |
% \DoNotIndex{\oddsidemargin,\pagenumbering,\pagestyle,\par,\parbox,\phantom} |
| 93 |
% \DoNotIndex{\ProvidesPackage,\put,\r@TotPages,\raggedright,\relax} |
| 94 |
% \DoNotIndex{\renewcommand,\rightskip,\rule,\section,\setcounter} |
| 95 |
% \DoNotIndex{\setbox,\setlength,\shortstack,\space,\spaceskip,\string} |
| 96 |
% \DoNotIndex{\tableofcontents,\textheight,\textwidth,\thispagestyle} |
| 97 |
% \DoNotIndex{\topmargin,\tt,\typeout,\unitlength,\usepackage,\value} |
| 98 |
% \DoNotIndex{\vbox,\vfil,\voffset,\vskip,\vss,\wd,\xspaceskip,\year} |
| 99 |
% |
| 100 |
% \newcommand{\ie}{{\it i.e.\/}} |
| 101 |
% |
| 102 |
% \def\filename{navydocs.dtx} |
| 103 |
% \def\fileversion{1.1} |
| 104 |
% \def\filedate{2016/7/1} |
| 105 |
% \def\docdate {2016/7/1} |
| 106 |
% \makeatletter |
| 107 |
% \def\@oddfoot{% |
| 108 |
% \rm |
| 109 |
% \hfil |
| 110 |
% \@ifundefined{r@fig:form}% |
| 111 |
% {\thepage}% |
| 112 |
% {\@tempcnta\pageref{fig:form} |
| 113 |
% \ifnum \c@page=\@tempcnta \else |
| 114 |
% \thepage |
| 115 |
% \fi}% |
| 116 |
% \hfil} |
| 117 |
% \let\@evenfoot\@oddfoot |
| 118 |
% \makeatother |
| 119 |
% |
| 120 |
% \CheckSum{0} |
| 121 |
% |
| 122 |
% \CharacterTable |
| 123 |
% {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 |
| 124 |
% 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 |
| 125 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 126 |
% Exclamation \! Double quote \" Hash (number) \# |
| 127 |
% Dollar \$ Percent \% Ampersand \& |
| 128 |
% Acute accent \' Left paren \( Right paren \) |
| 129 |
% Asterisk \* Plus \+ Comma \, |
| 130 |
% Minus \- Point \. Solidus \/ |
| 131 |
% Colon \: Semicolon \; Less than \< |
| 132 |
% Equals \= Greater than \> Question mark \? |
| 133 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 134 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 135 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 136 |
% Right brace \} Tilde \~} |
| 137 |
% |
| 138 |
% \title{The \Lpack{navydocs} Package\footnote{This paper documents |
| 139 |
% the \Lpack{navydocs} package v\fileversion, last revised \filedate.}} |
| 140 |
% \author{ |
| 141 |
% Peter Andrew Rochford\\[5pt] |
| 142 |
% Acorn Science \& Innovation, Inc. \\ |
| 143 |
% 1616 Anderson Road, Suite 213 \\ |
| 144 |
% McLean, VA 22102, USA\\[5pt] |
| 145 |
% \texttt{[email protected]} |
| 146 |
% } |
| 147 |
% \date{\docdate} |
| 148 |
% \maketitle |
| 149 |
% \vspace{-20pt} |
| 150 |
% \begin{abstract} |
| 151 |
% \noindent |
| 152 |
% This article documents the \LaTeX\ package for generating the title |
| 153 |
% page and other leading pages as prescribed for Navy technical reports. |
| 154 |
% For example, as part of a document delivered on a U.S. Government |
| 155 |
% contract. |
| 156 |
% |
| 157 |
%\end{abstract} |
| 158 |
% |
| 159 |
% \setcounter{tocdepth}{2} |
| 160 |
% \tableofcontents |
| 161 |
% |
| 162 |
% \section{Introduction} |
| 163 |
% |
| 164 |
% The \Lpack{navydocs} package provides an easy means for |
| 165 |
% creating title pages and the following supplementary material pages used |
| 166 |
% in technical reports by United States Navy organizations. These pages are |
| 167 |
% generated by specifying the page content via a set of commands and then |
| 168 |
% calling a macro to create the page at its occurence in the document. The |
| 169 |
% package in its current form provides a title page and a technical components |
| 170 |
% page as used by the Carderock Division at the Naval Surface Warfare Center |
| 171 |
% (Carderock/NSWC). The macros provided within the package can be easily |
| 172 |
% copied and modified to support formats used by other Navy organizations. |
| 173 |
% The \Lpack{navydocs} package is provided in the hope that it proves |
| 174 |
% useful to other Navy organizations, with users contributing macros for their |
| 175 |
% organizations. Please email to the author any new macros for title pages or |
| 176 |
% supplementary material so they can be added to the \Lpack{navydocs} |
| 177 |
% package. |
| 178 |
% |
| 179 |
% In the current version of the \Lpack{navydocs} package, the macro |
| 180 |
% \cmd{\NavyTitlePage} will produce a title page for a technical report |
| 181 |
% released by Carderock/NSWC. The macro \cmd{\MakeCarderockDivPage} |
| 182 |
% will create a Technical Components page that lists the major Carderock |
| 183 |
% Division technical components of the organization along with the three |
| 184 |
% types of reports issued by this division. This is typically inserted after the |
| 185 |
% title page. |
| 186 |
% |
| 187 |
% A sample of the Carderock/NSWC title and technical components pages |
| 188 |
% is given in section~\ref{sec:sample} for one example of how to use the |
| 189 |
% \Lpack{navydocs} package. |
| 190 |
% |
| 191 |
% \section{The Individual Fields} |
| 192 |
% |
| 193 |
% There are 10 fields for producing the title pages. The following macros, each |
| 194 |
% having a single argument, define the data to be included in each field. Usually |
| 195 |
% only a few fields will apply to a given report. Table~\ref{tab:attributes} notes which |
| 196 |
% fields are required and which have default values. The best approach to insure that |
| 197 |
% the form is properly filled-in is to preview the page and adjust any |
| 198 |
% fields that appear to have a problem. Note that in many cases you can use |
| 199 |
% ``|\\|'' (newline) to spread the text over several lines. |
| 200 |
% |
| 201 |
% \begin{table}[h] |
| 202 |
% \null\vspace{-.1in} |
| 203 |
% \def\n{\hfill{\bf ---}\hfill\null} |
| 204 |
% \def\d#1#2{\smash{\lower#1\hbox{#2}}} |
| 205 |
% \def\p{\phantom{0}} |
| 206 |
% \def\s#1{{\footnotesize (#1)}} |
| 207 |
% \def\S#1{% |
| 208 |
% \ifnum#1<10 |
| 209 |
% {\footnotesize \phantom{0}(#1)}% |
| 210 |
% \else |
| 211 |
% \s{#1}% |
| 212 |
% \fi} |
| 213 |
% \doublerulesep.5pt |
| 214 |
% \arrayrulewidth.5pt |
| 215 |
% \caption{Field Attributes and Approximate Maximum Size.} |
| 216 |
% \label{tab:attributes} |
| 217 |
% \vspace{10pt} |
| 218 |
% \DeleteShortVerb{\|} |
| 219 |
% \hbox to \textwidth{% |
| 220 |
% \begin{tabular}{lcccccc} |
| 221 |
% \hline\hline |
| 222 |
% \multicolumn{1}{c}{\rule{0pt}{14pt}\d{1ex}{\bf Macro Name}} |
| 223 |
% & \multicolumn{1}{c}{\d{1ex}{\bf Required}} |
| 224 |
% & \multicolumn{1}{l}{\bf Default} |
| 225 |
% & \multicolumn{1}{c}{\bf Max} |
| 226 |
% & \multicolumn{1}{c}{{\bf Chars.}\d{-2.5pt}{\s{3}}} |
| 227 |
% \\ |
| 228 |
% & & \multicolumn{1}{l}{{\bf Value}} |
| 229 |
% & \multicolumn{1}{c}{\bf Lines} |
| 230 |
% & \multicolumn{1}{c}{\bf per Line} |
| 231 |
% \\ \hline\rule{0pt}{14pt} |
| 232 |
% \cmd{\NavyDivision} & Yes &\n& \p1 & \p58 \\ |
| 233 |
% \cmd{\NavyDivisionLocation} & Yes & \n & \p1 & \p70 \\ |
| 234 |
% \cmd{\NavyReportNumber} & Yes & \n & \p1 & \p57 \\ |
| 235 |
% \cmd{\NavyReportDate} & \n & \s{1} & \p1 & \p12 \\ |
| 236 |
% \cmd{\NavyReportType} & Yes & \n & \p2 & \p75 \\ |
| 237 |
% \cmd{\NavyReportTitle} & Yes & \n & \p3 & \p45 \\ |
| 238 |
% \cmd{\NavyAuthor} & Yes & \n & \p19 & \p75 \\ |
| 239 |
% \cmd{\NavyDistributionStatement} & \n &\s{2}& \p1 & \p55 \\ |
| 240 |
% \cmd{\NavyMarginTitle} & \n & \n & \p2 & \p85 \\ \hline\hline |
| 241 |
% \multicolumn{5}{l}{\rule{0pt}{14pt}{\bf Notes:}} \\ |
| 242 |
% \multicolumn{5}{l}{\quad\S{1} Defaults to the current date in ``dd~Month~yyyy'' |
| 243 |
% format (\eg} \\ |
| 244 |
% \multicolumn{5}{l}{\quad\phantom{\S{1}} 26~June~2016).} \\ |
| 245 |
% \multicolumn{5}{l}{\quad\S{2} Defaults to ``Approved for public release; |
| 246 |
% distribution is unlimited''}. \\ |
| 247 |
% \multicolumn{5}{l}{\quad\S{3} The number of characters is approximate and for |
| 248 |
% the Computer} \\ |
| 249 |
% \multicolumn{5}{l}{\quad\phantom{\S{3}} Modern Roman font family only.} |
| 250 |
% \end{tabular}% |
| 251 |
% } |
| 252 |
% \vspace{.1in} |
| 253 |
% \MakeShortVerb{\|} |
| 254 |
% \end{table} |
| 255 |
% |
| 256 |
% \newpage |
| 257 |
% \paragraph{1. DIVISION} |
| 258 |
% \DescribeMacro{\NavyDivision} |
| 259 |
% |
| 260 |
% \noindent |
| 261 |
% The full specification of the Navy division producing the technical report as |
| 262 |
% it should appear at the top of the title page, \eg Carderock Division, |
| 263 |
% Naval Surface Warface Center. This field is required. |
| 264 |
% |
| 265 |
% \paragraph{2. DIVISION LOCATION} |
| 266 |
% \DescribeMacro{\NavyDivisionLocation} |
| 267 |
% |
| 268 |
% \noindent |
| 269 |
% The city, state, and zip code of the Navy division producing the technical report |
| 270 |
% as it should appear at the top of the title page, \eg West Bethesda, Maryland |
| 271 |
% 20817-5700. This field is required. |
| 272 |
% |
| 273 |
% \paragraph{3. REPORT NUMBER} |
| 274 |
% \DescribeMacro{\NavyReportNumber} |
| 275 |
% |
| 276 |
% \noindent |
| 277 |
% Enter the unique alphanumeric report number(s) assigned by the Navy |
| 278 |
% performing organization, \eg |
| 279 |
% \par\null\noindent |
| 280 |
% \begin{tabular}{llll} |
| 281 |
% ~~ & \multicolumn{3}{l}{\tt \cmd{\POReportNumber}\{CRDKNSWC/HD-1427-02; |
| 282 |
% AFWL-TR-85-4017-Vol21-PT-2\}} \\ |
| 283 |
% & \hspace{1in} & $\rightarrow$ & BRL-1234; AFWL-TR-85-4017-Vol21-PT-2 |
| 284 |
% \end{tabular} |
| 285 |
% |
| 286 |
% \paragraph{4. REPORT DATE} |
| 287 |
% \DescribeMacro{\NavyReportDate} |
| 288 |
% |
| 289 |
% \noindent |
| 290 |
% Publication date , which is typically in the format of month and year, \eg |
| 291 |
% October 1996. |
| 292 |
% |
| 293 |
% \paragraph{5. REPORT TYPE} |
| 294 |
% \DescribeMacro{\NavyReportType} |
| 295 |
% |
| 296 |
% \noindent |
| 297 |
% State the type of report as stipulated by the Navy organization. You can |
| 298 |
% use ``|\\|'' (newline) to specify the report type across multiple lines, such |
| 299 |
% as |
| 300 |
% |
| 301 |
% \cmd{\NavyReportType}\{Hydromechanics Directorate \\ |
| 302 |
% Research and Development Report \} |
| 303 |
% |
| 304 |
% This field is required. |
| 305 |
% |
| 306 |
% \paragraph{6. REPORT TITLE} |
| 307 |
% \DescribeMacro{\NavyReportTitle} |
| 308 |
% |
| 309 |
% \noindent |
| 310 |
% The title for the report. This should be taken from the part of |
| 311 |
% the report that provides the most meaningful and complete information. |
| 312 |
% You can use ``|\\|'' (newline) to specify the report type across multiple |
| 313 |
% lines, such as |
| 314 |
% |
| 315 |
% \cmd{\NavyReportTitle}\{Mathematical Model for MANSIM Version 2:\\ |
| 316 |
% A Surface Ship Maneuvering, Stationkeeping, \\ |
| 317 |
% and Seakeeping Simulator Computer Program \} |
| 318 |
% |
| 319 |
% On classified documents enter the title classification in parentheses. |
| 320 |
% This field is required. |
| 321 |
% |
| 322 |
% \paragraph{7. AUTHOR(S)} |
| 323 |
% \DescribeMacro{\NavyAuthor} |
| 324 |
% |
| 325 |
% \noindent |
| 326 |
% Enter name(s) of the person(s) responsible for writing the report, |
| 327 |
% performing the research, or credited with the content of the report. |
| 328 |
% You can use ``|\\|'' (newline) to specify the report type across multiple |
| 329 |
% lines. If editor or compiler, this should follow the name(s). |
| 330 |
% |
| 331 |
% \paragraph{8. DISTRIBUTION/AVAILABILITY STATEMENT} |
| 332 |
% \DescribeMacro{\NavyDistributionStatement} |
| 333 |
% |
| 334 |
% \noindent |
| 335 |
% Use agency-mandated availability statements to indicated the public |
| 336 |
% availability or distribution limitations of the report. If additional |
| 337 |
% limitations/restrictions or special markings are indicated follow |
| 338 |
% agency authorization procedures, \eg, RD/FRD, PROPIN, ITAR. |
| 339 |
% This field is {\bf not} required, but will default to the first of the following examples: |
| 340 |
% \par\null\noindent |
| 341 |
% ``Approved for public release; distribution is unlimited.'' |
| 342 |
% \par\null\noindent |
| 343 |
% ``Distribution authorized to DoD only; (reason and date). Other |
| 344 |
% requests shall be referred to (controlling DoD office).'' |
| 345 |
% \par\null\noindent |
| 346 |
% ``Further dissemination only as directed by (controlling DoD office |
| 347 |
% and date) or higher DoD authority.'' |
| 348 |
% \par\null\noindent |
| 349 |
% \hbox to \textwidth{% |
| 350 |
% \begin{tabular}{l@{\space---\space}l} |
| 351 |
% For DoD & \parbox[t]{0.75\textwidth}{See DoDD 5230.24, |
| 352 |
% ``Distribution Statements on Technical Documents.''}\\ |
| 353 |
% For DoE & See authorities.\\ |
| 354 |
% For NASA & See Handbook NHB 2200.2.\\ |
| 355 |
% For NTIS & Leave blank. |
| 356 |
% \end{tabular}% |
| 357 |
% \hss} |
| 358 |
% |
| 359 |
% \paragraph{9. MARGIN TITLE} |
| 360 |
% \DescribeMacro{\NavyMarginTitle} |
| 361 |
% |
| 362 |
% \noindent |
| 363 |
% Title to appear in the left margin of the title page, oriented in a vertical |
| 364 |
% position. The title is typically the same as that used with \cmd{\NavyReportTitle} |
| 365 |
% but may differ because the title has to be shortened due to space limitations or |
| 366 |
% line breaks. Hence a separate command is used to provide the title. |
| 367 |
% |
| 368 |
% A margin title will only appear if this command is called with an argument. The title |
| 369 |
% will appear in the margin according to the formatting commands provided for the |
| 370 |
% title, for example using a``|\\|'' (newline) to have the title split across more than |
| 371 |
% one line or a \cmd{\hphantom} to control placement of text |
| 372 |
% (cf. Section~\ref{sec:sample}). |
| 373 |
% |
| 374 |
% \cmd{\NavyMarginTitle\{Title for margin\}} |
| 375 |
% |
| 376 |
% By default the margin title will be placed at the margin paragraph width and the |
| 377 |
% bottom of the text height area. To allow user control over the exact placement |
| 378 |
% of the margin title, the command accepts two optional arguments |
| 379 |
% (xmargin, ymargin) that define the horizontal (xmargin) and vertical (ymargin) |
| 380 |
% position of the bottom left placement. |
| 381 |
% |
| 382 |
% \cmd{\NavyMarginTitle[xmargin][ymargin]\{Title for margin\}} |
| 383 |
% |
| 384 |
% To provide guidance on suitable values for [xmargin][ymargin] , the default |
| 385 |
% values are [40][70], while the values used to place the margin title as it appears |
| 386 |
% in Section~\ref{sec:titlepage} are [140][95]. |
| 387 |
% |
| 388 |
% \iffalse |
| 389 |
% Save current page number because \titlepage sets it to 1 later. |
| 390 |
%\fi |
| 391 |
% \setcounter{savepage}{\thepage} |
| 392 |
% \section{Title Page} |
| 393 |
% \label{sec:titlepage} |
| 394 |
% |
| 395 |
% The macro \cmd{\NavyTitlePage} will produce a title page for the Navy |
| 396 |
% technical report on a separate page at the location where it appears. This will |
| 397 |
% produce the title page as shown on the following page. |
| 398 |
% |
| 399 |
% \NavyDivision{Division, Center} |
| 400 |
% \NavyDivisionLocation{City, State Zip Code} |
| 401 |
% \NavyReportNumber{Report No.} |
| 402 |
% \NavyReportDate{Month Year} |
| 403 |
% \NavyReportType{Directorate \\ |
| 404 |
% Research and Development Report} |
| 405 |
% \NavyReportTitle{Report Title} |
| 406 |
% \NavyAuthor{Author} |
| 407 |
% \NavyMarginTitle{Report Title for margin} |
| 408 |
% |
| 409 |
% \newpage |
| 410 |
% \NavyMarginTitle[140][95]{\NavyReportNumber{} Report Title} |
| 411 |
% \NavyTitlePage |
| 412 |
% |
| 413 |
% \iffalse |
| 414 |
% Reset page number because \titlepage sets it to 1. |
| 415 |
%\fi |
| 416 |
% \setcounter{page}{\thesavepage} |
| 417 |
% \addtocounter{page}{2} |
| 418 |
% |
| 419 |
% \section{Supplementary Material Page} |
| 420 |
% |
| 421 |
% Some Navy organizations require that additional pages follow the title page. |
| 422 |
% For example, Carderock/NSWC requires that a Technical Components page follow the |
| 423 |
% title page. The latter page can be produced by using the macro |
| 424 |
% \cmd{\MakeCarderockDivPage} included with this \LaTeX\ package. You can |
| 425 |
% easily define a macro customized for other Navy organziations by copying |
| 426 |
% and modifying this one. |
| 427 |
% |
| 428 |
% \DescribeMacro{\MakeCarderockDivPage} |
| 429 |
% \noindent |
| 430 |
% The macro \cmd{\MakeCarderockDivPage} makes use of one field that |
| 431 |
% identifies the form at the bottom of the page, namely |
| 432 |
% \cmd{\NavyFormID\{FormID\}} where FormID is the form identifier, e.g |
| 433 |
% ``NDW-DTRC 5602/51 (Rev. 7-93)''. This field is required. |
| 434 |
% |
| 435 |
% The\cmd{\MakeCarderockDivPage} command need simply be inserted into your |
| 436 |
% \LaTeX\ document after the \cmd{\MakeNavyCoverPage} command. This will |
| 437 |
% result in the following page appearing in the document. |
| 438 |
% |
| 439 |
% \newpage |
| 440 |
% \NavyFormID{NDW-DTRC 5602/51 (Rev. 7-93)} |
| 441 |
% \MakeCarderockDivPage |
| 442 |
% |
| 443 |
% \section{Configuration} |
| 444 |
% \enlargethispage{24pt} |
| 445 |
% |
| 446 |
% In order to make the use of the report documentation page as easy as |
| 447 |
% possible, several aspects of the package are automated or can be easily |
| 448 |
% configured. |
| 449 |
% |
| 450 |
% \subsection{Fonts} |
| 451 |
% \label{sec:configfont} |
| 452 |
% |
| 453 |
% When the package is loaded it defines the fonts that are used by |
| 454 |
% basing them on the font families \cmd{\sfdefault} for the field labels and |
| 455 |
% \cmd{\rmdefault} for the text entries. By default, they will be based on |
| 456 |
% the Computer Modern font family. If you are changing the base font |
| 457 |
% families for your paper and you want the fonts used on the |navydocs| to |
| 458 |
% change also, then you must change the font families before loading the |
| 459 |
% \Lpack{navydocs} package. See \cite[pages 229,236]{Kopk-Daly93} for more |
| 460 |
% information about the default font families. |
| 461 |
% |
| 462 |
% For any specific field, you can override the default font by |
| 463 |
% declaring your preferred value along with your entry, \eg |
| 464 |
% \par\null\noindent |
| 465 |
% \begin{tabular}{llll} |
| 466 |
% ~~ & {\tt \cmd{\Title}\{\cmd{\Huge} A Huge Title\}} & $\rightarrow$ & \smash{\Huge\lower.5ex\hbox{A Huge Title}} |
| 467 |
% \end{tabular} |
| 468 |
% |
| 469 |
% \section{An Example of Use with the \Lpack{article} Class} |
| 470 |
% \label{sec:sample} |
| 471 |
% \iffalse |
| 472 |
%<*sample> |
| 473 |
% \fi% |
| 474 |
% |
| 475 |
% This sample program demonstrates how the \Lpack{navydocs} package may |
| 476 |
% be used and integrated with an existing class. Here we redefine |
| 477 |
% \cmd{\@makefile} so that we can create a titlepage and report |
| 478 |
% documentation page that share a common set of fields, such as the |
| 479 |
% report title, the performing organization title and address and the |
| 480 |
% report abstract. |
| 481 |
% |
| 482 |
% First we have to start the paper as an \Lpack{article} with twosided |
| 483 |
% pages and using the \Lpack{navydocs} package. |
| 484 |
% |
| 485 |
% \begin{macrocode} |
| 486 |
\documentclass[twoside]{article} |
| 487 |
\usepackage[margin=0.75in]{geometry} % set margins to 0.75 in |
| 488 |
\usepackage{lipsum} % required to produce dummy text |
| 489 |
\usepackage{navydocs} |
| 490 |
% \end{macrocode} |
| 491 |
% |
| 492 |
% Set some page specifications so the margin title will appear properly using the defaults. |
| 493 |
% Otherwise we'll need to explicitly specify where the margin title is to be placed. |
| 494 |
% |
| 495 |
% \begin{macrocode} |
| 496 |
|
| 497 |
\setlength{\marginparwidth}{64pt} |
| 498 |
\setlength{\parindent}{5ex} |
| 499 |
\setlength{\paperwidth}{8.5in} |
| 500 |
\setlength{\textwidth}{6.5in} |
| 501 |
\setlength{\oddsidemargin}{0in} |
| 502 |
\setlength{\evensidemargin}{0in} |
| 503 |
% \end{macrocode} |
| 504 |
% |
| 505 |
% Now we fill in the fields needed for the title page. For reference as a template, |
| 506 |
% we have entered all of the \Lpack{navydocs} block macros below. |
| 507 |
% \newpage |
| 508 |
% \begin{macrocode} |
| 509 |
|
| 510 |
\begin{document} |
| 511 |
|
| 512 |
\NavyDivision{Navy Division, Navy Center} |
| 513 |
\NavyDivisionLocation{City, State Zip-Code} |
| 514 |
\NavyReportNumber{XXXXXXXX/XX-0123-45} |
| 515 |
\NavyReportDate{Month Year} |
| 516 |
\NavyReportType{Navy Directorate \\ |
| 517 |
Research and Development Report} |
| 518 |
\NavyReportTitle{Mathematical Model Version 2:\\ |
| 519 |
A Long Detailed Title \\ |
| 520 |
Spanning Multiple Lines (if desired)} |
| 521 |
\NavyAuthor{Author Name} |
| 522 |
|
| 523 |
% Note that we explicitly shifted the margin title horizontally for |
| 524 |
% better visual effect because of the smaller default font used |
| 525 |
% in the two-sided page option for article. |
| 526 |
\NavyMarginTitle{ |
| 527 |
\NavyReportNumber{} Mathematical Model Version 2: \\ |
| 528 |
\hphantom{\NavyReportNumber{}} A Long Detailed Title Spanning Multiple Lines (if desired) |
| 529 |
} |
| 530 |
|
| 531 |
\NavyFormID{NDW-DTRC 5602/51 (Rev. 7-93)} |
| 532 |
% \end{macrocode} |
| 533 |
% |
| 534 |
% Finally we produce a very simple report that contains a title page |
| 535 |
% and the technical components page as used by Carderock/NSWC. |
| 536 |
% First we print the title page. Next the technical components page is |
| 537 |
% written. Following these two pages, the table of contents is output, |
| 538 |
% followed by the very short report. |
| 539 |
% |
| 540 |
% \begin{macrocode} |
| 541 |
|
| 542 |
\NavyTitlePage |
| 543 |
|
| 544 |
\pagenumbering{roman} |
| 545 |
|
| 546 |
\MakeCarderockDivPage |
| 547 |
|
| 548 |
\tableofcontents |
| 549 |
\cleardoublepage |
| 550 |
\pagenumbering{arabic} |
| 551 |
\setcounter{page}{1} |
| 552 |
|
| 553 |
\section{Introduction} |
| 554 |
|
| 555 |
\lipsum[1] |
| 556 |
|
| 557 |
\section{Conclusion} |
| 558 |
|
| 559 |
\lipsum[2] |
| 560 |
|
| 561 |
\end{document} |
| 562 |
% \end{macrocode} |
| 563 |
% \iffalse |
| 564 |
%</sample> |
| 565 |
% \fi% |
| 566 |
% |
| 567 |
% \StopEventually{% |
| 568 |
% \section{Acknowledgments} |
| 569 |
% |
| 570 |
% I would like to acknowledge Steven Douglas Cochran for authoring the |
| 571 |
% \Lpack{sf298} Package, which was used as a template for writing this |
| 572 |
% \Lpack{navydocs} Package. |
| 573 |
% |
| 574 |
% \begin{thebibliography}{6}% |
| 575 |
% \bibitem{Kopk-Daly93}% |
| 576 |
% Michel Goossens, Framk Mittelbach, and Alexander Samarin, |
| 577 |
% \emph{A Guide to \LaTeXe}, |
| 578 |
% 1993, 2$^{nd}$ edition (revised 1995). |
| 579 |
% \end{thebibliography}} |
| 580 |
% |
| 581 |
% \section{The {\tt DOCSTRIP} Modules} |
| 582 |
% The following modules are used in the implementation to direct |
| 583 |
% {\tt DOCSCRIPT} in generating the external files: |
| 584 |
% \begin{tabular}[t]{ll} |
| 585 |
% driver & produces a documentation driver file.\\ |
| 586 |
% package & produces the package navydocs.sty.\\ |
| 587 |
% sample & produces a sample \LaTeX\ template and test file. |
| 588 |
% \end{tabular} |
| 589 |
% |
| 590 |
% \newpage |
| 591 |
% \section{The code} |
| 592 |
% \iffalse |
| 593 |
%<*package> |
| 594 |
% \fi% |
| 595 |
% \subsection{Identification} |
| 596 |
% |
| 597 |
% \begin{macrocode} |
| 598 |
\NeedsTeXFormat{LaTeX2e} |
| 599 |
% Note that the YYYY/MM/DD format must be respected or an error will |
| 600 |
% be generated. |
| 601 |
\ProvidesPackage{navydocs}[2016/06/22 Navy Documents] |
| 602 |
\typeout{Package: navydocs 2016/07/01 v1.1)} |
| 603 |
% \end{macrocode} |
| 604 |
% |
| 605 |
% Define some commands for the abbreviation ``\eg'' and to retrieve the |
| 606 |
% current month as a name. |
| 607 |
% |
| 608 |
% \begin{macrocode} |
| 609 |
\providecommand{\eg}{{\it e.g.\/\ }} |
| 610 |
\newcommand{\MONTH}{% |
| 611 |
\ifcase\the\month |
| 612 |
\or January% 1 |
| 613 |
\or February% 2 |
| 614 |
\or March% 3 |
| 615 |
\or April% 4 |
| 616 |
\or May% 5 |
| 617 |
\or June% 6 |
| 618 |
\or July% 7 |
| 619 |
\or August% 8 |
| 620 |
\or September% 9 |
| 621 |
\or October% 10 |
| 622 |
\or November% 11 |
| 623 |
\or December% 12 |
| 624 |
\fi} |
| 625 |
% \end{macrocode} |
| 626 |
% |
| 627 |
% \subsection{Load the \Lpack{eso-pic} Package} |
| 628 |
% |
| 629 |
% Check to see if the \Lpack{eso-pic} package is present. If it is, |
| 630 |
% then load the package so we can put vertical text in the |
| 631 |
% left margin per Carderock/NSWC style requirement. If not, then |
| 632 |
% generate a package error. |
| 633 |
% |
| 634 |
% \begin{macrocode} |
| 635 |
\IfFileExists{eso-pic.sty}{% |
| 636 |
\usepackage{eso-pic, rotating}} |
| 637 |
{\PackageError {navydocs}{The eso-pic package was not found.} |
| 638 |
{Install the eso-pic package on your system.}} |
| 639 |
% \end{macrocode} |
| 640 |
% |
| 641 |
% \subsection{Load the \Lpack{mdframed} Package} |
| 642 |
% |
| 643 |
% Check to see if the \Lpack{mdframed} package is present. If it is, |
| 644 |
% then load the package so a vertical line can be drawn to indicate the |
| 645 |
% left margin per Carderock/NSWC style requirement. If not, then |
| 646 |
% generate a package error. |
| 647 |
% |
| 648 |
% \begin{macrocode} |
| 649 |
\IfFileExists{mdframed.sty}{% |
| 650 |
\usepackage[ |
| 651 |
linewidth=4pt, |
| 652 |
middlelinecolor= black, |
| 653 |
middlelinewidth=0.4pt, |
| 654 |
roundcorner=1pt, |
| 655 |
topline = false, |
| 656 |
rightline = false, |
| 657 |
bottomline = false, |
| 658 |
rightmargin=0pt, |
| 659 |
skipabove=0pt, |
| 660 |
skipbelow=0pt, |
| 661 |
leftmargin=0cm, |
| 662 |
innerleftmargin=1cm, |
| 663 |
innerrightmargin=0pt, |
| 664 |
innertopmargin=0pt, |
| 665 |
innerbottommargin=0pt, |
| 666 |
]{mdframed}} |
| 667 |
{\PackageError {mdframed}{The mdframed package was not found.} |
| 668 |
{Install the mdframed package on your system.}} |
| 669 |
% \end{macrocode} |
| 670 |
% |
| 671 |
% \subsection{Load the \Lpack{fancyhdr} Package} |
| 672 |
% |
| 673 |
% Check to see if the \Lpack{fancyhdr} package is present. If it is, then load the package to |
| 674 |
% define a custom footer. If it is not present then report error and terminate. This package |
| 675 |
% is needed to define a custom footer where the form identifier appears on the Technical |
| 676 |
% Components page produced by \cmd{\MakeCarderockDivPage}. |
| 677 |
% |
| 678 |
% \begin{macrocode} |
| 679 |
\IfFileExists{fancyhdr.sty}{% |
| 680 |
\usepackage{fancyhdr}} |
| 681 |
{\PackageError {navydocs}{The fancyhdr package was not found.} |
| 682 |
{Install the fancyhdr package on your system.}} |
| 683 |
% \end{macrocode} |
| 684 |
% |
| 685 |
% \subsection{Load the \Lpack{relsize} Package} |
| 686 |
% |
| 687 |
% Check to see if the \Lpack{relsize} package is present. If it is, then load the package to |
| 688 |
% allow the font in the margin title to be one size down from whatever is currently being used |
| 689 |
% by default. |
| 690 |
% |
| 691 |
% \begin{macrocode} |
| 692 |
\IfFileExists{relsize.sty}{% |
| 693 |
\usepackage{relsize}} |
| 694 |
{\PackageError {navydocs}{The relsize package was not found.} |
| 695 |
{Install the relsize package on your system.}} |
| 696 |
% \end{macrocode} |
| 697 |
% |
| 698 |
% \subsection{Load the \Lpack{setspace} Package} |
| 699 |
% |
| 700 |
% Check to see if the \Lpack{setspace} package is present. If it is, then load the package to |
| 701 |
% allow line spacing to be controlled in sections of the document such as those generated |
| 702 |
% by \cmd{\MakeCarderockDivPage}. |
| 703 |
% |
| 704 |
% \begin{macrocode} |
| 705 |
\IfFileExists{setspace.sty}{% |
| 706 |
\usepackage{setspace}} |
| 707 |
{\PackageError {navydocs}{The setspace package was not found.} |
| 708 |
{Install the setspace package on your system.}} |
| 709 |
% \end{macrocode} |
| 710 |
% |
| 711 |
% \subsection{Load the \Lpack{xparse} Package} |
| 712 |
% |
| 713 |
% Check to see if the \Lpack{xparse} package is present. If it is, then load the package to |
| 714 |
% allow a command to be defined with more than one option. This package is used to define |
| 715 |
% the \cmd{\NavyMarginTitle} command with two optional arguments for placement of the |
| 716 |
% margin title. |
| 717 |
% |
| 718 |
% \begin{macrocode} |
| 719 |
\IfFileExists{xparse.sty}{% |
| 720 |
\usepackage{xparse}} |
| 721 |
{\PackageError {navydocs}{The xparse package was not found.} |
| 722 |
{Install the xparse package on your system.}} |
| 723 |
% \end{macrocode} |
| 724 |
% |
| 725 |
% \subsection{The User Interface} |
| 726 |
% |
| 727 |
% The following macros define the external and internal portions of the |
| 728 |
% user interface. These macros are used to fill the various items on the |
| 729 |
% title page. All the macros have the same pattern: a public version which |
| 730 |
% sets the internal value, both based on the item name. |
| 731 |
% |
| 732 |
% \begin{macro}{\NavyDivision} |
| 733 |
% \begin{macro}{\navy@Division} |
| 734 |
% \begin{macrocode} |
| 735 |
\newcommand\NavyDivision[1]{\renewcommand\navy@Division{#1\hfill}} |
| 736 |
\newcommand\navy@Division{\relax} |
| 737 |
% \end{macrocode} |
| 738 |
% \end{macro} |
| 739 |
% \end{macro} |
| 740 |
% |
| 741 |
% \begin{macro}{\NavyDivisionLocation} |
| 742 |
% \begin{macro}{\navy@Location} |
| 743 |
% \begin{macrocode} |
| 744 |
\newcommand\NavyDivisionLocation[1]{\renewcommand\navy@Location{#1\hfill}} |
| 745 |
\newcommand\navy@Location{\relax} |
| 746 |
% \end{macrocode} |
| 747 |
% \end{macro} |
| 748 |
% \end{macro} |
| 749 |
% |
| 750 |
% The \cmd{\NavyReportNumber} command is defined so the user |
| 751 |
% can use it to both specify and retrieve the report number. Use |
| 752 |
% of the command with an argument will specify the report number, |
| 753 |
% while call it will return the currently save report number. The latter |
| 754 |
% feature is useful when wishing to have the report number appear in |
| 755 |
% the cover page such as the margin title as shown in the example |
| 756 |
% given in Section~\ref{sec:sample} above. |
| 757 |
% |
| 758 |
% \begin{macro}{\NavyReportNumber} |
| 759 |
% \begin{macro}{\navy@ReportNumber} |
| 760 |
% \begin{macrocode} |
| 761 |
\newcommand\NavyReportNumber[1]{ |
| 762 |
\ifx&% |
| 763 |
% Empty argument so use existing report number |
| 764 |
\navy@ReportNumber |
| 765 |
\else |
| 766 |
% Use argument for report number |
| 767 |
\renewcommand\navy@ReportNumber{#1} |
| 768 |
\fi |
| 769 |
} |
| 770 |
\newcommand\navy@ReportNumber{\relax} |
| 771 |
% \end{macrocode} |
| 772 |
% \end{macro} |
| 773 |
% \end{macro} |
| 774 |
% |
| 775 |
% \begin{macro}{\NavyReportDate} |
| 776 |
% \begin{macro}{\navy@ReportDate} |
| 777 |
% \begin{macrocode} |
| 778 |
\newcommand\NavyReportDate[1]{\renewcommand\navy@ReportDate{#1\hfill}} |
| 779 |
\newcommand\navy@ReportDate{\number\day~\MONTH~\number\year} |
| 780 |
% \end{macrocode} |
| 781 |
% \end{macro} |
| 782 |
% \end{macro} |
| 783 |
% |
| 784 |
% \begin{macro}{\NavyReportType} |
| 785 |
% \begin{macro}{\navy@ReportType} |
| 786 |
% \begin{macrocode} |
| 787 |
\newcommand\NavyReportType[1]{\renewcommand\navy@ReportType{#1\hfill}} |
| 788 |
\newcommand\navy@ReportType{\relax} |
| 789 |
% \end{macrocode} |
| 790 |
% \end{macro} |
| 791 |
% \end{macro} |
| 792 |
% |
| 793 |
% \begin{macro}{\NavyReportTitle} |
| 794 |
% \begin{macro}{\navy@ReportTitle} |
| 795 |
% \begin{macrocode} |
| 796 |
\newcommand\NavyReportTitle[1]{\renewcommand\navy@ReportTitle{#1\hfill}} |
| 797 |
\newcommand\navy@ReportTitle{\relax} |
| 798 |
% \end{macrocode} |
| 799 |
% \end{macro} |
| 800 |
% \end{macro} |
| 801 |
% |
| 802 |
% \begin{macro}{\NavyAuthor} |
| 803 |
% \begin{macro}{\navy@Author} |
| 804 |
% \begin{macrocode} |
| 805 |
\newcommand\NavyAuthor[1]{\renewcommand\navy@Author{#1\hfill}} |
| 806 |
\newcommand\navy@Author{\relax} |
| 807 |
% \end{macrocode} |
| 808 |
% \end{macro} |
| 809 |
% \end{macro} |
| 810 |
% |
| 811 |
% \begin{macro}{\NavyDistributionStatement} |
| 812 |
% \begin{macro}{\navy@DistributionStatement} |
| 813 |
% \begin{macrocode} |
| 814 |
\newcommand\NavyDistributionStatement[1] |
| 815 |
{\renewcommand\navy@DistributionStatement{#1\hfill}} |
| 816 |
\newcommand\navy@DistributionStatement{ |
| 817 |
Approved for public release; distribution is unlimited.\hfill |
| 818 |
} |
| 819 |
% \end{macrocode} |
| 820 |
% \end{macro} |
| 821 |
% \end{macro} |
| 822 |
% |
| 823 |
% The macro \cmd{\NavyMarginTitle} is defined so an optional title can |
| 824 |
% appear in the left hand margin of the cover page, oriented in a vertical |
| 825 |
% position. It accepts two optional arguments that define the bottom left |
| 826 |
% placement of the margin title in order to allow the user control over its |
| 827 |
% exact placement, if needed. This is achieved by defining two variables |
| 828 |
% (xmargin,ymargin) that are used later in the \cmd{\AddToShipoutPicture} |
| 829 |
% command. By default, the margin title will be placed at the margin paragraph |
| 830 |
% width and the bottom of the text height area. Two helper functions are |
| 831 |
% defined to properly account for the offset depending on whether the |
| 832 |
% margin text occupies 1 or 2 lines. |
| 833 |
% |
| 834 |
% \begin{macro}{\countlines} |
| 835 |
% |
| 836 |
% The macro \cmd{\countlines} is a helper function that counts the |
| 837 |
% number of lines in a text block so the offset for the margin title |
| 838 |
% can be properly determined. |
| 839 |
% |
| 840 |
% \begin{macrocode} |
| 841 |
\newcommand\countlines[1]{ |
| 842 |
{\setbox0\vbox{\noindent{#1}\par |
| 843 |
\count@\z@ |
| 844 |
\loop |
| 845 |
\unskip\unpenalty\unskip\unpenalty\unskip |
| 846 |
\setbox0\lastbox |
| 847 |
\ifvoid0 |
| 848 |
\xdef\numlines{\the\count@} |
| 849 |
\else |
| 850 |
\advance\count@\@ne |
| 851 |
\repeat}} |
| 852 |
} |
| 853 |
% \end{macrocode} |
| 854 |
% \end{macro} |
| 855 |
% |
| 856 |
% \begin{macro}{\countlines} |
| 857 |
% |
| 858 |
% The macro \cmd{\getmargintextheight} is a helper function that |
| 859 |
% calculates the height of a line in a text block so the offset for the |
| 860 |
% margin title can be properly calculated. |
| 861 |
% |
| 862 |
% \begin{macrocode} |
| 863 |
\newcommand\getmargintextheight[1]{ |
| 864 |
\newdimen\margintextheight |
| 865 |
\setbox0=\vbox{#1} |
| 866 |
\margintextheight=\ht0 \advance\margintextheight by \dp0 |
| 867 |
% count number of lines so height of each line can be found |
| 868 |
\countlines{#1} |
| 869 |
% now determine height of each line |
| 870 |
\margintextheight=\the\dimexpr \margintextheight / \numlines |
| 871 |
} |
| 872 |
% \end{macrocode} |
| 873 |
% \end{macro} |
| 874 |
% |
| 875 |
% \begin{macro}{\NavyMarginTitle} |
| 876 |
% \begin{macro}{\navy@MarginTitle} |
| 877 |
% \begin{macro}{\marginoffset} |
| 878 |
% |
| 879 |
% The \cmd{\NavyMarginTitle} command is now defined for two optional |
| 880 |
% arguments using the \cmd{\DeclareDocumentCommand} from the usepackage |
| 881 |
% xparse. No margin title will appear if \cmd{\NavyMarginTitle} is called with an |
| 882 |
% empty argument. The \cmd{\marginoffset} command calculates the |
| 883 |
% default offset for the margin title when it contains 2 lines in the text block. |
| 884 |
% |
| 885 |
% \begin{macrocode} |
| 886 |
\newif\ifmargin |
| 887 |
\margintrue |
| 888 |
|
| 889 |
\def\marginoffset{\the\dimexpr -\margintextheight*(\numlines - 1) + |
| 890 |
\margintextheight*(\numlines - 1)/2} |
| 891 |
|
| 892 |
\def\navy@xmargin{ |
| 893 |
\LenToUnit{\leftmargin - \oddsidemargin + \marginparwidth/2 |
| 894 |
+ \marginoffset}} |
| 895 |
\def\navy@ymargin{\LenToUnit{\paperheight - \textheight + \topmargin}} |
| 896 |
\newcommand\xmargin{\navy@xmargin} |
| 897 |
\newcommand\ymargin{\navy@ymargin} |
| 898 |
|
| 899 |
\DeclareDocumentCommand{\NavyMarginTitle} |
| 900 |
{ |
| 901 |
O{ \LenToUnit{\leftmargin - \oddsidemargin + \marginparwidth/2 |
| 902 |
+ \marginoffset} } |
| 903 |
O{ \LenToUnit{\paperheight - \textheight + \topmargin} } m }{ |
| 904 |
\renewcommand\xmargin{#1} |
| 905 |
\renewcommand\ymargin{#2} |
| 906 |
\ifx&% |
| 907 |
% Empty argument so suppress margin title |
| 908 |
\marginfalse |
| 909 |
\else |
| 910 |
% Use mandatory argument for margin title |
| 911 |
|
| 912 |
% get height of each line for margin offset calculation |
| 913 |
\getmargintextheight{#3} |
| 914 |
|
| 915 |
\renewcommand\navy@MarginTitle{#3} |
| 916 |
\fi |
| 917 |
} |
| 918 |
\newcommand\navy@MarginTitle{\relax} |
| 919 |
% \end{macrocode} |
| 920 |
% \end{macro} |
| 921 |
% \end{macro} |
| 922 |
% \end{macro} |
| 923 |
% |
| 924 |
% \begin{macro}{\NavyFormID} |
| 925 |
% |
| 926 |
% The macro \cmd{\NavyFormID\{FormID\}} is defined so a form |
| 927 |
% identifier can be placed at the bottom of a page. It is currently used |
| 928 |
% by the macro \cmd{\MakeCarderockDivPage} when producing the |
| 929 |
% Technical Components page used by the Carderock Divison/NSWC. An |
| 930 |
% example FormID for the latter is ``NDW-DTRC 5602/51 (Rev. 7-93)''. |
| 931 |
% This macro can be used in new macros that are created for other |
| 932 |
% Supplementary Material pages required by Navy organizations. It |
| 933 |
% can also easily be copied and modified for a different \cmd{\fancypagestyle} |
| 934 |
% as supported by the\Lpack{fancyhdr} Package. |
| 935 |
% |
| 936 |
% \begin{macrocode} |
| 937 |
\newcommand\NavyFormID[1]{ |
| 938 |
\fancypagestyle{NavyFormIDStyle} |
| 939 |
{\fancyhf{}\renewcommand{\headrulewidth}{0pt} |
| 940 |
\fancyfoot[L]{\scriptsize #1}} } |
| 941 |
% \end{macrocode} |
| 942 |
% \end{macro} |
| 943 |
% |
| 944 |
% \subsection{Error checking and reporting} |
| 945 |
% |
| 946 |
% \begin{macro}{\ifnavy@undef} |
| 947 |
% \begin{macro}{\navy@undeftrue} |
| 948 |
% \begin{macro}{\navy@undeffalse} |
| 949 |
% |
| 950 |
% This switch is used by the error reporting at the end of the document |
| 951 |
% to generate a general message that there was an undefined required |
| 952 |
% field. |
| 953 |
% |
| 954 |
% \begin{macrocode} |
| 955 |
\newif\ifnavy@undef |
| 956 |
\navy@undeffalse |
| 957 |
% \end{macrocode} |
| 958 |
% \end{macro} |
| 959 |
% \end{macro} |
| 960 |
% \end{macro} |
| 961 |
% |
| 962 |
% \begin{macro}{\navy@undefined} |
| 963 |
% |
| 964 |
% The \cmd{\navy@undefined} macro is executed with the optional argument for |
| 965 |
% each required field and without the optional argument at the end of |
| 966 |
% the document. |
| 967 |
% |
| 968 |
% \begin{macrocode} |
| 969 |
\newcommand{\navy@undefined}[1][\@empty]{% |
| 970 |
\ifx \@empty#1\relax |
| 971 |
\ifnavy@undef |
| 972 |
\typeout{^^J% |
| 973 |
navydocs Warning: There are required fields that are |
| 974 |
undefined.% |
| 975 |
^^J}% |
| 976 |
\fi |
| 977 |
\else |
| 978 |
\navy@undeftrue |
| 979 |
\typeout{^^J% |
| 980 |
navydocs Warning: \expandafter\string\csname #1 |
| 981 |
\endcsname\space is undefined.% |
| 982 |
^^J}% |
| 983 |
\fi} |
| 984 |
% \end{macrocode} |
| 985 |
% \end{macro} |
| 986 |
% |
| 987 |
% \begin{macro}{\navy@checkfield} |
| 988 |
% |
| 989 |
% This macro does the actual checking for undefined required fields. |
| 990 |
% Because of the different sorts of field definitions that could be |
| 991 |
% created, it was easier to just fill a box with whatever the user |
| 992 |
% defined and check to see if the box has a non-zero width. You could |
| 993 |
% defeat this if you really wanted to, but it should work for reasonable |
| 994 |
% field values. |
| 995 |
% |
| 996 |
% \begin{macrocode} |
| 997 |
\newcommand{\navy@checkfield}[1]{% |
| 998 |
\setbox\@tempboxa\vbox{\csname navy@#1\endcsname}% |
| 999 |
\ifdim \wd\@tempboxa =0pt |
| 1000 |
\navy@undefined[#1] |
| 1001 |
\fi} |
| 1002 |
% \end{macrocode} |
| 1003 |
% \end{macro} |
| 1004 |
% |
| 1005 |
% \begin{macrocode} |
| 1006 |
\AtEndDocument{\navy@undefined} |
| 1007 |
% \end{macrocode} |
| 1008 |
% |
| 1009 |
% \subsection{Page layout} |
| 1010 |
% |
| 1011 |
% This is the part of the code that actually produces the title page and |
| 1012 |
% any supplementary material pages. After the pages are produced, most |
| 1013 |
% of the macros are set to \cmd{\relax} in order to recover as much |
| 1014 |
% pool space as possible. |
| 1015 |
% |
| 1016 |
% \subsubsection{Form setup and cleanup} |
| 1017 |
% |
| 1018 |
% \begin{macro}{\NavyTitlePage} |
| 1019 |
% |
| 1020 |
% At the end of the \cmd{\titlepage} command, the \cmd{\thanks} macro is |
| 1021 |
% redefined to be \cmd{\relax}. If we want to define the title once and |
| 1022 |
% also want to be able to have a \cmd{\thanks} message associated with the |
| 1023 |
% title on the titlepage, and want to use that same title text on the |
| 1024 |
% report documentation page, then we need to redefine the \cmd{\thanks} |
| 1025 |
% macro to eat it's argument. This is done by setting \cmd{\thanks} to |
| 1026 |
% \cmd{\@gobble} while printing the report title page. |
| 1027 |
% |
| 1028 |
% \begin{macrocode} |
| 1029 |
\newcommand{\NavyTitlePage}{% |
| 1030 |
\global\let\thanks\@gobble |
| 1031 |
\MakeNavyTitlePage |
| 1032 |
\global\let\thanks\relax} |
| 1033 |
% \end{macrocode} |
| 1034 |
% \end{macro} |
| 1035 |
% |
| 1036 |
% \begin{macro}{\MakeNavyTitlePage} |
| 1037 |
% |
| 1038 |
% The \cmd{\MakeNavyTitlePage} command creates the Report Title Page |
| 1039 |
% using the information defined by the associated field macros. This |
| 1040 |
% should be used at the beginning of a deliverable report. |
| 1041 |
% |
| 1042 |
% \begin{macrocode} |
| 1043 |
\newcommand\MakeNavyTitlePage{% |
| 1044 |
% \end{macrocode} |
| 1045 |
% |
| 1046 |
% If the \Lpack{twoside} option is specified in the \cmd{\documentclass}, then |
| 1047 |
% it is printed as a separate page with a blank back. This page is treated |
| 1048 |
% as page `{\it i}' (if the documentclass \Lpack{twoside} option is |
| 1049 |
% specified, then the back treated as page `{\it ii}'. |
| 1050 |
% |
| 1051 |
% \begin{macrocode} |
| 1052 |
\newpage |
| 1053 |
\if@twoside\ifodd\c@page\else |
| 1054 |
\null |
| 1055 |
\thispagestyle{empty}% |
| 1056 |
\newpage |
| 1057 |
\fi\fi |
| 1058 |
% \end{macrocode} |
| 1059 |
% |
| 1060 |
% Check for missing required fields. If the field value is missing, then |
| 1061 |
% print a warning. In the case of the number of pages, if the |
| 1062 |
% \Lpack{totpages} package was loaded, then calculate the value, else if |
| 1063 |
% the total pages is not given, then give a warning. |
| 1064 |
% |
| 1065 |
% \begin{macrocode} |
| 1066 |
\navy@checkfield{Division} |
| 1067 |
\navy@checkfield{Location} |
| 1068 |
\navy@checkfield{ReportNumber} |
| 1069 |
\navy@checkfield{ReportDate} |
| 1070 |
\navy@checkfield{ReportType} |
| 1071 |
\navy@checkfield{ReportTitle} |
| 1072 |
\navy@checkfield{Author} |
| 1073 |
\navy@checkfield{DistributionStatement} |
| 1074 |
% \end{macrocode} |
| 1075 |
% |
| 1076 |
% Next define a picture that contains the report title oriented vertically |
| 1077 |
% to be put in the left margin of the title page. This is done to conform |
| 1078 |
% to Carderock/NSWC title page format requirements. |
| 1079 |
% |
| 1080 |
% \begin{macrocode} |
| 1081 |
\ifmargin |
| 1082 |
\AddToShipoutPicture*{\put(\xmargin,\ymargin) |
| 1083 |
{\rotatebox{90} |
| 1084 |
{\scalebox{1}{\parbox[t]{\textheight} |
| 1085 |
{\textbf{\small \navy@MarginTitle}} |
| 1086 |
}}}} |
| 1087 |
\fi |
| 1088 |
% \end{macrocode} |
| 1089 |
% |
| 1090 |
% The set up is now done, so start the title page and use the {\it mdframed} |
| 1091 |
% environment to create a vertical rule along the left margin. |
| 1092 |
% |
| 1093 |
% \begin{macrocode} |
| 1094 |
\begin{titlepage} |
| 1095 |
|
| 1096 |
\noindent |
| 1097 |
\begin{minipage}[t]{\textwidth} |
| 1098 |
\begin{mdframed} |
| 1099 |
% \end{macrocode} |
| 1100 |
% |
| 1101 |
% Next put the Navy division and location at the top of the page followed |
| 1102 |
% by a thick and then thin line that runs horizontally across the page. |
| 1103 |
% |
| 1104 |
% \begin{macrocode} |
| 1105 |
\parbox[t][0.98\textheight][t]{\textwidth}{ |
| 1106 |
\noindent\textbf{\large \navy@Division} |
| 1107 |
\vskip3mm |
| 1108 |
\noindent\textbf{\small \navy@Location} |
| 1109 |
\vskip3mm |
| 1110 |
\noindent\rule{\textwidth}{4pt} % thick line across page |
| 1111 |
\vskip-8pt |
| 1112 |
\noindent\rule{\textwidth}{2pt} % thinner line across page |
| 1113 |
% \end{macrocode} |
| 1114 |
% |
| 1115 |
% Vertically skip 4\,mm and state the report number, report date, and report type. |
| 1116 |
% |
| 1117 |
% \begin{macrocode} |
| 1118 |
\vspace{4mm}\\ |
| 1119 |
\noindent |
| 1120 |
\navy@ReportNumber \ \navy@ReportDate \\ \navy@ReportType \\ |
| 1121 |
% \end{macrocode} |
| 1122 |
% |
| 1123 |
% Vertically skip 1.7\,cm and insert the report tiltle and author(s). Note that the |
| 1124 |
% blank lines are needed in order for the \cmd{\vspace} to work properly. |
| 1125 |
% |
| 1126 |
% \begin{macrocode} |
| 1127 |
\vspace{1.7cm}\\ |
| 1128 |
{\Large \textbf{\navy@ReportTitle} |
| 1129 |
\vspace{1cm}\\ |
| 1130 |
\normalsize |
| 1131 |
\noindent |
| 1132 |
by \\ \navy@Author |
| 1133 |
}\\ |
| 1134 |
% \end{macrocode} |
| 1135 |
% |
| 1136 |
% Finish adding the content to the page by placing the Navy logo and the Distribution |
| 1137 |
% Statement at the bottom, closing off the page with a horizontal rule. Note that the |
| 1138 |
% Distribution Statement outlined by horizontal lines is produced within a {\it minipage} |
| 1139 |
% environment. |
| 1140 |
% |
| 1141 |
% \begin{macrocode} |
| 1142 |
\vfill |
| 1143 |
\noindent |
| 1144 |
\includegraphics[width=21mm]{graphics/navy-logo-102.png} |
| 1145 |
\hspace{0.6in} |
| 1146 |
\begin{minipage}{0.75\textwidth} |
| 1147 |
\vspace{-0.8cm} |
| 1148 |
\hrule height 4pt |
| 1149 |
\vspace{4pt} |
| 1150 |
\noindent |
| 1151 |
\parbox[c]{\textwidth}{ |
| 1152 |
\vspace{4pt} |
| 1153 |
\textbf{\small \navy@DistributionStatement} |
| 1154 |
\vspace{4pt} |
| 1155 |
} |
| 1156 |
\hrule height 4pt |
| 1157 |
\end{minipage}} |
| 1158 |
% \end{macrocode} |
| 1159 |
% |
| 1160 |
% Finish up the tiitle page. |
| 1161 |
% |
| 1162 |
% \begin{macrocode} |
| 1163 |
\end{mdframed} |
| 1164 |
\end{minipage} |
| 1165 |
\end{titlepage} |
| 1166 |
% \end{macrocode} |
| 1167 |
% |
| 1168 |
% Finally, the last step is to set all of the now unused definitions to |
| 1169 |
% \cmd{\relax}, thereby freeing some space. |
| 1170 |
% |
| 1171 |
% \begin{macrocode} |
| 1172 |
% \thispagestyle{empty} |
| 1173 |
|
| 1174 |
\global\let\NavyDivision\relax |
| 1175 |
\global\let\navy@Division\relax |
| 1176 |
\global\let\Location\relax |
| 1177 |
\global\let\navy@Location\relax |
| 1178 |
\global\let\ReportNumber\relax |
| 1179 |
\global\let\navy@ReportNumber\relax |
| 1180 |
\global\let\NavyReportDate\relax |
| 1181 |
\global\let\navy@ReportDate\relax |
| 1182 |
\global\let\NavyReportType\relax |
| 1183 |
\global\let\navy@ReportType\relax |
| 1184 |
\global\let\ReportTitle\relax |
| 1185 |
\global\let\navy@ReportTitle\relax |
| 1186 |
\global\let\NavyAuthor\relax |
| 1187 |
\global\let\navy@Author\relax |
| 1188 |
\global\let\NavyRelease\relax |
| 1189 |
\global\let\navy@DistributionStatement\relax |
| 1190 |
\global\let\MarginTitle\relax |
| 1191 |
\global\let\navy@MarginTitle\relax |
| 1192 |
|
| 1193 |
\global\let\MakeNavyCoverPage\relax} % end of \MakeNavyCoverPage |
| 1194 |
% \end{macrocode} |
| 1195 |
% \end{macro} |
| 1196 |
% |
| 1197 |
% \begin{macro}{\MakeCarderockDivPage} |
| 1198 |
% |
| 1199 |
% The \cmd{\MakeCarderockDivPage} command creates the Technical Components |
| 1200 |
% page for the Carderock Division/NSWC. The text for the page is explicitly included |
| 1201 |
% in this initial release of the package, rather than passed into the macro via a user |
| 1202 |
% interface, because it is not known at the time of writing what are the requirements |
| 1203 |
% of other Navy organizations. This is subject to change in future if there is a need |
| 1204 |
% and demand to do so. |
| 1205 |
% |
| 1206 |
% The Technical Components page is produced using the fancy page style defined |
| 1207 |
% via the \cmd{\NavyFormID} described above so the document code appears |
| 1208 |
% in the footer. |
| 1209 |
% |
| 1210 |
% \begin{macrocode} |
| 1211 |
\newcommand\MakeCarderockDivPage{% |
| 1212 |
\thispagestyle{NavyFormIDStyle} % insert document code in footer |
| 1213 |
% \end{macrocode} |
| 1214 |
% |
| 1215 |
% Insert page title at the top in reverse image followed by the list of Navy codes |
| 1216 |
% residing at Carderock/NSWC. |
| 1217 |
% |
| 1218 |
% \begin{macrocode} |
| 1219 |
\section*{ \sffamily\colorbox{black}{\bfseries\textcolor{white} |
| 1220 |
{\large MAJOR CARDEROCK DIVISION TECHNICAL COMPONENTS}} } |
| 1221 |
\vspace{8ex} |
| 1222 |
|
| 1223 |
\doublespace |
| 1224 |
\begin{tabular}{lrl} |
| 1225 |
CODE & 011 & Director of Technology \\ |
| 1226 |
& 10 & Machinery Systems/Programs and Logistics Directorate \\ |
| 1227 |
& 20 & Ship Systems \& Programs Directorate \\ |
| 1228 |
& 50 & Hydromechanics Directorate \\ |
| 1229 |
& 60 & Survivability, Structures and Materials Directorate \\ |
| 1230 |
& 70 & Signatures Directorate \\ |
| 1231 |
& 80 & Machinery Research \& Development Directorate \\ |
| 1232 |
& 90 & Machinery In-Service Engineering Directorate |
| 1233 |
\end{tabular} |
| 1234 |
\singlespace |
| 1235 |
% \end{macrocode} |
| 1236 |
% |
| 1237 |
% State types of reports produced by the division at the bottom of the page in a framed box. |
| 1238 |
% |
| 1239 |
% \begin{macrocode} |
| 1240 |
\vfill % push minipage to bottom of page |
| 1241 |
|
| 1242 |
\noindent |
| 1243 |
\fbox{\begin{minipage}{\textwidth} |
| 1244 |
\vspace{2ex} |
| 1245 |
\begin{center} |
| 1246 |
CARDEROCK DIVISION, NSWC, ISSUES THREE TYPES OF REPORTS: |
| 1247 |
\end{center} |
| 1248 |
|
| 1249 |
\parbox{0.97\textwidth}{ |
| 1250 |
\begin{enumerate} |
| 1251 |
\item \textbf{CARDEROCKDIV reports, a formal series,} contain information |
| 1252 |
of permanent technical value. They carry a consecutive numerical |
| 1253 |
identification regardless of their classification or the originating |
| 1254 |
directorate. |
| 1255 |
\item \textbf{Directorate reports, a semiformal series,} contain |
| 1256 |
information of a preliminary, temporary, or proprietary nature or of |
| 1257 |
limited interest or significance. They carry an alpha numeric |
| 1258 |
identification issued by the originating directorate. |
| 1259 |
\item \textbf{Technical memoranda, an informal series,} contain |
| 1260 |
technical documentation of limited use and interest. They are primarily |
| 1261 |
working papers intended for internal use. They carry an identifying |
| 1262 |
number which indicates their type and the numerical code of the |
| 1263 |
originating directorate. Any distribution outside CARDEROCKDIV must be |
| 1264 |
approved by the head of the originating directorate on a case-by-case |
| 1265 |
basis. |
| 1266 |
\end{enumerate} |
| 1267 |
} |
| 1268 |
\vspace{1ex} |
| 1269 |
|
| 1270 |
\end{minipage}} |
| 1271 |
% \end{macrocode} |
| 1272 |
% |
| 1273 |
% Force new page and close the \cmd{\MakeCarderockDivPage} macro. |
| 1274 |
% |
| 1275 |
% \begin{macrocode} |
| 1276 |
\newpage |
| 1277 |
\global\let\MakeCarderockDivPage\relax} % end of \MakeCarderockDivPage |
| 1278 |
% \end{macrocode} |
| 1279 |
% \end{macro} |
| 1280 |
% |
| 1281 |
% \iffalse |
| 1282 |
%</package> |
| 1283 |
% \fi% |
| 1284 |
% |
| 1285 |
% \Finale |
| 1286 |
% |