Backup of today's work. Still awaiting a couple more editorial inputs.
[dwarf-doc.git] / dwarf5 / latexdoc / dwarf5.tex
index ba27b8a..d018d5f 100644 (file)
@@ -3,14 +3,14 @@
 % If draft is in the document class list, pix are just suggested
 % by an outline, the pic does not appear as a picture.
 %
-\newcommand{\docdate}{October 6, 2016}
+\newcommand{\docdate}{January 24, 2017}
 %
 \usepackage{ifthen}
     \newcommand{\ifthen}[2]{\ifthenelse{#1}{#2}{}}
     \newboolean{isdraft}\setboolean{isdraft}{true}
-    \newboolean{uselinenos}\setboolean{uselinenos}{false}
+    \newboolean{uselinenumbers}\setboolean{uselinenumbers}{true}
     \newboolean{usechangesummary}\setboolean{usechangesummary}{false}
-\newcommand{\draftmark}{\ifthenelse{\boolean{isdraft}}{*** PUBLIC REVIEW DRAFT ***}{}}
+\newcommand{\draftmark}{\ifthenelse{\boolean{isdraft}}{***PRE-RELEASE STANDARD DRAFT \#2***}{}}
 %
 \usepackage[T1]{fontenc}
 \usepackage{palatino}
@@ -50,7 +50,11 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 \usepackage{graphicx}      % For pictures
 \usepackage{epstopdf}      % Autoconvert .eps to .pdf
     \epstopdfsetup{suffix=-generated} % Mark generaed PDF as such
-\usepackage{lineno}        % line numbers
+\usepackage[pagewise]{lineno} % line numbers
+    \pagewiselinenumbers
+    \setlength\linenumbersep{3em}
+    \renewcommand\linenumberfont{\normalfont\itshape\tiny} 
+    \nolinenumbers    
 \usepackage{longtable}     % For multipage tables
 \usepackage{hhline}        % Single column horizontal lines
 \usepackage{varioref}      % defines \vref
@@ -100,13 +104,32 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
   pdftitle={\dwf\ Version 5}
 }
 
-% An environment to create a listing-like (boxed) presentation for DWARF examples
-% Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
-% but does full LaTex processing within its scope (unlike \verb).
+% An environment to create a listing-like (boxed) presentation for 
+% DWARF examples Use like \begin{nlnlisting}...\end{nlnlisting}. 
+% Does not do line numbers but does full LaTex processing within its 
+% scope (unlike \verb).
 \newsavebox{\savedwf}
-\newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
-  \begin{minipage}{\textwidth}\footnotesize}
-  {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
+\newenvironment{dwflisting}
+  {\nolinenumbers\begin{lrbox}{\savedwf}\begin{minipage}{\textwidth}\footnotesize}
+  {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}} 
+   \condlinenumbers}
+
+% Conditionally turn on line numbers
+\newcommand{\condlinenumbers}{\ifthen{\boolean{uselinenumbers}}{\linenumbers}}
+
+% An environment that turns off line numbers then conditionally turns
+% them back on at the end
+\newenvironment{nolinenumbersenv}
+    {\nolinenumbers}
+    {\par\condlinenumbers}
+
+% An environment like lstlisting that is wrapped to prevent the
+% contents of the listing from having line numbers generated by
+% the lineno package
+\lstnewenvironment{nlnlisting}    % listing-specific newenvironment command
+    {\nolinenumbers}
+    {\condlinenumbers}
+    
 % A helper to annotate the parts of a multipage figure
 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
 
@@ -222,8 +245,6 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 % Complement of \isundefined
 \newcommand{\isdefined}[1]{\not{\isundefined{#1}}}
 
-\newcommand{\uselinenos}{\ifthen{\boolean{uselinenos}}{\linenumbers*}}
-
 % Preferred changebar aliases
 \newcommand{\bb}{\cbstart}      % Begin (change) bar
 \newcommand{\eb}{\cbend}        % End (change) bar
@@ -356,24 +377,24 @@ escapeinside={\%*}{*)}     % if you want to add a comment within your code
 % Define the levels of sectionality that are numbered.
 \setcounter{secnumdepth}{5}
 
-\uselinenos\include{introduction}              \emptypage
-\uselinenos\include{generaldescription}        %\emptypage
-\uselinenos\include{programscope}              \emptypage
-\uselinenos\include{dataobject}                \emptypage
-\uselinenos\include{typeentries}               \emptypage
-\uselinenos\include{otherdebugginginformation} %\emptypage
-\uselinenos\include{datarepresentation}        %\emptypage
+\condlinenumbers\include{introduction}              \emptypage
+\condlinenumbers\include{generaldescription}        %\emptypage
+\condlinenumbers\include{programscope}              \emptypage
+\condlinenumbers\include{dataobject}                \emptypage
+\condlinenumbers\include{typeentries}               %\emptypage
+\condlinenumbers\include{otherdebugginginformation} %\emptypage
+\condlinenumbers\include{datarepresentation}        %\emptypage
 
 %  The \appendix command toggles us into appendix chapters
 \appendix
 
-\uselinenos\include{attributesbytag}          %\emptypage
-\uselinenos\include{debugsectionrelationships} \emptypage
-\uselinenos\include{encodingdecoding}          \emptypage
-\uselinenos\include{examples}                  %\emptypage
-\uselinenos\include{compression}               \emptypage
-\uselinenos\include{splitobjects}                 \emptypage
-\uselinenos\include{sectionversionnumbers}     \emptypage
+\condlinenumbers\include{attributesbytag}              %\emptypage
+\condlinenumbers\include{debugsectionrelationships} \emptypage
+\condlinenumbers\include{encodingdecoding}          \emptypage
+\condlinenumbers\include{examples}                  %\emptypage
+\condlinenumbers\include{compression}               \emptypage
+\condlinenumbers\include{splitobjects}             \emptypage
+\condlinenumbers\include{sectionversionnumbers}     \emptypage
 \nolinenumbers
 \include{gnulicense}                           \emptypage
 % Maybe someday the selected glossary concept will be of interest...