Commit f970d6e9 authored by pknaggs's avatar pknaggs

Added \ifrelease / RC Support

Adding additional pagination control
Added \proposal command for formatting proposal names
Switched from bold to serif fonts for headings
Added editor environment
Page numbers nologer reset between front/main matter
Removed support for splitting the doucment into two
parent ef991087
...@@ -18,7 +18,17 @@ ...@@ -18,7 +18,17 @@
%\showreftrue %\showreftrue
\showreffalse \showreffalse
\newcommand{\revision}{11.1} % Document Revision \newif\ifrelease % Draft/Release version
%\releasetrue
\releasefalse
\ifrelease
\inlinefalse
\showreffalse
\fi
\newcommand{\revision}{12.1} % Document Revision
\newcommand{\snapshot}{2012} % Year of Snapshot
% ================================================= % =================================================
...@@ -80,8 +90,13 @@ ...@@ -80,8 +90,13 @@
\lhead[\leftmark]{Forth 200\emph{x} / \docversion} \lhead[\leftmark]{Forth 200\emph{x} / \docversion}
\rhead[Forth 200\emph{x} / \docversion]{\leftmark} \rhead[Forth 200\emph{x} / \docversion]{\leftmark}
\lfoot[\rm\thepage]{\sf\small\includefile} \ifrelease
\rfoot[\sf\small\includefile]{\rm\thepage} \lfoot[\rm\thepage]{}
\rfoot[]{\rm\thepage}
\else
\lfoot[\rm\thepage]{\sf\small\includefile}
\rfoot[\sf\small\includefile]{\rm\thepage}
\fi
\cfoot{} \cfoot{}
\renewcommand{\footrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt}
\newcommand{\collate}{% \newcommand{\collate}{%
...@@ -319,8 +334,13 @@ ...@@ -319,8 +334,13 @@
% \word@sub the two digit sub-division number % \word@sub the two digit sub-division number
% \word@name the name of the word being defined % \word@name the name of the word being defined
\newcommand{\word@def@b}[2][\empty]{% ...[<sub-number>]{<name>}... % For some reason I have yet to work out, this treats numbers with
\ifx#1\empty\let\word@sub=\empty\else\def\word@sub{#1}\fi % duplicate digits (such as 11, 22, 33, and so on) an empty. Thus
% the use of a magic number (100) to signify an empty sub-number,
% as the maximum sub-number should only be 99, this should be sufficient.
\newcommand{\word@def@b}[2][100]{% ...[<sub-number>]{<name>}...
\ifnum#1<100\def\word@sub{#1}\else\let\word@sub=\empty\fi
\ifx\word@label\empty\def\word@label{#2}\fi \ifx\word@label\empty\def\word@label{#2}\fi
\def\word@name{#2} \def\word@name{#2}
\word@def@c \word@def@c
...@@ -361,7 +381,7 @@ ...@@ -361,7 +381,7 @@
\newcommand{\word@def@begin}{% \newcommand{\word@def@begin}{%
\typeout{% \typeout{%
\ifx\empty\word@num----\else\word@num\fi \ifx\empty\word@num----\else\word@num\fi
\ifx\empty\word@sub\else.\word@sub\fi \ifx\empty\word@sub\space\space\space\else.\word@sub\fi
\space\includefile:\word@label} \space\includefile:\word@label}
\ifx\empty\word@prop \ifx\empty\word@prop
% No proposal - word must be from ANS Forth '94 % No proposal - word must be from ANS Forth '94
...@@ -425,10 +445,17 @@ ...@@ -425,10 +445,17 @@
% %
% Word number and name % Word number and name
% %
\@tempswbfalse
\ifrelease\else
\ifx\empty\word@prop\else
\cbstart\marginpar{\tiny{\color{white}c:b}}
\@tempswbtrue
\fi
\fi
\makebox[0.5\textwidth][l]{% \makebox[0.5\textwidth][l]{%
\makebox[7.0em][l]{% <== Magic Number, width of section number \makebox[6.0em][l]{% <== Magic Number, width of section number
% Switch to a bold font % Switch to a bold font
\bfseries \bfseries\sffamily
% %
% Current section or subsection % Current section or subsection
% %
...@@ -445,24 +472,35 @@ ...@@ -445,24 +472,35 @@
\ifx\empty\word@num \ifx\empty\word@num
% No word number given % No word number given
.\rule[.8ex]{2em}{.5pt} .\rule[.8ex]{2em}{.5pt}
\else \else%
.\word@num \if@tempswb%
\fi \uline{.\word@num}%
\else%
.\word@num%
\fi%
\fi%
% %
% Sub division % Sub division
% %
\ifx\word@sub\empty \ifx\word@sub\empty
% No sub division ~% No sub division
\else \else
\if@tempswb
\uline{.\word@sub}
\else
.\word@sub .\word@sub
\fi
\fi \fi
} }
% %
% Word Name % Word Name
% %
\mdseries % Back to a medium weight (normal) font %\mdseries % Back to a medium weight (normal) font
\texttt{\word@name} \texttt{\textbf{\word@name}}
} }
\if@tempswb
\cbend
\fi
% %
% English pronunciation (if given) % English pronunciation (if given)
% %
...@@ -480,14 +518,14 @@ ...@@ -480,14 +518,14 @@
% %
% Cross Reference % Cross Reference
% %
\ifshowref \ifshowref%
\ifx\word@label\word@name \ifx\word@label\word@name
% Word label is the word name % Word label is the word name
\else \else
% Label is different to name % Label is different to name
\hbox to 0pt{\textsf{\small ~~\word@label}} \hbox to 0pt{\textsf{\small ~~\word@label}}
\fi \fi
\fi \fi%
% %
% Start change bar % Start change bar
% %
...@@ -497,13 +535,15 @@ ...@@ -497,13 +535,15 @@
% %
% Proposal % Proposal
% %
\\[-0.8ex] \\*[-0.6ex]
\ifx\word@prop\empty \ifx\word@prop\empty
% No proposal - word must be from ANS Forth '94 % No proposal - word must be from ANS Forth '94
\else \else
\ifrelease\else
\mbox{} \hfill % flush right (under the wordset name) \mbox{} \hfill % flush right (under the wordset name)
\textsf{\small \word@prop}% \textsf{\small \word@prop}%
\fi \fi
\fi
% %
% Define the label for this word % Define the label for this word
% %
...@@ -518,7 +558,10 @@ ...@@ -518,7 +558,10 @@
% %
% End the header % End the header
% %
\\[-6ex] \if@star\else
\ifx\word@prop\empty\else\cbend\fi % Draft
\fi
\\*[-1.5\baselineskip]
% %
% This is a very bad place for a page break % This is a very bad place for a page break
% %
...@@ -570,7 +613,7 @@ ...@@ -570,7 +613,7 @@
% %
% Leave some extra space after the list % Leave some extra space after the list
% %
\vspace*{3ex} \vspace{3ex}
% %
% This would be a fairly good place for a page break % This would be a fairly good place for a page break
% %
...@@ -593,7 +636,7 @@ ...@@ -593,7 +636,7 @@
\newcommand{\interpret}{\item[Interpretation]} \newcommand{\interpret}{\item[Interpretation]}
\newcommand{\note}[1][\empty]{\item[Note\ifx#1\empty\else\ #1\fi]} \newcommand{\note}[1][\empty]{\item[Note\ifx#1\empty\else\ #1\fi]}
\newcommand{\runtime}[1][]{\item[#1 Run-time]} \newcommand{\runtime}[1][]{\item[#1 Run-time]}
\newcommand{\see}{\item[See]} \newcommand{\see}{\pagebreak[0]\item[See]}
% ==== Stack Descriptions ==== % ==== Stack Descriptions ====
...@@ -798,6 +841,7 @@ ...@@ -798,6 +841,7 @@
% And the same again for the reference implementation. % And the same again for the reference implementation.
\newenvironment{implement}{% \newenvironment{implement}{%
\inline@section{imp}{Implementation} \inline@section{imp}{Implementation}
\inline@label{imp}{\ref{annex:implement}}
\ttfamily \ttfamily
}{% }{%
\rmfamily \rmfamily
...@@ -967,6 +1011,7 @@ ...@@ -967,6 +1011,7 @@
% Mark the header as the target for the hyperlink. % Mark the header as the target for the hyperlink.
% %
\par \par
\pagebreak[3]
% %
\hyperdef{\defer@space.#4}{#5}{% \hyperdef{\defer@space.#4}{#5}{%
\textbf{\rmfamily\thechapter.#1% \textbf{\rmfamily\thechapter.#1%
...@@ -980,6 +1025,7 @@ ...@@ -980,6 +1025,7 @@
\@startrue% \@startrue%
\cbstart\patch{#7}% \cbstart\patch{#7}%
\fi% \fi%
\pagebreak[1]
% %
% Start the body environment % Start the body environment
% %
...@@ -1035,6 +1081,8 @@ ...@@ -1035,6 +1081,8 @@
\cbend% \cbend%
\@starfalse% \@starfalse%
\fi% \fi%
%
\pagebreak[3]
} }
% Sometime we want "normal" text in the implementation and % Sometime we want "normal" text in the implementation and
...@@ -1044,6 +1092,9 @@ ...@@ -1044,6 +1092,9 @@
\newcommand{\dffamily}{\rmfamily} \newcommand{\dffamily}{\rmfamily}
\fi \fi
\newcommand{\proposal}[1]{%
\ifrelease\else\strut\hfill\textsf{\small #1}\fi
}
% ========== Special Characters ========== % ========== Special Characters ==========
...@@ -1284,28 +1335,28 @@ ...@@ -1284,28 +1335,28 @@
\renewcommand{\chapter}{\@startsection \renewcommand{\chapter}{\@startsection
{chapter}{0}{0pt}{1pt}{\baselineskip} {chapter}{0}{0pt}{1pt}{\baselineskip}
{\normalfont\LARGE\bfseries} {\normalfont\LARGE\sffamily\bfseries}
} }
\renewcommand{\chaptermark}[1]{ \renewcommand{\chaptermark}[1]{
\markboth{\textbf{\thechapter. #1}}{} \markboth{\textsf{\thechapter. #1}}{}
} }
\renewcommand{\section}{\@startsection \renewcommand{\section}{\@startsection
{section}{1}{0pt}{1pt}{1pt} {section}{1}{0pt}{1pt}{1pt}
{\normalfont\Large\bfseries} {\normalfont\Large\sffamily\bfseries}
} }
\renewcommand{\subsection}{\@startsection \renewcommand{\subsection}{\@startsection
{subsection}{2}{0pt}{1pt}{1pt} {subsection}{2}{0pt}{1pt}{1pt}
{\normalfont\large\bfseries} {\normalfont\large\sffamily\bfseries}
} }
\renewcommand{\subsubsection}{\@startsection \renewcommand{\subsubsection}{\@startsection
{subsubsection}{3}{0pt}{1pt}{1pt} {subsubsection}{3}{0pt}{1pt}{1pt}
{\normalfont\normalsize\bfseries} {\normalfont\normalsize\sffamily\bfseries}
} }
\newcommand{\annex}[2][\empty]{% \newcommand{\annex}[2][\empty]{%
\refstepcounter{chapter} \refstepcounter{chapter}
\begin{center} \begin{center}
\normalfont\Large \normalfont\Large\sffamily
{\bfseries Annex \thechapter} \\ {\bfseries Annex \thechapter} \\
(informative) \\ (informative) \\
{\bfseries #2} {\bfseries #2}
...@@ -1319,8 +1370,27 @@ ...@@ -1319,8 +1370,27 @@
\edef\@currentlabelname{\tmp@a}% \edef\@currentlabelname{\tmp@a}%
} }
\usepackage{environ}[2008/06/18]
\NewEnviron{editor}{%
{\color{blue}\fbox{%
\begin{minipage}{\linewidth}
\slshape\textbf{Editor:} \par \BODY
\end{minipage}}}
}
% \@history@label defined/used by history package
\newcommand{\patch}[1]{% {<name>} \newcommand{\patch}[1]{% {<name>}
\edef\temp@b{\thepage.#1}
\ifx\temp@b\@history@label
% Label already used on this page
\marginpar{\tiny{\color{white}c:b}}
\else
% New label for this page
\marginpar{\tiny\textsf{#1}{\color{white}c:b}} \marginpar{\tiny\textsf{#1}{\color{white}c:b}}
\edef\@history@label{\temp@b}
\fi
} }
\newcommand{\strike}[3][3]{% [<end-space>]{<height>}{<width>} \newcommand{\strike}[3][3]{% [<end-space>]{<height>}{<width>}
...@@ -1351,9 +1421,6 @@ ...@@ -1351,9 +1421,6 @@
% ========== ========== % ========== ==========
% ======================================================= % =======================================================
% Reserve a counter for the second title page
\newcounter{savepage}
\begin{document} \begin{document}
% \nochangebars\rule{\linewidth}{1pt}\hspace*{-\linewidth}\rule[3pt]{\linewidth}{1pt} % \nochangebars\rule{\linewidth}{1pt}\hspace*{-\linewidth}\rule[3pt]{\linewidth}{1pt}
...@@ -1363,7 +1430,16 @@ ...@@ -1363,7 +1430,16 @@
\thispagestyle{empty} \thispagestyle{empty}
\def\includefile{} \def\includefile{}
% Change style of page numbering without changing the page number.
% What used to be \frontmatter is now this crap:
\makeatletter
\cleardoublepage
\@tempcnta = \c@page
\frontmatter \frontmatter
\c@page = \@tempcnta
\makeatother
\setcounter{tocdepth}{2} \setcounter{tocdepth}{2}
{\parskip 0pt \tableofcontents} \addcontentsline{toc}{chapter}{\contentsname} {\parskip 0pt \tableofcontents} \addcontentsline{toc}{chapter}{\contentsname}
%%{\parskip 0pt \listoftables} \addcontentsline{toc}{chapter}{\listtablename} %%{\parskip 0pt \listoftables} \addcontentsline{toc}{chapter}{\listtablename}
...@@ -1377,7 +1453,19 @@ ...@@ -1377,7 +1453,19 @@
\include{members-2x} \include{members-2x}
%\include{members-x3} %\include{members-x3}
% Because some people are unable to handle the concept of sheet
% numbers being different to page numbers we have to bastardise
% the page numbering by preserving the page number between
% the font and main matter, converting page number into sheet
% numbering.
% What used to be \mainmatter is now this crap:
\makeatletter
\cleardoublepage
\@tempcnta = \c@page
\mainmatter \mainmatter
\c@page = \@tempcnta
\makeatother
% Part I: Introduction % Part I: Introduction
...@@ -1418,52 +1506,21 @@ ...@@ -1418,52 +1506,21 @@
\cfoot{} \cfoot{}
% ========== New Title Page ==========
% We do not bother to produce a new title page only when we
% are inlineing the rationale.
\iffalse%ifinline
% Save the current page number
\setcounter{savepage}{\value{page}}
% The back page to the first part
% This should be on the next even page.
\pagestyle{empty}
\ifodd\value{page}\else~\newpage\fi
~\vfill
% Copyright \copyright{} \number\year \\
Forth 200\emph{x} Standards Committee \\[2ex]
\url{http://www.forth200x.org/}
% Title page of second part
\include{titlepage}
% Throw a new blank page
~\newpage
\pagestyle{fancy}
% Restore the page number
\setcounter{page}{\value{savepage}}
\fi
% ====================================
% Part III: Rational % Part III: Rational
\appendix \appendix
\include{rationale} \include{rationale} % A
% Part IV: Informative background % Part IV: Informative background
\include{bib} \include{bib} % B
\include{history} % \include{history} % C
\include{diff} \include{diff} % D
\include{port} \include{port} % E
\include{implement} \ifrelease\else
\include{testsuite} \include{implement} % F
\include{testsuite} % G
\fi
% Close the glossary file % Close the glossary file
\immediate\closeout\wordfile \immediate\closeout\wordfile
...@@ -1471,26 +1528,9 @@ ...@@ -1471,26 +1528,9 @@
% Part V: Index % Part V: Index
%\closehistory %\closehistory
\include{changelog} \ifrelease\else
\include{alpha} \include{changelog} % H
\end{document}
% Back Page
\pagestyle{empty}
% At least one blank page between the last page of text
% and the back page
~\newpage
% The back page should be reverse of the last page
\ifodd\count0
~\newpage
\fi \fi
~ \include{alpha} % I
\vfill
% Copyright \copyright{} \number\year \\
Forth 200\emph{x} Standards Committee \\[2ex]
\url{http://www.forth200x.org/}
\end{document} \end{document}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment