Complete figure to table conversion; other cleanups
[dwarf-doc.git] / dwarf5 / latexdoc / dwarf5.tex
index 564de7f..6d1bb6d 100644 (file)
@@ -1,4 +1,4 @@
-\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{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 +32,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{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{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]{hyperref} % Lets us generate colored active links inside a pdf.
 \makeindex  % This and the makeidx package allow \index to create index entries.
 
-\newcommand{\docdate}{19 December 2012}
+\renewcommand{\familydefault}{phv}  % font family helvetica
+
+\newcommand{\docdate}{31 January 2013}
 
 \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 +70,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 +113,46 @@ 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.}}
 
 % 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}
+        }
+
+%--- Begin the document pages
+%
 \begin{document}
-\pagenumbering{roman}
-\pagestyle{empty}
+\frontmatter
+\thispagestyle{empty}
 
 \nonzeroparskip
 \setlength{\parindent}{0pt} 
@@ -121,9 +169,10 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \includegraphics[keepaspectratio=true,scale=1.0]{DWlogo}
 
 \centering
-\vspace{1in}
+\vspace{3cm}
 \href{http://www.dwarfstd.org}{\dwf\ Committee}
+
+\vspace{2cm} 
 \url{http://www.dwarfstd.org}
 
 \large
@@ -135,7 +184,6 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 %\clearpage
 \openany
 
-\frontmatter
 \textmd
 \normalsize
 \setlength{\headheight}{15pt}  
@@ -159,7 +207,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,6 +216,7 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \include{copyright}
 \include{foreword}
 \include{foreword4.1}
+\emptypage
 
 \cleardoublepage
 \tableofcontents
@@ -178,48 +227,37 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \cleardoublepage
 \listoftables
 
+\flushleft
+\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{generaldescription}            \emptypage
+\include{programscope}                  \emptypage
+\include{dataobject}                    \emptypage
+\include{typeentries}                   \emptypage
+\include{otherdebugginginformation}     \emptypage
 \include{datarepresentation}
 %  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