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