This is the first pass of incorporating review commments from the
[dwarf-doc.git] / dwarf5 / latexdoc / dwarf5.tex
index 1a2c199..6544b90 100644 (file)
@@ -1,21 +1,25 @@
-\documentclass[12pt,letterpaper,oneside]{memoir} 
+\documentclass[12pt,letterpaper,twoside]{memoir} 
 % for debugging, add 'draft' (without quotes) to the [] document class list.
 % If draft is in the document class list, pix are just suggested
 % by an outline, the pic does not appear as a picture.
 %
-\usepackage{url} % For color in letters. Links instead?
-\usepackage{color} % For color in letters. Links instead?
-\usepackage{ellipsis} % Provides ... as \dots
-\usepackage{color}
+\newcommand{\docdate}{19 April 2013 (***Draft***)}
+%
+\usepackage{url}                  % For color in letters. Links instead?
+\usepackage[usenames]{color} % For color in letters. Links instead?
+\usepackage{ellipsis}     % Provides ... as \dots
+%\usepackage{color}
 \usepackage{listings}
 \usepackage{alltt}
 \lstset{ %
-language=C++,              % choose the language of the code
+language={},               % choose the language of the code
 basicstyle=\footnotesize,  % the size of the fonts that are used for the code
 numbers=left,              % where to put the line-numbers
 numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
-stepnumber=1,              % the step between two line-numbers. If it is 1 each line will be numbered
-numbersep=5pt,             % how far the line-numbers are from the code
+numberfirstline=true,
+firstnumber=1,             % first line number in each listing
+stepnumber=5,              % the step between two line-numbers. If it is 1 each line will be numbered
+numbersep=10pt,            % how far the line-numbers are from the code
 backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
 showspaces=false,          % show spaces adding particular underscores
 showstringspaces=false,    % underline spaces within strings
@@ -30,29 +34,34 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 
 \usepackage{amsmath}       % Provides \nobreakdash
 \usepackage{graphicx}      % For pictures
-\usepackage{longtable}
+\usepackage{longtable}     % For multipage tables
 \usepackage{varioref}      % defines \vref
 % \textregistered is the trademark symbol
 \usepackage[headheight=16pt,paper=letterpaper]{geometry}
 \setlength{\headheight}{15pt}  % avoids warning from latex
-\usepackage{epic} % For eepic package 
-\usepackage{eepic} % For the diagram of section relationships
-\usepackage{makeidx}
+\usepackage{needspace}     % For assuring space remaining on a page
+\usepackage{ifthen}        % For conditional processing
+\usepackage{changepage}    % For odd/even page checks
+\usepackage{epic}          % For eepic package 
+\usepackage{eepic}         % For the diagram of section relationships
+\usepackage{eepicemu}      % For the diagram of section relationships
+\usepackage{makeidx}       % For making an index
 % hyperref must be the last package listed.
 % The hyperref settings helps hypertext get right links in the 
 % pdf of the index.
-\usepackage[plainpages=false,pdfpagelabels,pagebackref]{hyperref}  % Lets us generate colored active links inside a pdf.
+\usepackage[plainpages=false,pdfpagelabels,pagebackref,allcolors=blue]{hyperref} % Lets us generate colored active links inside a pdf.
 \makeindex  % This and the makeidx package allow \index to create index entries.
 
-\newcommand{\docdate}{20 December 2012}
+\renewcommand{\familydefault}{phv}  % font family helvetica
 
 \newcommand{\dwf}{DWARF Debugging Information Format}
+
 \newenvironment{myindentpara}[1]%
- {\begin{list}{}%
-   {\setlength{\leftmargin}{#1}}%
-   \item[]%
- }
- {\end{list}}
 {\begin{list}{}%
+    {\setlength{\leftmargin}{#1}}%
+    \item[]%
 }
 {\end{list}}
 
 % broken somehow.
 %\newcommand{\myindent1}[1]{\begin{myindentpara}{1cm}#1\end{myindentpara}}
@@ -63,6 +72,16 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
   pdftitle={\dwf\ Version 4.1}
 }
 
+% An environment to create a listing-like (boxed) presentation for DWARF examples
+% Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
+% but does full LaTex processing within its scope (unlike \verb).
+\newsavebox{\savedwf}
+\newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
+  \begin{minipage}{\textwidth}\footnotesize}
+  {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
+% A helper to annotate the parts of a multipage figure
+\newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
+
 % Generate a page ref.
 % use like   \refersec{chap:registerbasedaddressing}
 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
@@ -96,15 +115,64 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \newcommand{\addtoindexi}[2]{#1\index{#2}}
 \newcommand{\addtoindexx}[1]{\index{#1}}
 
+% Quote commands that avoid need for inline UTF-8 in these sources
+\newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
+\newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
+
 % Better naming for the lowest level section header
-\newcommand{\subsubsubsection}[1]{\paragraph{#1}}
+\newcommand{\subsubsubsection}[1]{\paragraph{#1.}}
+
+% Issue \clearpage if less than n lines remain on page
+\newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
+
+% Helper for item lists with bold subject markers
+\newcommand{\itembf}[1]{\item \textbf{#1}}
+\newcommand{\itembfnl}[1]{\itembf{#1} \\}
+
+% And description lists with normal (not bold) text
+\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
+\newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
 
 % Reduce vertical space at beginning of a list
 \setlength{\topsep}{0in}
 
+\newcommand{\emptypage}{
+    \clearpage
+    \vspace*{4in}
+    \begin{center} \textit{(empty page)} \end{center}
+    }
+
+% A simple rule used in simple tables; default length is 2 inches
+\newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
+
+% A simple one column table of names; default width is 2 inches
+\newcommand{\simplenametablerule}{\simplerule[2in]}
+\newenvironment{simplenametable}[3][2in]
+    {   \begin{table}[here] \caption{#2} \label{#3}
+        \begin{center}
+        \renewcommand{\simplenametablerule}{\simplerule[#1]}
+        \simplenametablerule \\
+        \begin{tabular*}{#1}{l}
+        }
+    {   \end{tabular*}
+        \vspace{4pt} \\
+        \simplenametablerule \\
+        \end{center}
+        \end{table}
+        }
+
+\newcommand{\xffffffff}                {\texttt{0xffffffff}}                   % use with following punctutation
+\newcommand{\wffffffff}                {\texttt{0xffffffff}\ }                 % use as separate "word"
+\newcommand{\xfffffffzero}             {\texttt{0xfffffff0}}                   % use with following punctutation
+\newcommand{\wfffffffzero}             {\texttt{0xfffffff0}\ }
+\newcommand{\xffffffffffffffff}        {\texttt{0xffffffffffffffff}}   % use with following punctutation
+\newcommand{\wffffffffffffffff}        {\texttt{0xffffffffffffffff}\ }
+
+%--- Begin the document pages
+%
 \begin{document}
-\pagenumbering{roman}
-\pagestyle{empty}
+\frontmatter
+\thispagestyle{empty}
 
 \nonzeroparskip
 \setlength{\parindent}{0pt} 
@@ -118,33 +186,34 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \textbf{Version 4.1}
 
 \centering
-\includegraphics[keepaspectratio=true,scale=1.0]{DWlogo}
+\vspace{1cm}
+\includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
 
-\centering
-\vspace{1in}
+%\centering
+\vspace{2cm}
 \href{http://www.dwarfstd.org}{\dwf\ Committee}
+
+\vspace{1cm} 
 \url{http://www.dwarfstd.org}
 
 \large
-\vspace{1in}
+\vspace{2cm}
 \textbf{\docdate}
 
 \end{centering}
 
 %\clearpage
-\openany
+%\openany
 
-\frontmatter
 \textmd
 \normalsize
 \setlength{\headheight}{15pt}  
 
 \pagestyle{plain}
-\makeevenhead{plain}{}{}{}
-\makeoddhead{plain}{}{}{}
-\makeevenfoot{plain}{}{}{}
-\makeoddfoot{plain}{}{}{}
+%\makeevenhead{plain}{}{}{}
+%\makeoddhead{plain}{}{}{}
+%\makeevenfoot{plain}{}{}{}
+%\makeoddfoot{plain}{}{}{}
 
 \nonzeroparskip
 \setlength{\parindent}{0pt} 
@@ -159,7 +228,7 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \makeevenfoot{plain}{\docdate}{}{Page \thepage}
 \makeoddfoot{plain}{\docdate}{}{Page \thepage}
 
-\openany
+%\openany
 
 \nonzeroparskip
 \setlength{\parindent}{0pt} 
@@ -168,8 +237,9 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \include{copyright}
 \include{foreword}
 \include{foreword4.1}
+\emptypage
 
-\cleardoublepage
+\newpage
 \tableofcontents
 
 \cleardoublepage
@@ -178,48 +248,38 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \cleardoublepage
 \listoftables
 
+\flushleft
+\raggedbottom
+\chapterstyle{section}
 
-\mainmatter
-\pagenumbering{arabic}
-
-% Define the levels of sectionality that are numbered.
-\setcounter{secnumdepth}{5}
-
-\nonzeroparskip
 \setlength{\parindent}{0pt} 
 
 \makepagestyle{fragFirstChPage}
-
-\makeevenhead{fragFirstChPage}{}{}{}
-\makeoddhead{fragFirstChPage}{}{}{}
-\makeoddfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
-\makeevenfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
-
-\aliaspagestyle{chapter}{fragFirstChPage}
-
-
-
-\chapterstyle{section}
-
-
+    \makeevenhead{fragFirstChPage}{}{}{}
+    \makeoddhead{fragFirstChPage}{}{}{}
+    \makeoddfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
+    \makeevenfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
+\nouppercaseheads
 \aliaspagestyle{chapter}{fragFirstChPage}
 
-\flushleft
-
+% ----- Start the main part of the document -----
+\mainmatter
+% Define the levels of sectionality that are numbered.
+\setcounter{secnumdepth}{5}
 \include{introduction}
-\include{generaldescription}
-\include{programscope}
-\include{dataobject}
-\include{typeentries}
-\include{otherdebugginginformation}
-\include{datarepresentation}
+\include{generaldescription}            \emptypage
+\include{programscope}                  \emptypage
+\include{dataobject}                    \emptypage
+\include{typeentries}                   \emptypage
+\include{otherdebugginginformation} \emptypage
+\include{datarepresentation}            %\emptypage
 %  The \appendix toggles us into appendix chapters
 \appendix
 \include{attributesbytag}
-\include{debugsectionrelationships}
-\include{encodingdecoding}
-\include{examples}
-\include{compression}
+\include{debugsectionrelationships}     %\emptypage
+\include{encodingdecoding}              \emptypage
+\include{examples}                      %\emptypage
+\include{compression}                   %\emptypage
 \include{sectionversionnumbers}
 \include{gnulicense}
 \printindex