Changes from review comments and July 15 meeting, except changes
[dwarf-doc.git] / dwarf5 / latexdoc / dwarf5.tex
1 \documentclass[12pt,letterpaper,oneside]{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}{July 22, 2014}
7 %
8 \usepackage{ifthen}
9 \newboolean{isdraft}
10 \setboolean{isdraft}{true}
11 \newcommand{\draftmark}{\ifthenelse{\boolean{isdraft}}{*** DRAFT ***}{}}
12 %
13 \usepackage[T1]{fontenc}
14 \usepackage{palatino}
15 \usepackage{cmtt}
16 \renewcommand{\ttdefault}{cmtt} % Use Computer Modern Typewriter instead of Courier
17 %\usepackage{ascii}
18 %\renewcommand{\ttdefault}{ascii}
19 %\renewcommand{\ttfamily}{\asciifamily}
20 %\usepackage{microtype}
21 %\DisableLigatures[f]{encoding=T1}
22 %\renewcommand{\familydefault}{phv}  % font family helvetica
23 %
24
25 \usepackage{url}               % For color in letters. Links instead?
26 \usepackage[usenames]{color} % For color in letters. Links instead?
27 \usepackage{ellipsis}      % Provides ... as \dots
28 %\usepackage{color}
29 \usepackage{listings}
30 \usepackage{alltt}
31 \lstset{ %
32 language={},               % choose the language of the code
33 basicstyle=\footnotesize\ttfamily,  % the size of the fonts that are used for the code
34 numbers=none,              % where to put the line-numbers
35 numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
36 numberfirstline=true,
37 firstnumber=1,             % first line number in each listing
38 stepnumber=5,              % the step between two line-numbers. If it is 1 each line will be numbered
39 numbersep=10pt,            % how far the line-numbers are from the code
40 backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
41 showspaces=false,          % show spaces adding particular underscores
42 showstringspaces=false,    % underline spaces within strings
43 showtabs=false,            % show tabs within strings adding particular underscores
44 frame=single,              % adds a frame around the code
45 tabsize=2,                 % sets default tabsize to 2 spaces
46 captionpos=b,              % sets the caption-position to bottom
47 breaklines=true,           % sets automatic line breaking
48 breakatwhitespace=false,   % sets if automatic breaks should only happen at whitespace
49 escapeinside={\%*}{*)}     % if you want to add a comment within your code
50 }
51
52 \usepackage{amsmath}       % Provides \nobreakdash
53 \usepackage{graphicx}      % For pictures
54 \usepackage{longtable}     % For multipage tables
55 \usepackage{varioref}      % defines \vref
56 % \textregistered is the trademark symbol
57 \usepackage[headheight=16pt,paper=letterpaper]{geometry}
58 \setlength{\headheight}{15pt}  % avoids warning from latex
59 \usepackage{needspace}     % For assuring space remaining on a page
60 \usepackage{ifthen}        % For conditional processing
61 \usepackage{changepage}    % For odd/even page checks
62 \usepackage{lscape}
63 \usepackage{tikz}                  % graphics (Appendix B)
64 \usetikzlibrary{shapes.geometric}
65 \usetikzlibrary{arrows}
66 \usepackage{makeidx}       % For making an index
67 % hyperref must be the last package listed.
68 % The hyperref settings helps hypertext get links right in the 
69 % pdf of the index. 
70 % Also, allcolors lets us generate colored active links inside a pdf.
71 % And breaklinks resolves truncation issues with very long link names.
72 \usepackage[breaklinks,plainpages=false,pdfpagelabels,pagebackref,allcolors=blue,bookmarksnumbered=true]{hyperref} 
73 \makeindex  % This and the makeidx package allow \index to create index entries.
74
75 \newcommand{\dwf}{DWARF Debugging Information Format}
76
77 \newenvironment{myindentpara}[1]%
78   {\begin{list}{}%
79     {\setlength{\leftmargin}{#1}}%
80     \item[]%
81   }
82   {\end{list}}
83
84 % broken somehow.
85 %\newcommand{\myindent1}[1]{\begin{myindentpara}{1cm}#1\end{myindentpara}}
86
87 \hypersetup{colorlinks=true,
88   %bookmarks=true,
89   pdfauthor={\dwf\ Committee},
90   pdftitle={\dwf\ Version 5}
91 }
92
93 % An environment to create a listing-like (boxed) presentation for DWARF examples
94 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
95 % but does full LaTex processing within its scope (unlike \verb).
96 \newsavebox{\savedwf}
97 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
98   \begin{minipage}{\textwidth}\footnotesize}
99   {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
100 % A helper to annotate the parts of a multipage figure
101 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
102
103 % Generate a page ref.
104 % use like   \refersec{chap:registervalues}
105 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
106 \newcommand{\refersec}[1]{\vref{#1}}  % beware possible rerun loop
107 \newcommand{\referfol}[1]{\ref{#1} following}
108
109 % Generate a live link in the document
110 % use like \livelink{chap:DWOPdup}{DW\_OP\_dup}
111 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
112 % use when the index is different from the text and target.
113 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
114 % livetarg is the declaration that is the target of livelinks.
115 % FIXME: we might want livetarg and livetargi  #2 to be \textbf{#2}
116 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
117 % When we want the index entry to look different from the name.
118 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
119
120 \newcommand{\thirtytwobitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{32-bit DWARF format}}
121 \newcommand{\sixtyfourbitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{64-bit DWARF format}}
122
123 \newcommand{\dash}{\nobreakdash-\hspace{0pt}}  % So we handle dashes ok.
124
125 % The following two let us mark a word as 'do not link' or
126 % 'do not index' to indicate the word is used generically
127 % and has been considered so do not index or link it.
128 % There is no significant difference in the two commands, though
129 % \nolink would be more oriented to words such as flag or address
130 % that might be linked (and indexed) in some circumstances.
131 \newcommand{\nolink}[1]{#1}
132 \newcommand{\noindex}[1]{#1}
133
134 % For index entries. The tt-variant of each pair is designed to
135 % allow a word to appear in tt font in the main test and the index
136 % but to collate in the index in its non-tt order. (LaTex normally
137 % sorts all tt words before all non-tt words.)
138 \newcommand{\addtoindex}[1]{#1\index{#1}}
139 \newcommand{\addttindex}[1]{\texttt{#1}\index{#1@\texttt{#1}}}
140 \newcommand{\addtoindexi}[2]{#1\index{#2}}
141 \newcommand{\addttindexi}[2]{\texttt{#1}\index{#2@\texttt{#2}}}
142 \newcommand{\addtoindexx}[1]{\index{#1}}
143 \newcommand{\addttindexx}[1]{\index{#1@\texttt{#1}}}
144
145 % Quote commands that avoid need for inline UTF-8 in these sources
146 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
147 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
148
149 % Better naming for the lowest level section header
150 \newcommand{\subsubsubsection}[1]{\paragraph{#1.}}
151
152 % Issue \clearpage if less than n lines remain on page
153 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
154
155 % Helper for item lists with bold subject markers
156 \newcommand{\itembf}[1]{\item \textbf{#1}}
157 \newcommand{\itembfnl}[1]{\itembf{#1} \\}
158
159 % And description lists with normal (not bold) text
160 \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
161 \newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
162
163 \newcommand{\emptypage}{
164     \clearpage
165     \vspace*{4in}
166     \begin{center} \textit{(empty page)} \end{center}
167     }
168
169 % A simple rule used in simple tables; default length is 2 inches
170 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
171
172 % A simple one column table of names; default width is 2 inches
173 \newcommand{\simplenametablerule}{\simplerule[2in]}
174 \newenvironment{simplenametable}[3][2in]
175     {   \begin{table}[here] \caption{#2} \label{#3}
176         \begin{center}
177         \renewcommand{\simplenametablerule}{\simplerule[#1]}
178         \simplenametablerule \\
179         \begin{tabular*}{#1}{l}
180         }
181     {   \end{tabular*}
182         \vspace{4pt} \\
183         \simplenametablerule \\
184         \end{center}
185         \end{table}
186         }
187
188 % Anti-ligature commands added because \/ and {} don't work for unknown reasons
189 % nor does the microtext package DisableLigatures command...???
190 %
191 \newcommand{\xiiif}                             {0x3\hspace{1pt}f}
192 \newcommand{\xiiifff}                   {0x3\hspace{1pt}f\hspace{2pt}f\hspace{2pt}f}
193 \newcommand{\xff}                               {0x\hspace{1pt}f\hspace{2pt}f}
194 \newcommand{\xffff}                             {0x\hspace{1pt}f\hspace{2pt}f\hspace{2pt}f\hspace{2pt}f}
195 %
196 % These are intended for use in running text...
197 %
198 \newcommand{\xffffffff}                 {\texttt{0xffffffff}}                   % use with following punctutation
199 \newcommand{\wffffffff}                 {\texttt{0xffffffff}\ }                 % use as separate "word"
200 \newcommand{\xfffffffzero}              {\texttt{0xfffffff0}}                   % use with following punctutation
201 \newcommand{\wfffffffzero}              {\texttt{0xfffffff0}\ }
202 \newcommand{\xffffffffffffffff} {\texttt{0xffffffffffffffff}}   % use with following punctutation
203 \newcommand{\wffffffffffffffff} {\texttt{0xffffffffffffffff}\ }
204
205 % Define commands for all of the DWARF names (DW\_*, .debug_*, a few others)
206 \include{dwarfnamecmds}
207
208 %--- Begin the document pages
209 %
210 \begin{document}
211 \frontmatter
212 \thispagestyle{empty}
213
214 \nonzeroparskip
215 \setlength{\parindent}{0pt} 
216 \setlength{\headheight}{6cm}
217 \setlength{\uppermargin}{6cm}
218 \setlength{\topsep}{0pt}
219 \tightlists                                     % less spacing before/after lists
220
221 \begin{center}
222 \LARGE
223 \textbf{\dwf}
224 \\
225 \textbf{Version 5}
226 \\
227 \vspace{1cm}
228 \includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
229 \\
230 \vspace{1cm}
231 \href{http://www.dwarfstd.org}{\dwf}
232 \href{http://www.dwarfstd.org}{Committee}
233 \\
234 \vspace{0.3cm} 
235 \url{http://www.dwarfstd.org}
236 \\
237 \vspace{3cm}
238 \textbf{\docdate}
239 \\
240 \ifthenelse{\boolean{isdraft}}{
241         \vspace{1cm}
242         \draftmark}
243         {}
244 \end{center}
245
246 \textmd
247 \normalsize
248 \setlength{\headheight}{15pt}  
249 \pagestyle{plain}
250 %\makeevenhead{plain}{}{}{}
251 %\makeoddhead{plain}{}{}{}
252 %\makeevenfoot{plain}{}{}{}
253 %\makeoddfoot{plain}{}{}{}
254 \nonzeroparskip
255 \setlength{\parindent}{0pt} 
256 \settrims{0.5in}{0.5in}
257 \settypeblocksize{8.2in}{6.0in}
258 %\setlrmarginsandblock{0.6in}{0.6in}{*}
259 %\setheadfoot{15pt}{15pt}
260 %\setheaderspaces {*}{2\onelineskip}{*}
261 \nouppercaseheads
262 \makeevenhead{plain}{}{\rightmark}{}
263 \makeoddhead{plain}{}{\rightmark}{}
264 \makeevenfoot{plain}{\docdate}{\draftmark}{Page \thepage}
265 \makeoddfoot{plain}{\docdate}{\draftmark}{Page \thepage}
266
267 %\openany
268
269 \nonzeroparskip
270 \setlength{\parindent}{0pt} 
271 \flushleft
272 \include{copyright}
273 \include{foreword}
274
275 \newpage
276 \tableofcontents
277
278 \cleardoublepage
279 \listoffigures
280
281 \cleardoublepage
282 \listoftables
283
284 \ifthenelse{\boolean{isdraft}}
285         {       \emptypage
286                 {% Environment to keep the following header change local
287                 \clearpage
288                 \makeevenhead{plain}{}{Change Summary}{}
289                 \makeoddhead{plain}{}{Change Summary}{}
290                 \include{changesummary}
291                 }
292         }{}
293 \cleardoublepage
294 \flushleft
295 \raggedbottom
296 \chapterstyle{default}
297
298 \setlength{\parindent}{0pt} 
299
300 \makepagestyle{fragFirstChPage}
301     \makeevenhead{fragFirstChPage}{}{}{}
302     \makeoddhead{fragFirstChPage}{}{}{}
303     \makeoddfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
304     \makeevenfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
305 \nouppercaseheads
306 \aliaspagestyle{chapter}{fragFirstChPage}
307
308 % ----- Start the main part of the document -----
309 \mainmatter
310 % Define the levels of sectionality that are numbered.
311 \setcounter{secnumdepth}{5}
312
313 \include{introduction}
314 \include{generaldescription}            \emptypage
315 \include{programscope}                  %\emptypage
316 \include{dataobject}                    \emptypage
317 \include{typeentries}                   %\emptypage
318 \include{otherdebugginginformation}     %\emptypage
319 \include{datarepresentation}            \emptypage
320
321 %  The \appendix toggles us into appendix chapters
322 \appendix
323
324 \include{attributesbytag}               %\emptypage
325 \include{debugsectionrelationships}     %\emptypage
326 \include{encodingdecoding}              \emptypage
327 \include{examples}                      %\emptypage
328 \include{compression}                   %\emptypage
329 \include{splitobjects}                  \emptypage
330 \include{sectionversionnumbers}
331 \include{gnulicense}
332
333 \printindex
334
335 \end{document}