Final cleanups before group review. Only Appendix B Figure is pending...
[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}{10 February 2013 (***Draft***)}
7 %
8 \usepackage{url} % For color in letters. Links instead?
9 \usepackage{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{makeidx}       % For making an index
48 % hyperref must be the last package listed.
49 % The hyperref settings helps hypertext get right links in the 
50 % pdf of the index.
51 \usepackage[plainpages=false,pdfpagelabels,pagebackref]{hyperref} % Lets us generate colored active links inside a pdf.
52 \makeindex  % This and the makeidx package allow \index to create index entries.
53
54 \renewcommand{\familydefault}{phv}  % font family helvetica
55
56 \newcommand{\dwf}{DWARF Debugging Information Format}
57
58 \newenvironment{myindentpara}[1]%
59   {\begin{list}{}%
60     {\setlength{\leftmargin}{#1}}%
61     \item[]%
62   }
63   {\end{list}}
64
65 % broken somehow.
66 %\newcommand{\myindent1}[1]{\begin{myindentpara}{1cm}#1\end{myindentpara}}
67
68 \hypersetup{colorlinks=true,
69   %bookmarks=true,
70   pdfauthor={\dwf\ Committee},
71   pdftitle={\dwf\ Version 4.1}
72 }
73
74 % An environment to create a listing-like (boxed) presentation for DWARF examples
75 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
76 % but does full LaTex processing within its scope (unlike \verb).
77 \newsavebox{\savedwf}
78 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
79   \begin{minipage}{\textwidth}\footnotesize}
80   {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
81 % A helper to annotate the parts of a multipage figure
82 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
83
84 % Generate a page ref.
85 % use like   \refersec{chap:registerbasedaddressing}
86 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
87 \newcommand{\refersec}[1]{\vref{#1}}  % beware possible rerun loop
88 \newcommand{\referfol}[1]{\ref{#1} following}
89
90 % Generate a live link in the document
91 % use like \livelink{chap:DWOPdup}{DW\-\_OP\-\_dup}
92 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
93 % use when the index is different from the text and target.
94 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
95 % livetarg is the declaration this is the target of livelinks.
96 % FIXME: we might want livetarg and livetargi  #2 to be \textbf{#2}
97 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
98 % When we want the index entry to look different from the name.
99 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
100
101 \newcommand{\dash}{\nobreakdash-\hspace{0pt}}  % So we handle dashes ok.
102
103 % The following two let us mark a word as 'do not link' or
104 % 'do not index' to indicate the word is used generically
105 % and has been considered so do not index or link it.
106 % There is no significant difference in the two commands, though
107 % \nolink would be more oriented to words such as flag or address
108 % that might be linked (and indexed) in some circumstances.
109 \newcommand{\nolink}[1]{#1}
110 \newcommand{\noindex}[1]{#1}
111
112 % For index entries.
113 \newcommand{\addtoindex}[1]{#1\index{#1}}
114 \newcommand{\addtoindexi}[2]{#1\index{#2}}
115 \newcommand{\addtoindexx}[1]{\index{#1}}
116
117 % Quote commands that avoid need for inline UTF-8 in these sources
118 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
119 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
120
121 % Better naming for the lowest level section header
122 \newcommand{\subsubsubsection}[1]{\paragraph{#1.}}
123
124 % Issue \clearpage if less than n lines remain on page
125 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
126
127 % Helper for item lists with bold subject markers
128 \newcommand{\itembf}[1]{\item \textbf{#1}}
129 \newcommand{\itembfnl}[1]{\itembf{#1} \\}
130
131 % And description lists with normal (not bold) text
132 \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
133 \newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
134
135 % Reduce vertical space at beginning of a list
136 \setlength{\topsep}{0in}
137
138 \newcommand{\emptypage}{
139     \clearpage
140     \vspace*{4in}
141     \begin{center} \textit{(empty page)} \end{center}
142     }
143
144 % A simple rule used in simple tables; default length is 2 inches
145 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
146
147 % A simple one column table of names; default width is 2 inches
148 \newcommand{\simplenametablerule}{\simplerule[2in]}
149 \newenvironment{simplenametable}[3][2in]
150     {   \begin{table}[here] \caption{#2} \label{#3}
151         \begin{center}
152         \renewcommand{\simplenametablerule}{\simplerule[#1]}
153         \simplenametablerule \\
154         \begin{tabular*}{#1}{l}
155         }
156     {   \end{tabular*}
157         \vspace{4pt} \\
158         \simplenametablerule \\
159         \end{center}
160         \end{table}
161         }
162
163 %--- Begin the document pages
164 %
165 \begin{document}
166 \frontmatter
167 \thispagestyle{empty}
168
169 \nonzeroparskip
170 \setlength{\parindent}{0pt} 
171 \setlength{\headheight}{6cm}
172 \setlength{\uppermargin}{6cm}
173
174 \begin{centering}
175 \LARGE
176 \textbf{\dwf}
177
178 \textbf{Version 4.1}
179
180 \centering
181 \includegraphics[keepaspectratio=true,scale=1.0]{DWlogo}
182
183 \centering
184 \vspace{3cm}
185 \href{http://www.dwarfstd.org}{\dwf\ Committee}
186
187 \vspace{2cm} 
188 \url{http://www.dwarfstd.org}
189
190 \large
191 \vspace{1in}
192 \textbf{\docdate}
193
194 \end{centering}
195
196 %\clearpage
197 \openany
198
199 \textmd
200 \normalsize
201 \setlength{\headheight}{15pt}  
202
203 \pagestyle{plain}
204 \makeevenhead{plain}{}{}{}
205 \makeoddhead{plain}{}{}{}
206 \makeevenfoot{plain}{}{}{}
207 \makeoddfoot{plain}{}{}{}
208
209 \nonzeroparskip
210 \setlength{\parindent}{0pt} 
211 \settrims{0.5in}{0.5in}
212 \settypeblocksize{8.2in}{6.0in}
213 %\setlrmarginsandblock{0.6in}{0.6in}{*}
214 %\setheadfoot{15pt}{15pt}
215 %\setheaderspaces {*}{2\onelineskip}{*}
216 \nouppercaseheads
217 \makeevenhead{plain}{}{\rightmark}{}
218 \makeoddhead{plain}{}{\rightmark}{}
219 \makeevenfoot{plain}{\docdate}{}{Page \thepage}
220 \makeoddfoot{plain}{\docdate}{}{Page \thepage}
221
222 %\openany
223
224 \nonzeroparskip
225 \setlength{\parindent}{0pt} 
226
227 \flushleft
228 \include{copyright}
229 \include{foreword}
230 \include{foreword4.1}
231 \emptypage
232
233 \cleardoublepage
234 \tableofcontents
235
236 \cleardoublepage
237 \listoffigures
238
239 \cleardoublepage
240 \listoftables
241
242 \flushleft
243 \raggedbottom
244 \chapterstyle{section}
245
246 \setlength{\parindent}{0pt} 
247
248 \makepagestyle{fragFirstChPage}
249     \makeevenhead{fragFirstChPage}{}{}{}
250     \makeoddhead{fragFirstChPage}{}{}{}
251     \makeoddfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
252     \makeevenfoot{fragFirstChPage}{\docdate}{}{Page \thepage}
253 \nouppercaseheads
254 \aliaspagestyle{chapter}{fragFirstChPage}
255
256 % ----- Start the main part of the document -----
257 \mainmatter
258 % Define the levels of sectionality that are numbered.
259 \setcounter{secnumdepth}{5}
260 \include{introduction}
261 \include{generaldescription}            \emptypage
262 \include{programscope}                  \emptypage
263 \include{dataobject}                    \emptypage
264 \include{typeentries}                   \emptypage
265 \include{otherdebugginginformation} \emptypage
266 \include{datarepresentation}            %\emptypage
267 %  The \appendix toggles us into appendix chapters
268 \appendix
269 \include{attributesbytag}
270 \include{debugsectionrelationships}     \emptypage
271 \include{encodingdecoding}              \emptypage
272 \include{examples}                      %\emptypage
273 \include{compression}                   %\emptypage
274 \include{sectionversionnumbers}
275 \include{gnulicense}
276 \printindex
277 \end{document}