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}{October 6, 2016}
9 \newcommand{\ifthen}[2]{\ifthenelse{#1}{#2}{}}
10 \newboolean{isdraft}\setboolean{isdraft}{true}
11 \newboolean{uselinenos}\setboolean{uselinenos}{false}
12 \newboolean{usechangesummary}\setboolean{usechangesummary}{false}
13 \newcommand{\draftmark}{\ifthenelse{\boolean{isdraft}}{*** PUBLIC REVIEW DRAFT ***}{}}
15 \usepackage[T1]{fontenc}
18 \renewcommand{\ttdefault}{cmtt} % Use Computer Modern Typewriter instead of Courier
19 \usepackage{url} % for color in letters. Links instead?
20 \usepackage[usenames]{color}%for color in letters. Links instead?
21 \usepackage{ellipsis} % provides ... as \dots
22 %\usepackage[utf8]{inputenc}% to type directly diacritic characters
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
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
48 \usepackage{amsmath} % Provides \nobreakdash
49 \usepackage{amssymb} % maths
50 \usepackage{graphicx} % For pictures
51 \usepackage{epstopdf} % Autoconvert .eps to .pdf
52 \epstopdfsetup{suffix=-generated} % Mark generaed PDF as such
53 \usepackage{lineno} % line numbers
54 \usepackage{longtable} % For multipage tables
55 \usepackage{hhline} % Single column horizontal lines
56 \usepackage{varioref} % defines \vref
57 % \textregistered is the trademark symbol
58 \usepackage[headheight=16pt,paper=letterpaper]{geometry}
59 \setlength{\headheight}{15pt} % avoids warning from latex
60 \usepackage{needspace} % For assuring space remaining on a page
61 \usepackage{ifthen} % For conditional processing
62 \include{dwarfchangebarpatch} % Patch needed for package changebar
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 (Name Index (Fig 6.1), Appendix B)
67 \usetikzlibrary{arrows}
68 \usetikzlibrary{arrows.meta}
69 \usetikzlibrary{backgrounds}
71 \usetikzlibrary{chains}
72 \usetikzlibrary{decorations.pathreplacing}
73 \usetikzlibrary{shapes.geometric}
74 \usetikzlibrary{shapes.multipart}
75 \usetikzlibrary{shapes.symbols}
76 \usepackage{changebar} % For change bars in margin
78 \usepackage{makeidx} % For making an index
79 % hyperref must be the last package listed.
80 % The hyperref settings helps hypertext get links right in the
82 % Also, allcolors lets us generate colored active links inside a pdf.
83 % And breaklinks resolves truncation issues with very long link names.
84 \usepackage[breaklinks,plainpages=false,pdfpagelabels,pagebackref,
85 allcolors=blue!80!black,bookmarksnumbered=true]{hyperref}
86 \makeindex % This and the makeidx package allow \index to create index entries.
88 \newcommand{\dwf}{DWARF Debugging Information Format}
90 \newenvironment{myindentpara}[1]%
92 {\setlength{\leftmargin}{#1}}%
97 \hypersetup{colorlinks=true,
99 pdfauthor={\dwf\ Committee},
100 pdftitle={\dwf\ Version 5}
103 % An environment to create a listing-like (boxed) presentation for DWARF examples
104 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
105 % but does full LaTex processing within its scope (unlike \verb).
106 \newsavebox{\savedwf}
107 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
108 \begin{minipage}{\textwidth}\footnotesize}
109 {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
110 % A helper to annotate the parts of a multipage figure
111 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
113 % Define a simple hyper-reference to a given URL
114 \newcommand{\hrefself}[1]{\href{#1}{#1}}
116 % Generate a page ref.
117 % use like \refersec{chap:registervalues}
118 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
119 \newcommand{\refersec}[1]{\vref{#1}} % beware possible rerun loop
120 \newcommand{\referfol}[1]{\ref{#1} following}
122 % Generate a live link in the document that gets indexed as well
123 % Use like \livelink{chap:DWOPdup}{DW\_OP\_dup}
124 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
125 % use when the index is different from the text and target.
126 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
127 % livetarg is the declaration that is the target of livelinks.
128 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
129 % When we want the index entry to look different from the name.
130 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
132 \newcommand{\thirtytwobitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{32-bit DWARF format}}
133 \newcommand{\sixtyfourbitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{64-bit DWARF format}}
135 \newcommand{\dash}{\nobreakdash-\hspace{0pt}} % So we handle dashes ok.
137 % The following two let us mark a word as 'do not link' or
138 % 'do not index' to indicate the word is used generically
139 % and has been considered so do not index or link it.
140 % There is no significant difference in the two commands, though
141 % \nolink would be more oriented to words such as flag or address
142 % that might be linked (and indexed) in some circumstances.
143 \newcommand{\nolink}[1]{#1}
144 \newcommand{\noindex}[1]{#1}
146 % For index entries. The tt-variant of each pair is designed to
147 % allow a word to appear in tt font in the main test and the index
148 % but to collate in the index in its non-tt order. Similarly for
149 % the it-variant using italics font.
150 % (LaTex normally % sorts all tt words before all non-tt words.)
151 \newcommand{\addtoindex}[1]{#1\index{#1}}
152 \newcommand{\additindex}[1]{\textit{#1}\index{#1@\textit{#1}}}
153 \newcommand{\addttindex}[1]{\texttt{#1}\index{#1@\texttt{#1}}}
154 \newcommand{\addtoindexi}[2]{#1\index{#2}}
155 \newcommand{\additindexi}[2]{\textit{#1}\index{#2@\textit{#2}}}
156 \newcommand{\addttindexi}[2]{\texttt{#1}\index{#2@\texttt{#2}}}
157 \newcommand{\addtoindexx}[1]{\index{#1}}
158 \newcommand{\additindexx}[1]{\index{#1@\textit{#1}}}
159 \newcommand{\addttindexx}[1]{\index{#1@\texttt{#1}}}
161 % Quote commands that avoid need for inline UTF-8 in these sources
162 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
163 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
165 % Better naming for the lowest level section header
166 \newcommand{\subsubsubsection}[1]{\paragraph{#1}~\newline}
167 \newcommand{\subsubsubsubsection}[1]{\textbf{#1}.~~}
169 % Start new page if less than n lines remain on current page
170 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
172 % Helper for item lists with bold subject markers
173 \newcommand{\itembf}[1]{\needlines{4} \item \textbf{#1}}
174 \newcommand{\itembfnl}[1]{\itembf{#1} \\}
176 % And description lists with normal (not bold) text
177 \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
178 \newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
180 % Define an alternate footnote command that creates ragged right text
181 % (using \raggedright in the parameter does not work)
182 \newcommand\footnoteRR[1]{\footnote{\raggedright#1}}
186 \newcommand{\emptypage}{
189 \begin{nolinenumbers}
191 \textit{(empty page)}
196 % Define a new column type P that is just like p except
197 % that it uses ragged right (rather than right justification}
198 % within a column of a tabular environment. (See Goossens,
199 % Mittelback&Samarin, "The LaTex Companion", pp108&114.)
200 \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}
201 \newcolumntype{P}[1]{>{\PBS\raggedright\hspace{0pt}}p{#1}}
203 % A simple rule used in simple tables; default length is 2 inches
204 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
206 % A simple one column table of names; default width is 2 inches
207 \newcommand{\simplenametablerule}{\simplerule[2in]}
208 \newenvironment{simplenametable}[3][2in]
209 { \begin{table}[ht] \caption{#2} \label{#3}
211 \renewcommand{\simplenametablerule}{\simplerule[#1]}
212 \simplenametablerule \\
213 \begin{tabular*}{#1}{l}
217 \simplenametablerule \\
222 % Complement of \isundefined
223 \newcommand{\isdefined}[1]{\not{\isundefined{#1}}}
225 \newcommand{\uselinenos}{\ifthen{\boolean{uselinenos}}{\linenumbers*}}
227 % Preferred changebar aliases
228 \newcommand{\bb}{\cbstart} % Begin (change) bar
229 \newcommand{\eb}{\cbend} % End (change) bar
230 \newcommand{\bbeb}{\bb\eb} % Mark deleted word or phrase
231 % Mark deleted paragraph
232 \newcommand{\bbpareb}{\vspace{-0.6\baselineskip}\bb~\eb\vspace{-0.6\baselineskip}}
233 % Variations for use inside an alltt environment--But don't work!
234 %\newcommand(\bballtt){\end{alltt}\bb\vspace{-0.8\baselineskip}\begin{alltt}}
235 %\newcommand{\eballtt}{\end{alltt}\eb\vspace{-0.8\baselineskip}\begin{alltt}}
236 %\newcommand(\bbeballtt){\end{alltt}\bb\eb\vspace{-0.8\baselineskip}\begin{alltt}}
238 % Define commands for all of the DWARF names (DW\_*, .debug_*, a few others)
240 %\newcommand{\definition}[1]{\textcolor{red!80!black}{#1}}
241 \newcommand{\definition}[1]{\textcolor{red!65!black}{#1}}
242 \newcommand{\definitionx}[1]{\definition{\addtoindex{#1}}}
243 \include{dwarfnamecmds}
245 % Define commands for pgf use in the name index figure (Fig 6.1)
247 \include{pgfcmdsfornameindexfig}
249 % --------------------------------
250 % --- Begin the document pages ---
251 % --------------------------------
255 \thispagestyle{empty}
258 \setlength{\parindent}{0pt}
259 \setlength{\headheight}{6cm}
260 \setlength{\uppermargin}{6cm}
261 \setlength{\topsep}{0pt}
262 \tightlists % less spacing before/after lists
271 \includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
274 \href{http://www.dwarfstd.org}{\dwf}
275 \href{http://www.dwarfstd.org}{Committee}
278 \url{http://www.dwarfstd.org}
281 {\Large \textbf{\docdate}}
283 \ifthenelse{\boolean{isdraft}}{
291 \setlength{\headheight}{15pt}
293 %\makeevenhead{plain}{}{}{}
294 %\makeoddhead{plain}{}{}{}
295 %\makeevenfoot{plain}{}{}{}
296 %\makeoddfoot{plain}{}{}{}
298 \setlength{\parindent}{0pt}
299 \settrims{0.5in}{0.5in}
300 \settypeblocksize{8.2in}{6.0in}
301 %\setlrmarginsandblock{0.6in}{0.6in}{*}
302 %\setheadfoot{15pt}{15pt}
303 %\setheaderspaces {*}{2\onelineskip}{*}
305 \makeevenhead{plain}{}{\rightmark}{}
306 \makeoddhead{plain}{}{\rightmark}{}
307 \makeevenfoot{plain}{\docdate}{\draftmark}{Page \thepage}
308 \makeoddfoot{plain}{\docdate}{\draftmark}{Page \thepage}
313 \setlength{\parindent}{0pt}
319 ~ % Make the page non-empty...
329 \ifthenelse{\boolean{usechangesummary}}
331 {% Environment to keep the following header change local
333 \makeevenhead{plain}{}{Change Summary}{}
334 \makeoddhead{plain}{}{Change Summary}{}
335 \include{changesummary}
342 \chapterstyle{default}
344 \setlength{\parindent}{0pt}
346 \makepagestyle{fragFirstChPage}
347 \makeevenhead{fragFirstChPage}{}{}{}
348 \makeoddhead{fragFirstChPage}{}{}{}
349 \makeoddfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
350 \makeevenfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
352 \aliaspagestyle{chapter}{fragFirstChPage}
354 % ----- Start the main part of the document -----
356 % Define the levels of sectionality that are numbered.
357 \setcounter{secnumdepth}{5}
359 \uselinenos\include{introduction} \emptypage
360 \uselinenos\include{generaldescription} %\emptypage
361 \uselinenos\include{programscope} \emptypage
362 \uselinenos\include{dataobject} \emptypage
363 \uselinenos\include{typeentries} \emptypage
364 \uselinenos\include{otherdebugginginformation} %\emptypage
365 \uselinenos\include{datarepresentation} %\emptypage
367 % The \appendix command toggles us into appendix chapters
370 \uselinenos\include{attributesbytag} %\emptypage
371 \uselinenos\include{debugsectionrelationships} \emptypage
372 \uselinenos\include{encodingdecoding} \emptypage
373 \uselinenos\include{examples} %\emptypage
374 \uselinenos\include{compression} \emptypage
375 \uselinenos\include{splitobjects} \emptypage
376 \uselinenos\include{sectionversionnumbers} \emptypage
378 \include{gnulicense} \emptypage
379 % Maybe someday the selected glossary concept will be of interest...
380 %\include{selectedglossary} %\emptypage
381 \printindex \clearpage