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.
6 \newcommand{\docdate}{June 24, 2016}
9 \newcommand{\ifthen}[2]{\ifthenelse{#1}{#2}{}}
10 \newboolean{isdraft}\setboolean{isdraft}{true}
11 \newboolean{uselinenos}\setboolean{uselinenos}{true}
12 \newcommand{\draftmark}{\ifthenelse{\boolean{isdraft}}{*** DRAFT ***}{}}
14 \usepackage[T1]{fontenc}
17 \renewcommand{\ttdefault}{cmtt} % Use Computer Modern Typewriter instead of Courier
18 \usepackage{url} % for color in letters. Links instead?
19 \usepackage[usenames]{color}%for color in letters. Links instead?
20 \usepackage{ellipsis} % provides ... as \dots
21 \usepackage[utf8]{inputenc}% to type directly diacritic characters
26 language={}, % choose the language of the code
27 basicstyle=\footnotesize\ttfamily, % the size of the fonts that are used for the code
28 numbers=none, % where to put the line-numbers
29 numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
31 firstnumber=1, % first line number in each listing
32 stepnumber=5, % the step between two line-numbers. If it is 1 each line will be numbered
33 numbersep=10pt, % how far the line-numbers are from the code
34 backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
35 showspaces=false, % show spaces adding particular underscores
36 showstringspaces=false, % underline spaces within strings
37 showtabs=false, % show tabs within strings adding particular underscores
38 frame=single, % adds a frame around the code
39 tabsize=2, % sets default tabsize to 2 spaces
40 captionpos=b, % sets the caption-position to bottom
41 breaklines=true, % sets automatic line breaking
42 breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
43 escapeinside={\%*}{*)} % if you want to add a comment within your code
47 \usepackage{amsmath} % Provides \nobreakdash
48 \usepackage{amssymb} % maths
49 \usepackage{graphicx} % For pictures
50 \usepackage{epstopdf} % Autoconvert .eps to .pdf
51 \epstopdfsetup{suffix=-generated} % Mark generaed PDF as such
52 \usepackage{lineno} % line numbers
53 \usepackage{longtable} % For multipage tables
54 \usepackage{hhline} % Single column horizontal lines
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 \include{dwarfchangebarpatch} % Patch needed for package changebar
62 \usepackage{changepage} % For odd/even page checks
63 \usepackage[usenames,dvipsnames]{xcolor}
64 \usepackage{lscape} % For landscape mode (Appendix B)
65 \usepackage{tikz} % graphics (Name Index (Fig 6.1), Appendix B)
66 \usetikzlibrary{arrows}
67 \usetikzlibrary{arrows.meta}
68 \usetikzlibrary{backgrounds}
70 \usetikzlibrary{chains}
71 \usetikzlibrary{decorations.pathreplacing}
72 \usetikzlibrary{shapes.geometric}
73 \usetikzlibrary{shapes.multipart}
74 \usetikzlibrary{shapes.symbols}
75 \usepackage{changebar} % For change bars in margin
77 \usepackage{makeidx} % For making an index
78 % hyperref must be the last package listed.
79 % The hyperref settings helps hypertext get links right in the
81 % Also, allcolors lets us generate colored active links inside a pdf.
82 % And breaklinks resolves truncation issues with very long link names.
83 \usepackage[breaklinks,plainpages=false,pdfpagelabels,pagebackref,
84 allcolors=blue!80!black,bookmarksnumbered=true]{hyperref}
85 \makeindex % This and the makeidx package allow \index to create index entries.
87 \newcommand{\dwf}{DWARF Debugging Information Format}
89 \newenvironment{myindentpara}[1]%
91 {\setlength{\leftmargin}{#1}}%
96 \hypersetup{colorlinks=true,
98 pdfauthor={\dwf\ Committee},
99 pdftitle={\dwf\ Version 5}
102 % An environment to create a listing-like (boxed) presentation for DWARF examples
103 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
104 % but does full LaTex processing within its scope (unlike \verb).
105 \newsavebox{\savedwf}
106 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
107 \begin{minipage}{\textwidth}\footnotesize}
108 {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
109 % A helper to annotate the parts of a multipage figure
110 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
112 % Define a simple hyper-reference to a given URL
113 \newcommand{\hrefself}[1]{\href{#1}{#1}}
115 % Generate a page ref.
116 % use like \refersec{chap:registervalues}
117 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
118 \newcommand{\refersec}[1]{\vref{#1}} % beware possible rerun loop
119 \newcommand{\referfol}[1]{\ref{#1} following}
121 % Generate a live link in the document that gets indexed as well
122 % Use like \livelink{chap:DWOPdup}{DW\_OP\_dup}
123 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
124 % use when the index is different from the text and target.
125 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
126 % livetarg is the declaration that is the target of livelinks.
127 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
128 % When we want the index entry to look different from the name.
129 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
131 \newcommand{\thirtytwobitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{32-bit DWARF format}}
132 \newcommand{\sixtyfourbitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{64-bit DWARF format}}
134 \newcommand{\dash}{\nobreakdash-\hspace{0pt}} % So we handle dashes ok.
136 % The following two let us mark a word as 'do not link' or
137 % 'do not index' to indicate the word is used generically
138 % and has been considered so do not index or link it.
139 % There is no significant difference in the two commands, though
140 % \nolink would be more oriented to words such as flag or address
141 % that might be linked (and indexed) in some circumstances.
142 \newcommand{\nolink}[1]{#1}
143 \newcommand{\noindex}[1]{#1}
145 % For index entries. The tt-variant of each pair is designed to
146 % allow a word to appear in tt font in the main test and the index
147 % but to collate in the index in its non-tt order. Similarly for
148 % the it-variant using italics font.
149 % (LaTex normally % sorts all tt words before all non-tt words.)
150 \newcommand{\addtoindex}[1]{#1\index{#1}}
151 \newcommand{\additindex}[1]{\textit{#1}\index{#1@\textit{#1}}}
152 \newcommand{\addttindex}[1]{\texttt{#1}\index{#1@\texttt{#1}}}
153 \newcommand{\addtoindexi}[2]{#1\index{#2}}
154 \newcommand{\additindexi}[2]{\textit{#1}\index{#2@\textit{#2}}}
155 \newcommand{\addttindexi}[2]{\texttt{#1}\index{#2@\texttt{#2}}}
156 \newcommand{\addtoindexx}[1]{\index{#1}}
157 \newcommand{\additindexx}[1]{\index{#1@\textit{#1}}}
158 \newcommand{\addttindexx}[1]{\index{#1@\texttt{#1}}}
160 % Quote commands that avoid need for inline UTF-8 in these sources
161 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
162 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
164 % Better naming for the lowest level section header
165 \newcommand{\subsubsubsection}[1]{\paragraph{#1}~\newline}
166 \newcommand{\subsubsubsubsection}[1]{\textbf{#1}.~~}
168 % Start new page if less than n lines remain on current page
169 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
171 % Helper for item lists with bold subject markers
172 \newcommand{\itembf}[1]{\needlines{4} \item \textbf{#1}}
173 \newcommand{\itembfnl}[1]{\itembf{#1} \\}
175 % And description lists with normal (not bold) text
176 \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
177 \newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
179 % Define an alternate footnote command that creates ragged right text
180 % (using \raggedright in the parameter does not work)
181 \newcommand\footnoteRR[1]{\footnote{\raggedright#1}}
185 \newcommand{\emptypage}{
188 \begin{nolinenumbers}
190 \textit{(empty page)}
195 % Define a new column type P that is just like p except
196 % that it uses ragged right (rather than right justification}
197 % within a column of a tabular environment. (See Goossens,
198 % Mittelback&Samarin, "The LaTex Companion", pp108&114.)
199 \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}
200 \newcolumntype{P}[1]{>{\PBS\raggedright\hspace{0pt}}p{#1}}
202 % A simple rule used in simple tables; default length is 2 inches
203 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
205 % A simple one column table of names; default width is 2 inches
206 \newcommand{\simplenametablerule}{\simplerule[2in]}
207 \newenvironment{simplenametable}[3][2in]
208 { \begin{table}[ht] \caption{#2} \label{#3}
210 \renewcommand{\simplenametablerule}{\simplerule[#1]}
211 \simplenametablerule \\
212 \begin{tabular*}{#1}{l}
216 \simplenametablerule \\
221 % Complement of \isundefined
222 \newcommand{\isdefined}[1]{\not{\isundefined{#1}}}
224 \newcommand{\uselinenos}{\ifthen{\boolean{uselinenos}}{\linenumbers*}}
226 % Preferred changebar aliases
227 \newcommand{\bb}{\cbstart} % Begin (change) bar
228 \newcommand{\eb}{\cbend} % End (change) bar
229 \newcommand{\bbeb}{\bb\eb} % Mark deleted word or phrase
230 % Mark deleted paragraph
231 \newcommand{\bbpareb}{\vspace{-0.6\baselineskip}\bb~\eb\vspace{-0.6\baselineskip}}
232 % Variations for use inside an alltt environment--But don't work!
233 %\newcommand(\bballtt){\end{alltt}\bb\vspace{-0.8\baselineskip}\begin{alltt}}
234 %\newcommand{\eballtt}{\end{alltt}\eb\vspace{-0.8\baselineskip}\begin{alltt}}
235 %\newcommand(\bbeballtt){\end{alltt}\bb\eb\vspace{-0.8\baselineskip}\begin{alltt}}
237 % Define commands for all of the DWARF names (DW\_*, .debug_*, a few others)
239 %\newcommand{\definition}[1]{\textcolor{red!80!black}{#1}}
240 \newcommand{\definition}[1]{\textcolor{red!65!black}{#1}}
241 \newcommand{\definitionx}[1]{\definition{\addtoindex{#1}}}
242 \include{dwarfnamecmds}
244 % Define commands for pgf use in the name index figure (Fig 6.1)
246 \include{pgfcmdsfornameindexfig}
248 % --------------------------------
249 % --- Begin the document pages ---
250 % --------------------------------
254 \thispagestyle{empty}
257 \setlength{\parindent}{0pt}
258 \setlength{\headheight}{6cm}
259 \setlength{\uppermargin}{6cm}
260 \setlength{\topsep}{0pt}
261 \tightlists % less spacing before/after lists
270 \includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
273 \href{http://www.dwarfstd.org}{\dwf}
274 \href{http://www.dwarfstd.org}{Committee}
277 \url{http://www.dwarfstd.org}
280 {\Large \textbf{\docdate}}
282 \ifthenelse{\boolean{isdraft}}{
290 \setlength{\headheight}{15pt}
292 %\makeevenhead{plain}{}{}{}
293 %\makeoddhead{plain}{}{}{}
294 %\makeevenfoot{plain}{}{}{}
295 %\makeoddfoot{plain}{}{}{}
297 \setlength{\parindent}{0pt}
298 \settrims{0.5in}{0.5in}
299 \settypeblocksize{8.2in}{6.0in}
300 %\setlrmarginsandblock{0.6in}{0.6in}{*}
301 %\setheadfoot{15pt}{15pt}
302 %\setheaderspaces {*}{2\onelineskip}{*}
304 \makeevenhead{plain}{}{\rightmark}{}
305 \makeoddhead{plain}{}{\rightmark}{}
306 \makeevenfoot{plain}{\docdate}{\draftmark}{Page \thepage}
307 \makeoddfoot{plain}{\docdate}{\draftmark}{Page \thepage}
312 \setlength{\parindent}{0pt}
318 ~ % Make the page non-empty...
328 \ifthenelse{\boolean{isdraft}}
330 {% Environment to keep the following header change local
332 \makeevenhead{plain}{}{Change Summary}{}
333 \makeoddhead{plain}{}{Change Summary}{}
334 \include{changesummary}
341 \chapterstyle{default}
343 \setlength{\parindent}{0pt}
345 \makepagestyle{fragFirstChPage}
346 \makeevenhead{fragFirstChPage}{}{}{}
347 \makeoddhead{fragFirstChPage}{}{}{}
348 \makeoddfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
349 \makeevenfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
351 \aliaspagestyle{chapter}{fragFirstChPage}
353 % ----- Start the main part of the document -----
355 % Define the levels of sectionality that are numbered.
356 \setcounter{secnumdepth}{5}
358 \uselinenos\include{introduction} %\emptypage
359 \uselinenos\include{generaldescription} %\emptypage
360 \uselinenos\include{programscope} %\emptypage
361 \uselinenos\include{dataobject} \emptypage
362 \uselinenos\include{typeentries} \emptypage
363 \uselinenos\include{otherdebugginginformation} %\emptypage
364 \uselinenos\include{datarepresentation} \emptypage
366 % The \appendix command toggles us into appendix chapters
369 \uselinenos\include{attributesbytag} %\emptypage
370 \uselinenos\include{debugsectionrelationships} \emptypage
371 \uselinenos\include{encodingdecoding} \emptypage
372 \uselinenos\include{examples} %\emptypage
373 \uselinenos\include{compression} \emptypage
374 \uselinenos\include{splitobjects} \emptypage
375 \uselinenos\include{sectionversionnumbers} \emptypage
377 \include{gnulicense} \emptypage
378 % Maybe someday the selected glossary concept will be of interest...
379 %\include{selectedglossary} %\emptypage
380 \printindex \clearpage