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