53a210b963747e71a29c166e836679568eb853a6
[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}{June 29, 2015}
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 \usepackage{float}
52 \restylefloat{figure}
53 \usepackage{amsmath}       % Provides \nobreakdash
54 \usepackage{graphicx}      % For pictures
55 \usepackage{longtable}     % For multipage tables
56 \usepackage{hhline}        % Single column horizontal lines
57 \usepackage{varioref}      % defines \vref
58 % \textregistered is the trademark symbol
59 \usepackage[headheight=16pt,paper=letterpaper]{geometry}
60 \setlength{\headheight}{15pt}  % avoids warning from latex
61 \usepackage{needspace}     % For assuring space remaining on a page
62 \usepackage{ifthen}        % For conditional processing
63 \usepackage{changepage}    % For odd/even page checks
64 \usepackage[usenames,dvipsnames]{xcolor}
65 \usepackage{lscape}        % For landscape mode (Appendix B)
66 \usepackage{tikz}          % graphics (Appendix B)
67 \usetikzlibrary{shapes.geometric}
68 \usetikzlibrary{shapes.multipart}
69 \usetikzlibrary{arrows,decorations.pathmorphing}
70 \usepackage{makeidx}       % For making an index
71 % hyperref must be the last package listed.
72 % The hyperref settings helps hypertext get links right in the 
73 % pdf of the index. 
74 % Also, allcolors lets us generate colored active links inside a pdf.
75 % And breaklinks resolves truncation issues with very long link names.
76 \usepackage[breaklinks,plainpages=false,pdfpagelabels,pagebackref,allcolors=blue,bookmarksnumbered=true]{hyperref} 
77 \makeindex  % This and the makeidx package allow \index to create index entries.
78
79 \newcommand{\dwf}{DWARF Debugging Information Format}
80
81 \newenvironment{myindentpara}[1]%
82   {\begin{list}{}%
83     {\setlength{\leftmargin}{#1}}%
84     \item[]%
85   }
86   {\end{list}}
87
88 % broken somehow.
89 %\newcommand{\myindent1}[1]{\begin{myindentpara}{1cm}#1\end{myindentpara}}
90
91 \hypersetup{colorlinks=true,
92   %bookmarks=true,
93   pdfauthor={\dwf\ Committee},
94   pdftitle={\dwf\ Version 5}
95 }
96
97 % An environment to create a listing-like (boxed) presentation for DWARF examples
98 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
99 % but does full LaTex processing within its scope (unlike \verb).
100 \newsavebox{\savedwf}
101 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
102   \begin{minipage}{\textwidth}\footnotesize}
103   {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
104 % A helper to annotate the parts of a multipage figure
105 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
106
107 % Define a simple hyper-reference to a given URL
108 \newcommand{\hrefself}[1]{\href{#1}{#1}}
109
110 % Generate a page ref.
111 % use like   \refersec{chap:registervalues}
112 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
113 \newcommand{\refersec}[1]{\vref{#1}}  % beware possible rerun loop
114 \newcommand{\referfol}[1]{\ref{#1} following}
115
116 % Generate a live link in the document
117 % use like \livelink{chap:DWOPdup}{DW\_OP\_dup}
118 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
119 % use when the index is different from the text and target.
120 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
121 % livetarg is the declaration that is the target of livelinks.
122 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
123 % When we want the index entry to look different from the name.
124 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
125
126 \newcommand{\thirtytwobitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{32-bit DWARF format}}
127 \newcommand{\sixtyfourbitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{64-bit DWARF format}}
128
129 \newcommand{\dash}{\nobreakdash-\hspace{0pt}}  % So we handle dashes ok.
130
131 % The following two let us mark a word as 'do not link' or
132 % 'do not index' to indicate the word is used generically
133 % and has been considered so do not index or link it.
134 % There is no significant difference in the two commands, though
135 % \nolink would be more oriented to words such as flag or address
136 % that might be linked (and indexed) in some circumstances.
137 \newcommand{\nolink}[1]{#1}
138 \newcommand{\noindex}[1]{#1}
139
140 % For index entries. The tt-variant of each pair is designed to
141 % allow a word to appear in tt font in the main test and the index
142 % but to collate in the index in its non-tt order. (LaTex normally
143 % sorts all tt words before all non-tt words.)
144 \newcommand{\addtoindex}[1]{#1\index{#1}}
145 \newcommand{\addttindex}[1]{\texttt{#1}\index{#1@\texttt{#1}}}
146 \newcommand{\addtoindexi}[2]{#1\index{#2}}
147 \newcommand{\addttindexi}[2]{\texttt{#1}\index{#2@\texttt{#2}}}
148 \newcommand{\addtoindexx}[1]{\index{#1}}
149 \newcommand{\addttindexx}[1]{\index{#1@\texttt{#1}}}
150
151 % Quote commands that avoid need for inline UTF-8 in these sources
152 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
153 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
154
155 % Better naming for the lowest level section header
156 \newcommand{\subsubsubsection}[1]{\paragraph{#1}~\newline}
157 %\newcommand{\subsubsubsubsection}[1]{\subparagraph{#1}.~}  %% Huh?
158 \newcommand{\subsubsubsubsection}[1]{\textbf{#1}.~~}
159 %\newcommand{\subsubsubsection}         %% Has to be in a style file--ugh...
160 %   {\@startsection{subsubsubsection}{4}{0mm}{-\baselineskip}{\baselineskip}{\normalfont\normalsize\itshap}}
161
162 % Issue \clearpage if less than n lines remain on page
163 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
164
165 % Helper for item lists with bold subject markers
166 \newcommand{\itembf}[1]{\item \textbf{#1}}
167 \newcommand{\itembfnl}[1]{\itembf{#1} \\}
168
169 % And description lists with normal (not bold) text
170 \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
171 \newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
172
173 \newcommand{\emptypage}{
174     \clearpage
175     \vspace*{4in}
176     \begin{center} \textit{(empty page)} \end{center}
177     }
178
179 % Define a new column type P that is just like p except
180 % that it uses ragged right (rather than right justification}
181 % within a column  of a tabular environment. (See Goossens,
182 % Mittelback&Samarin, "The LaTex Companion", pp108&114.)
183 \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}
184 \newcolumntype{P}[1]{>{\PBS\raggedright\hspace{0pt}}p{#1}}
185
186 % A simple rule used in simple tables; default length is 2 inches
187 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
188
189 % A simple one column table of names; default width is 2 inches
190 \newcommand{\simplenametablerule}{\simplerule[2in]}
191 \newenvironment{simplenametable}[3][2in]
192     {   \begin{table}[here] \caption{#2} \label{#3}
193         \begin{center}
194         \renewcommand{\simplenametablerule}{\simplerule[#1]}
195         \simplenametablerule \\
196         \begin{tabular*}{#1}{l}
197         }
198     {   \end{tabular*}
199         \vspace{4pt} \\
200         \simplenametablerule \\
201         \end{center}
202         \end{table}
203         }
204
205 % Define commands for all of the DWARF names (DW\_*, .debug_*, a few others)
206 %
207 \newcommand{\definition}[1]{\textcolor{red!80!black}{#1}}
208 \include{dwarfnamecmds}
209
210 %--- Begin the document pages
211 %
212 \begin{document}
213 \frontmatter
214 \thispagestyle{empty}
215
216 \nonzeroparskip
217 \setlength{\parindent}{0pt} 
218 \setlength{\headheight}{6cm}
219 \setlength{\uppermargin}{6cm}
220 \setlength{\topsep}{0pt}
221 \tightlists                                     % less spacing before/after lists
222
223 \begin{center}
224 \LARGE
225 \textbf{\dwf}
226 \\
227 \textbf{Version 5}
228 \\
229 \vspace{1cm}
230 \includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
231 \\
232 \vspace{1cm}
233 \href{http://www.dwarfstd.org}{\dwf}
234 \href{http://www.dwarfstd.org}{Committee}
235 \\
236 \vspace{0.5cm} 
237 \url{http://www.dwarfstd.org}
238 \\
239 \vspace{2cm}
240 {\Large \textbf{\docdate}}
241 \\
242 \ifthenelse{\boolean{isdraft}}{
243         \vspace{2cm}
244         \draftmark}
245         {}
246 \end{center}
247
248 \textmd
249 \normalsize
250 \setlength{\headheight}{15pt}  
251 \pagestyle{plain}
252 %\makeevenhead{plain}{}{}{}
253 %\makeoddhead{plain}{}{}{}
254 %\makeevenfoot{plain}{}{}{}
255 %\makeoddfoot{plain}{}{}{}
256 \nonzeroparskip
257 \setlength{\parindent}{0pt} 
258 \settrims{0.5in}{0.5in}
259 \settypeblocksize{8.2in}{6.0in}
260 %\setlrmarginsandblock{0.6in}{0.6in}{*}
261 %\setheadfoot{15pt}{15pt}
262 %\setheaderspaces {*}{2\onelineskip}{*}
263 \nouppercaseheads
264 \makeevenhead{plain}{}{\rightmark}{}
265 \makeoddhead{plain}{}{\rightmark}{}
266 \makeevenfoot{plain}{\docdate}{\draftmark}{Page \thepage}
267 \makeoddfoot{plain}{\docdate}{\draftmark}{Page \thepage}
268
269 %\openany
270
271 \nonzeroparskip
272 \setlength{\parindent}{0pt} 
273 \flushleft
274 \include{copyright}
275 \include{foreword}
276
277 \newpage
278 ~ % Make the page non-empty...
279 \newpage
280 \tableofcontents
281
282 \clearpage
283 \listoffigures
284
285 \clearpage
286 \listoftables
287
288 \ifthenelse{\boolean{isdraft}}
289         {       %\emptypage
290                 {% Environment to keep the following header change local
291                 \clearpage
292                 \makeevenhead{plain}{}{Change Summary}{}
293                 \makeoddhead{plain}{}{Change Summary}{}
294                 \include{changesummary}
295                 %\emptypage
296                 }
297         }{}
298 %\cleardoublepage
299 \flushleft
300 \raggedbottom
301 \chapterstyle{default}
302
303 \setlength{\parindent}{0pt} 
304
305 \makepagestyle{fragFirstChPage}
306     \makeevenhead{fragFirstChPage}{}{}{}
307     \makeoddhead{fragFirstChPage}{}{}{}
308     \makeoddfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
309     \makeevenfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
310 \nouppercaseheads
311 \aliaspagestyle{chapter}{fragFirstChPage}
312
313 % ----- Start the main part of the document -----
314 \mainmatter
315 % Define the levels of sectionality that are numbered.
316 \setcounter{secnumdepth}{5}
317
318 \include{introduction}                  %\emptypage
319 \include{generaldescription}            %\emptypage
320 \include{programscope}                  \emptypage
321 \include{dataobject}                    %\emptypage
322 \include{typeentries}                   %\emptypage
323 \include{otherdebugginginformation}     \emptypage
324 \include{datarepresentation}            \emptypage
325
326 %  The \appendix command toggles us into appendix chapters
327 \appendix
328
329 \include{attributesbytag}               %\emptypage
330 \include{debugsectionrelationships}     \emptypage
331 \include{encodingdecoding}              \emptypage
332 \include{examples}                      %\emptypage
333 \include{compression}                   \emptypage
334 \include{splitobjects}                  %\emptypage
335 \include{sectionversionnumbers}         \emptypage
336 \include{gnulicense}                    \emptypage
337 %\include{selectedglossary}              %\emptypage
338 %\include{unitattributecomparison}
339
340 \printindex
341
342 \end{document}