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