This is the first pass of incorporating review commments from the
[dwarf-doc.git] / dwarf5 / latexdoc / dwarf5.tex
1 \documentclass[12pt,letterpaper,twoside]{memoir} 
2 % for debugging, add 'draft' (without quotes) to the [] document class list.
3 % If draft is in the document class list, pix are just suggested
4 % by an outline, the pic does not appear as a picture.
5 %
6 \newcommand{\docdate}{19 April 2013 (***Draft***)}
7 %
8 \usepackage{url}                   % For color in letters. Links instead?
9 \usepackage[usenames]{color} % For color in letters. Links instead?
10 \usepackage{ellipsis}      % Provides ... as \dots
11 %\usepackage{color}
12 \usepackage{listings}
13 \usepackage{alltt}
14 \lstset{ %
15 language={},               % choose the language of the code
16 basicstyle=\footnotesize,  % the size of the fonts that are used for the code
17 numbers=left,              % where to put the line-numbers
18 numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
19 numberfirstline=true,
20 firstnumber=1,             % first line number in each listing
21 stepnumber=5,              % the step between two line-numbers. If it is 1 each line will be numbered
22 numbersep=10pt,            % how far the line-numbers are from the code
23 backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
24 showspaces=false,          % show spaces adding particular underscores
25 showstringspaces=false,    % underline spaces within strings
26 showtabs=false,            % show tabs within strings adding particular underscores
27 frame=single,              % adds a frame around the code
28 tabsize=2,                 % sets default tabsize to 2 spaces
29 captionpos=b,              % sets the caption-position to bottom
30 breaklines=true,           % sets automatic line breaking
31 breakatwhitespace=false,   % sets if automatic breaks should only happen at whitespace
32 escapeinside={\%*}{*)}     % if you want to add a comment within your code
33 }
34
35 \usepackage{amsmath}       % Provides \nobreakdash
36 \usepackage{graphicx}      % For pictures
37 \usepackage{longtable}     % For multipage tables
38 \usepackage{varioref}      % defines \vref
39 % \textregistered is the trademark symbol
40 \usepackage[headheight=16pt,paper=letterpaper]{geometry}
41 \setlength{\headheight}{15pt}  % avoids warning from latex
42 \usepackage{needspace}     % For assuring space remaining on a page
43 \usepackage{ifthen}        % For conditional processing
44 \usepackage{changepage}    % For odd/even page checks
45 \usepackage{epic}          % For eepic package 
46 \usepackage{eepic}         % For the diagram of section relationships
47 \usepackage{eepicemu}      % For the diagram of section relationships
48 \usepackage{makeidx}       % For making an index
49 % hyperref must be the last package listed.
50 % The hyperref settings helps hypertext get right links in the 
51 % pdf of the index.
52 \usepackage[plainpages=false,pdfpagelabels,pagebackref,allcolors=blue]{hyperref} % Lets us generate colored active links inside a pdf.
53 \makeindex  % This and the makeidx package allow \index to create index entries.
54
55 \renewcommand{\familydefault}{phv}  % font family helvetica
56
57 \newcommand{\dwf}{DWARF Debugging Information Format}
58
59 \newenvironment{myindentpara}[1]%
60   {\begin{list}{}%
61     {\setlength{\leftmargin}{#1}}%
62     \item[]%
63   }
64   {\end{list}}
65
66 % broken somehow.
67 %\newcommand{\myindent1}[1]{\begin{myindentpara}{1cm}#1\end{myindentpara}}
68
69 \hypersetup{colorlinks=true,
70   %bookmarks=true,
71   pdfauthor={\dwf\ Committee},
72   pdftitle={\dwf\ Version 4.1}
73 }
74
75 % An environment to create a listing-like (boxed) presentation for DWARF examples
76 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
77 % but does full LaTex processing within its scope (unlike \verb).
78 \newsavebox{\savedwf}
79 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
80   \begin{minipage}{\textwidth}\footnotesize}
81   {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
82 % A helper to annotate the parts of a multipage figure
83 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
84
85 % Generate a page ref.
86 % use like   \refersec{chap:registerbasedaddressing}
87 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
88 \newcommand{\refersec}[1]{\vref{#1}}  % beware possible rerun loop
89 \newcommand{\referfol}[1]{\ref{#1} following}
90
91 % Generate a live link in the document
92 % use like \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}
93 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
94 % use when the index is different from the text and target.
95 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
96 % livetarg is the declaration this is the target of livelinks.
97 % FIXME: we might want livetarg and livetargi  #2 to be \textbf{#2}
98 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
99 % When we want the index entry to look different from the name.
100 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
101
102 \newcommand{\dash}{\nobreakdash-\hspace{0pt}}  % So we handle dashes ok.
103
104 % The following two let us mark a word as 'do not link' or
105 % 'do not index' to indicate the word is used generically
106 % and has been considered so do not index or link it.
107 % There is no significant difference in the two commands, though
108 % \nolink would be more oriented to words such as flag or address
109 % that might be linked (and indexed) in some circumstances.
110 \newcommand{\nolink}[1]{#1}
111 \newcommand{\noindex}[1]{#1}
112
113 % For index entries.
114 \newcommand{\addtoindex}[1]{#1\index{#1}}
115 \newcommand{\addtoindexi}[2]{#1\index{#2}}
116 \newcommand{\addtoindexx}[1]{\index{#1}}
117
118 % Quote commands that avoid need for inline UTF-8 in these sources
119 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
120 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
121
122 % Better naming for the lowest level section header
123 \newcommand{\subsubsubsection}[1]{\paragraph{#1.}}
124
125 % Issue \clearpage if less than n lines remain on page
126 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
127
128 % Helper for item lists with bold subject markers
129 \newcommand{\itembf}[1]{\item \textbf{#1}}
130 \newcommand{\itembfnl}[1]{\itembf{#1} \\}
131
132 % And description lists with normal (not bold) text
133 \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
134 \newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
135
136 % Reduce vertical space at beginning of a list
137 \setlength{\topsep}{0in}
138
139 \newcommand{\emptypage}{
140     \clearpage
141     \vspace*{4in}
142     \begin{center} \textit{(empty page)} \end{center}
143     }
144
145 % A simple rule used in simple tables; default length is 2 inches
146 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
147
148 % A simple one column table of names; default width is 2 inches
149 \newcommand{\simplenametablerule}{\simplerule[2in]}
150 \newenvironment{simplenametable}[3][2in]
151     {   \begin{table}[here] \caption{#2} \label{#3}
152         \begin{center}
153         \renewcommand{\simplenametablerule}{\simplerule[#1]}
154         \simplenametablerule \\
155         \begin{tabular*}{#1}{l}
156         }
157     {   \end{tabular*}
158         \vspace{4pt} \\
159         \simplenametablerule \\
160         \end{center}
161         \end{table}
162         }
163
164 \newcommand{\xffffffff}                 {\texttt{0xffffffff}}                   % use with following punctutation
165 \newcommand{\wffffffff}                 {\texttt{0xffffffff}\ }                 % use as separate "word"
166 \newcommand{\xfffffffzero}              {\texttt{0xfffffff0}}                   % use with following punctutation
167 \newcommand{\wfffffffzero}              {\texttt{0xfffffff0}\ }
168 \newcommand{\xffffffffffffffff} {\texttt{0xffffffffffffffff}}   % use with following punctutation
169 \newcommand{\wffffffffffffffff} {\texttt{0xffffffffffffffff}\ }
170
171 %--- Begin the document pages
172 %
173 \begin{document}
174 \frontmatter
175 \thispagestyle{empty}
176
177 \nonzeroparskip
178 \setlength{\parindent}{0pt} 
179 \setlength{\headheight}{6cm}
180 \setlength{\uppermargin}{6cm}
181
182 \begin{centering}
183 \LARGE
184 \textbf{\dwf}
185
186 \textbf{Version 4.1}
187
188 \centering
189 \vspace{1cm}
190 \includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
191
192 %\centering
193 \vspace{2cm}
194 \href{http://www.dwarfstd.org}{\dwf\ Committee}
195
196 \vspace{1cm} 
197 \url{http://www.dwarfstd.org}
198
199 \large
200 \vspace{2cm}
201 \textbf{\docdate}
202
203 \end{centering}
204
205 %\clearpage
206 %\openany
207
208 \textmd
209 \normalsize
210 \setlength{\headheight}{15pt}  
211
212 \pagestyle{plain}
213 %\makeevenhead{plain}{}{}{}
214 %\makeoddhead{plain}{}{}{}
215 %\makeevenfoot{plain}{}{}{}
216 %\makeoddfoot{plain}{}{}{}
217
218 \nonzeroparskip
219 \setlength{\parindent}{0pt} 
220 \settrims{0.5in}{0.5in}
221 \settypeblocksize{8.2in}{6.0in}
222 %\setlrmarginsandblock{0.6in}{0.6in}{*}
223 %\setheadfoot{15pt}{15pt}
224 %\setheaderspaces {*}{2\onelineskip}{*}
225 \nouppercaseheads
226 \makeevenhead{plain}{}{\rightmark}{}
227 \makeoddhead{plain}{}{\rightmark}{}
228 \makeevenfoot{plain}{\docdate}{}{Page \thepage}
229 \makeoddfoot{plain}{\docdate}{}{Page \thepage}
230
231 %\openany
232
233 \nonzeroparskip
234 \setlength{\parindent}{0pt} 
235
236 \flushleft
237 \include{copyright}
238 \include{foreword}
239 \include{foreword4.1}
240 \emptypage
241
242 \newpage
243 \tableofcontents
244
245 \cleardoublepage
246 \listoffigures
247
248 \cleardoublepage
249 \listoftables
250
251 \flushleft
252 \raggedbottom
253 \chapterstyle{section}
254
255 \setlength{\parindent}{0pt} 
256
257 \makepagestyle{fragFirstChPage}
258     \makeevenhead{fragFirstChPage}{}{}{}
259     \makeoddhead{fragFirstChPage}{}{}{}
260     \makeoddfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
261     \makeevenfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
262 \nouppercaseheads
263 \aliaspagestyle{chapter}{fragFirstChPage}
264
265 % ----- Start the main part of the document -----
266 \mainmatter
267 % Define the levels of sectionality that are numbered.
268 \setcounter{secnumdepth}{5}
269 \include{introduction}
270 \include{generaldescription}            \emptypage
271 \include{programscope}                  \emptypage
272 \include{dataobject}                    \emptypage
273 \include{typeentries}                   \emptypage
274 \include{otherdebugginginformation} \emptypage
275 \include{datarepresentation}            %\emptypage
276 %  The \appendix toggles us into appendix chapters
277 \appendix
278 \include{attributesbytag}
279 \include{debugsectionrelationships}     %\emptypage
280 \include{encodingdecoding}              \emptypage
281 \include{examples}                      %\emptypage
282 \include{compression}                   %\emptypage
283 \include{sectionversionnumbers}
284 \include{gnulicense}
285 \printindex
286 \end{document}