From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/nrc/00-2013-feb-authors.txt | 169 + macros/latex/contrib/nrc/README | 44 + macros/latex/contrib/nrc/nrc.dtx | 5471 ++++++++++++++++++++++ macros/latex/contrib/nrc/nrc.ins | 42 + macros/latex/contrib/nrc/userguide.pdf | Bin 0 -> 205720 bytes macros/latex/contrib/nrc/userguide.tex | 2399 ++++++++++ 6 files changed, 8125 insertions(+) create mode 100644 macros/latex/contrib/nrc/00-2013-feb-authors.txt create mode 100644 macros/latex/contrib/nrc/README create mode 100644 macros/latex/contrib/nrc/nrc.dtx create mode 100644 macros/latex/contrib/nrc/nrc.ins create mode 100644 macros/latex/contrib/nrc/userguide.pdf create mode 100644 macros/latex/contrib/nrc/userguide.tex (limited to 'macros/latex/contrib/nrc') diff --git a/macros/latex/contrib/nrc/00-2013-feb-authors.txt b/macros/latex/contrib/nrc/00-2013-feb-authors.txt new file mode 100644 index 0000000000..8892583312 --- /dev/null +++ b/macros/latex/contrib/nrc/00-2013-feb-authors.txt @@ -0,0 +1,169 @@ +This version (2013/02/02 v2.01a) has a housekeeping correction. The +error message + + ! Missing = inserted for \ifnum. + +was provoked by an incorrect date format for \ProvidesClass. + +Old version of nrc.dtx: 2012/11/2 v2.01 +New version of nrc.dtx: 2013/02/02 v2.01a + +Current version of nrc.ins: unchanged from 2002/11/19 + +Current version of userguide: unchanged 18 NOV 2002 + +Christina Thiele +For CSP, 2 February 2013 + +====================================================================== +====================================================================== + + + THE NOTES BELOW ARE UNCHANGED FROM NOV 2012 + ----------------------------- + + + +THIS IS A SLIGHTLY MODIFIED VERSION of the original authors.txt file +for the NRC's macros, last updated Nov 2002. -- Ch. Thiele + +----------------- + + "In September 2010, NRC Research Press (formerly part of the + National Research Council of Canada) transitioned from NRC and the + Federal Government of Canada into an independent not-for-profit + organization operating under the name Canadian Science Publishing." + + [from http://www.nrcresearchpress.com/page/about] + + +This file (00-2012-authors.txt) has been minimally adjusted to reflect +some administrative changes since 2002. + +1. All CSP journals now use the 2-column formal of nrc2.cls. The + .dtx still generates both nrc1 (1-column) and nrc2 (2-column) + class files -- authors should ONLY be using nrc2.cls. + + + The existing README file can still serve for details on how to + generate nrc2.cls via the nrc.ins + nrc.dtx files. The existing + userguide is also still valid and should be downloaded in an + appropriate format. + + + AUTHORS ARE STRONGLY ADVISED TO REPLACE THEIR FORMER + VERSION OF THE CLASS FILE WITH THIS NEW ONE. + + THE USERGUIDE SHOULD ALSO BE DOWNLOADED AND PRINTED OUT. + + +The updated nrc.dtx file will generate a new nrc2.cls file which will +adjust the footer text, to reflect the organisational change: + + old: (Copyright NRC Canada) + + new: (Published by NRC Research Press) + + +In order for author-generated files to be posted to the web, the +updated class file (nrc2.cls) MUST be generated and MUST replace the +old version. + +The .dtx file has the following ID line (old and new): + + old ID line: ]% $Id: nrc.dtx,v 2.141 2002/11/19 17:45:07 rf Exp rf $ + + new ID line: ]% $Id: nrc.dtx,v 2.142 2012/10/31 17:45:07 ct $ + + +NO OTHER CHANGES HAVE BEEN MADE AT THIS TIME. + +Ch. Thiele +2 NOV 2012 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + The notes below focus on author-specific elements + in the userguide, and how to avoid common pitfalls. + + +1. UPDATING AND GENERATING NEW CLASS FILES + + Use the README file to generate the necessary class files and + instructions on where they should be stored on your machine. + + Check CTAN periodically for updates: + + http://mirror.ctan.org/macros/latex/contrib/nrc/ + + +2. DOCUMENTATION + + The Userguide has two main components: information on creating and + coding a file (sections 1 through 5), and additional information + for in-house staff (from section 6 to the end). + + +3. CLASS OPTIONS + + There are no new options. However, there is a simplification of + options for authors. + + The publicly available class files automatically activate + author-specific codes, and de-activate in-house codes (the log file + will provide information/warnings if the latter are accessed). It + is no longer necessary to explicitly insert author-specific codes + such as + + genTeX usecmfonts type1rest + + See section 2.1 for details. + + +4. ADDITIONAL PACKAGES + + Experience has shown that the following packages (all available + from CTAN) are consistently used and provide the additional + functionality authors (and the NRC Research Press) most often + require: + + graphicx rotating + amsmath amssymb bm + cite babel + + As well, tables benefit from the additional options available in + the array package. + + + Any other packages which authors find helpful MUST accompany their + submissions. This is particularly important where submissions are + using old versions of packages --- production staff only have + access to new versions on CTAN; should they have to acquire the + additional (and latest) packages themselves, these may not always + work in the same way as an older version. Of course, authors are + encouraged to use current versions of all additional packages. + + + Additional author-specific macros should be gathered together in + the preamble area, after all other packages have been loaded. See + section 3.2 for details. + + +5. MACROS + + a. New macros: + - \IDnote (Section 4.1) + - \PACS and \PACS* (for Physics) (Section 4.2) + + b. Revised macros: + - \correspond (Section 4.1) + - headings now to 5 levels (Section 4.3) + + c. Retired macros: + - \AddressNote (Section 4.1) + + +Christina Thiele +For CSP, 2 November 2012 + diff --git a/macros/latex/contrib/nrc/README b/macros/latex/contrib/nrc/README new file mode 100644 index 0000000000..d3ee53e13c --- /dev/null +++ b/macros/latex/contrib/nrc/README @@ -0,0 +1,44 @@ +THIS IS A SLIGHTLY MODIFIED VERSION of the original README file +(last updated Oct 2002) for the NRC's macros. -- Ch. Thiele + +----------------- + + + Macros for NRC press journals + +This directory contains macros, and some documentation, for +typesetting papers for submission to journals published by the +National Research Council Research Press. + +Files in this directory are: + + nrc.dtx source of the macros + nrc.ins TeX installation script for the NRC classes + userguide.tex LaTeX documentation file + userguide.pdf PDF documentation + README this file + 00-2012-authors.txt upgrading instructions for authors + +To create the NRC class files for use with (current) LaTeX: + + - download the files nrc.dtx and nrc.ins + - process nrc.ins with LaTeX + - (optionally) move the resulting files nrc1.cls, nrc2.cls (and the + corresponding .sty files) to a directory on your LaTeX input path + (recommended TDS location, for modern freeware installations of + LaTeX, is /tex/latex/nrc/) + +User-level documentation is available (in two forms) as userguide.* +in this directory. If you wish to process userguide.tex, please +delete any old copy of nrcdoc.sty that is to be found on your system +(the file will generate a new copy of nrcdoc.sty in the course of +being processed). + +More TeXnical documentation may be had by processing nrc.dtx with +LaTeX, in the usual way. + +Christina Thiele +For CSP, 2 November 2012 + + + diff --git a/macros/latex/contrib/nrc/nrc.dtx b/macros/latex/contrib/nrc/nrc.dtx new file mode 100644 index 0000000000..635a698f3b --- /dev/null +++ b/macros/latex/contrib/nrc/nrc.dtx @@ -0,0 +1,5471 @@ +% \section{Document preambles} +% +% \begin{macrocode} +%\NeedsTeXFormat{LaTeX2e}[1995/12/01] +%<*dtx> +\ProvidesFile {nrc.dtx} +% +%\ProvidesClass {nrc1} +%\ProvidesPackage{nrc1} +%\ProvidesClass {nrc2} +%\ProvidesPackage{nrc2} +%\ProvidesPackage{baltools} +%<*nrc1|nrc2|balance> + [2013/02/02 v2.01a +% +% NRC single-column journal class% +% NRC single-column journal compatibility package% +% NRC 2-column journal class% +% NRC 2-column journal compatibility package% +% NRC 2-column balancing tools% +%<*dtx> + NRC macros source file% +% +%<*nrc1|nrc2|balance> +]% $Id: nrc.dtx,v 2.143 2013/02/02 17:45:07 ct $ +% +% \end{macrocode} +% +% \iffalse +% +% Note that the RCS version relates to the number of times the file +% has been checked-in, which relates to a development process taking +% place on several machines, rather than the incidence of significant +% change; the definitive version number is that in the \Provides* +% things, while the RCS Id may provide a clue as to the latest date +% the documentation was worked on. +% +% Code to compile the thing using LaTeX2e +% +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +% +% +\begin{document} + \GetFileInfo{nrc.dtx} + \title{The \textsf{nrc} macros\thanks{This file + has version number \fileversion, last + revised \filedate}} + \author{Robin Fairbairns\\\small\texttt{rf10@cam.ac.uk}} + \date{Printed \today} + \maketitle + \tableofcontents + \begin{center} + \fboxsep1.5mm + \framebox{\bfseries + \begin{minipage}{4.5in} + Copyright \copyright\ + Her Majesty the Queen in Right of Canada (1999--\\ + \hphantom{Copyright \copyright\ }% + 2002) as represented by the Minister responsible\\ + \hphantom{Copyright \copyright\ }% + for the National Research Council of Canada. + \end{minipage}} + \end{center} + \DocInput{nrc.dtx} +\end{document} +% +% \end{macrocode} +% +% \fi +% \CheckSum{4586} +% +% \StopEventually{} +% \section{Introduction} +% +% This file generates class files that provide macros for use with +% \LaTeXe{} to typeset journals published by the National Research +% Council of Canada, in both one- (\textsf{nrc1}) and two-column +% (\textsf{nrc2}) formats. +% +% \subsection{Class options} +% +% \begin{macro}{\NRC@clsname} +% \begin{macro}{\NRC@warning} +% \begin{macro}{\hb@xt@} +% \begin{macro}{\NRC@xlap} +% \begin{macro}{\NRC@footer@centre} +% \begin{macro}{\NRC@tpheader@centre} +% \begin{macro}{\NRC@tpfooter@centre} +% First, a few utility definitions, etc. +% +% \cs{hb@xt@} is in modern \LaTeX{} kernels, but \cs{providecommand} +% was there from the very start of \LaTeXe. +% +% \cs{NRC@clsname} is self-explanatory and \cs{NRC@warning} is a +% warning for the class. \cs{NRC@xlap} is a centred lap (a zero-width +% box, like \cs{llap} and \cs{rlap}); the name comes from the +% \textsl{TUGboat} macros. \cs{NRC@footer@centre} is used in the +% footer of pages; it may be blank~--- hence pre-emptive declaration +% here. \cs{NRC@tpfooter@centre} (old style) or +% \cs{NRC@tpheader@centre} (new style) contains the same information on +% the title page, and may also therefore be blank. +% +% \begin{macrocode} +%<*nrc1cls|nrc2cls> +\newcommand{\NRC@clsname}% +%{nrc1} +%{nrc2} +\newcommand{\NRC@warning}[1]{\ClassWarning\NRC@clsname{#1}} +\providecommand{\hb@xt@}{\hbox to} +\newcommand{\NRC@xlap}[1]{\hb@xt@\z@{\hss#1\hss}} +\let\NRC@footer@centre\@empty +%\let\NRC@tpheader@centre\@empty +%\let\NRC@tpfooter@centre\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{landscape} +% \begin{environment}{11pt} +% \begin{environment}{12pt} +% \begin{environment}{a5paper} +% \begin{environment}{b5paper} +% Kill off all actively irrelevant options. (Landscape anything, and +% the standard 5-size papers are too small\dots) Unless we do this, +% we will inherit those options (which are defined by +% \textsf{article.cls}) and cause potential confusion. +% \begin{macrocode} +\DeclareOption{landscape}{\NRC@warning{Option \CurrentOption\space + ignored}} +\DeclareOption{11pt}{\ds@landscape} +\DeclareOption{12pt}{\ds@landscape} +\DeclareOption{a5paper}{\ds@landscape} +\DeclareOption{b5paper}{\ds@landscape} +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% +% \begin{environment}{cmfonts} +% \begin{environment}{type1fonts} +% \begin{environment}{type1rest} +% Font usage: this provides the mechanism to test the class without +% access to the specialised (and rather expensive) fonts used at the +% NRC. +% +% Option \verb|usecmfonts| replaces text Times and Helvetica by +% Computer Modern family fonts. Option \verb|type1rest| uses Times +% and Helvetica, but restricts the set of Helvetica available by +% replacing Helvetica Light by Helvetica (Medium: the regular weight +% of the font), and Helvetica Black by Helvetica Bold. +% +% Option \verb|type1fonts| (the default) uses the complete set of +% Times and Helvetica fonts available in the production process. +% \begin{macrocode} +\newif\if@usecmfonts +\newif\if@restrictedtypeone +\DeclareOption{cmfonts}{\@usecmfontstrue} +\DeclareOption{type1fonts}{\@usecmfontsfalse + \@restrictedtypeonefalse} +\DeclareOption{type1rest}{\@usecmfontsfalse + \@restrictedtypeonetrue} +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% +% \begin{environment}{YandY} +% \begin{environment}{genTeX} +% Option \verb|YandY| specifies that \verb|LY1| encoding should be +% used. Otherwise (option |genTeX|~--- `generic' \TeX{}) we use +% whatever encoding the user specifies (by default, |OT1|). We make +% no moves on input encoding: that's up to the user, regardless\dots +% \begin{macrocode} +\newif\if@yandy +\DeclareOption{YandY}{\@yandytrue} +\DeclareOption{genTeX}{\@yandyfalse} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \begin{environment}{breakaddress} +% \begin{environment}{nobreakaddress} +% These control an aspect of the layout of the address information box +% at the bottom of the title page. +% +% Option \verb|breakaddress| arranges that the address is printed on a +% new line after the list of authors whose address it is. Option +% \verb|nobreakaddress| (the default) arranges that the address runs +% on after the list of authors. +% \begin{macrocode} +\DeclareOption{breakaddress}{\let\if@breakaddress\iftrue} +\DeclareOption{nobreakaddress}{\let\if@breakaddress\iffalse} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \begin{environment}{twocolid} +% \begin{environment}{twocolid*} +% \begin{environment}{onecolid} +% Options \verb'twocolid' and \verb'twocolid*' arrange that the IDbox +% at the bottom of the title page is set over both columns, rather +% than over one column only (which is the default, and which the +% nervous can select by option \verb'onecolid'). The IDbox can be set +% internally in a single column over the entire width of the page +% (option \verb'twocolid'), or in two columns (option +% \verb'twocolid*'). +% \begin{macrocode} +%<*nrc2> +\newif\if@onecolid +\newif\if@multcolid +\DeclareOption{twocolid}{\@onecolidfalse\@multcolidfalse} +\DeclareOption{twocolid*}{\@onecolidfalse\@multcolidtrue} +\DeclareOption{onecolid}{\@onecolidtrue} +% +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% +% \begin{environment}{leqno} +% \begin{environment}{reqno} +% \begin{macro}{\iflefteqnos} +% The option \verb'leqno' (the default) has the same meaning (in +% effect) as does the \verb'article' class option (which in fact loads +% its view of the world through a \verb'.clo' file). The option +% \verb'reqno' restores the standard \TeX{} view of the matter, which +% is sometimes needed in \verb'nrc2'-class papers. +% \begin{macrocode} +\newif\iflefteqnos +\DeclareOption{leqno}{\lefteqnostrue} +\DeclareOption{reqno}{\lefteqnosfalse} +% \end{macrocode} +% \end{macro} +% \end{environment} +% \end{environment} +% +% Now control of the labels in the bibliography. +% +% \begin{environment}{numbib} +% \begin{environment}{nonumbib} +% \begin{macro}{\ifNRC@numbib} +% These options merely switch +% \begin{macrocode} +\newif\ifNRC@numbib +\DeclareOption{numbib}{\NRC@numbibtrue} +\DeclareOption{nonumbib}{\NRC@numbibfalse} +% \end{macrocode} +% \end{macro} +% \end{environment} +% \end{environment} +% +% +% \begin{environment}{author} +% \begin{macro}{\ifNRC@author@use} +% If the class is being used by an author to prepare a paper, there +% are things that can't be entered: for example, final volume, issue, +% or page number, and NRC file number. The |author| class option +% (which will almost never be executed other than by way of +% \cs{ExecuteOptions}) forewarns the class that such commands should +% not be expected. +% \begin{macrocode} +\newif\ifNRC@author@use +\NRC@author@usefalse +\DeclareOption{author}{\NRC@author@usetrue} +% \end{macrocode} +% \end{macro} +% \end{environment} +% +% +% The next two control the preprint/production state of the paper. +% +% \begin{environment}{preprint} +% \begin{environment}{production} +% \begin{macro}{\ifNRC@preprint} +% Option \verb|preprint| causes the page styles to change (omit dates, +% page numbers, etc.), while option \verb|production| (the default) +% sets page styles as required in the production process. Note that +% \verb|preprint| is really `incompatible' (i.e., makes no sense) with +% \verb|trimmarks|, but we don't diagnose the two together. +% \begin{macrocode} +\newif\ifNRC@preprint +\DeclareOption{preprint}{\NRC@preprinttrue} +\DeclareOption{production}{\NRC@preprintfalse} +% \end{macrocode} +% \end{macro} +% \end{environment} +% \end{environment} +% +% Then two that control decorations in page footers. +% +% \begin{environment}{proof} +% \begin{environment}{pagnf} +% \begin{macro}{\NRC@footer@defd} +% Notices that this is a proof printing only, or that it is a printing +% (e.g., on the web) whose pagination differs from the final +% pagination in the journal. +% +% \cs{NRC@footer@defd} records which of these options has been given +% (0 for neither, 1 for |proof|, 2 for |pagnf|); it's used for +% diagnostics here, and (in `original' style) when deciding whether to +% set up the title page footer centre, later. +% \begin{macrocode} +\newcommand{\NRC@footer@defd}{0} +\DeclareOption{proof}{\ifcase\NRC@footer@defd + \renewcommand\NRC@footer@centre{% + \fontsize{14}{16}% + \usefont\f@encoding\sfdefault cn% + \NRC@text@proof + }% +% \let\NRC@tpheader@centre\NRC@footer@centre +% \let\NRC@tpfooter@centre\NRC@footer@centre + \renewcommand{\NRC@footer@defd}{1}% + \or + \NRC@warning{"\CurrentOption" option repeated}% + \or + \NRC@warning{"\CurrentOption" option inconsistent + with "pagnf" option}% + \fi +} +\DeclareOption{pagnf}{\ifcase\NRC@footer@defd + \renewcommand\NRC@footer@centre{% + \fontsize\@xpt\@xiipt% + \usefont\f@encoding\sfdefault mn% + \NRC@text@pagination + }% +% \let\NRC@tpheader@centre\NRC@footer@centre +% \let\NRC@tpfooter@centre\NRC@footer@centre + \renewcommand{\NRC@footer@defd}{2}% + \or + \NRC@warning{"\CurrentOption" option inconsistent + with "proof" option}% + \or + \NRC@warning{"\CurrentOption" option repeated}% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{environment} +% \end{environment} +% +% \begin{environment}{finalverso} +% \begin{environment}{nofinalverso} +% Option |finalverso| specifies that the paper should end on a recto +% page (creating a blank, unnumbered page if the text doesn't for +% itself; the blank page does \emph{not} appear in the paper's page +% count). +% \begin{macrocode} +\newif\if@finalverso +\DeclareOption{finalverso}{\@finalversotrue} +\DeclareOption{nofinalverso}{\@finalversofalse} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% +% +% \begin{environment}{notrimmarks} +% \begin{environment}{trimmarks} +% \begin{macro}{\NRC@toptrim} +% \begin{macro}{\NRC@bottomtrim} +% The next two options control the creation of trim marks. +% +% Option \verb|trimmarks| enables output of trim marks, which are +% needed in the final production process. Option \verb|notrimmarks| +% (the default) suppresses the trim marks. +% \begin{macrocode} +\DeclareOption{notrimmarks}{% + \let\NRC@toptrim\relax + \let\NRC@bottomtrim\relax +} +\DeclareOption{trimmarks}{% + \AtEndOfClass{% + \let\NRC@toptrim\NRC@dotoptrim + \let\NRC@bottomtrim\NRC@dobottomtrim + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} +% \end{environment} +% +% \begin{environment}{english} +% Languages: we recognise the possibility English and French words in +% the structural text of the paper. First, the English variants +% (option \verb|english|, the default): +% \begin{macrocode} +\DeclareOption{english}{% +% \end{macrocode} +% +% \begin{macro}{\ifNRC@french} +% General flag for odds and ends +% \begin{macrocode} +\let\ifNRC@french\iffalse +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@DeclareText} +% Establish the declaration of texts +% \begin{macrocode} +\def\NRC@DeclareText#1#2#3{\def#1{#2}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@text@journal} +% Name of the journal for use in page headers and footers +% \emph{Note}: this value is no longer preset; in the days when there +% was \emph{only} a \texttt{cjp} class, the value was preset to `Can.\ +% J.\ Phys.', but that setting is inappropriate in a class that can be +% used for several different journals. +% \end{macro} +% +% \begin{macro}{\refname} +% \begin{macro}{\tablename} +% These are \LaTeX\ original commands~--- the name for the references +% section of the paper, and the names to use in float captions; these +% have to be deferred to begin document, to avoid the ravages both of +% \textsf{article.cls} and (if the user loads it) of +% \textsf{babel.sty}: +% \begin{macrocode} + \AtBeginDocument{\renewcommand\refname{References}% + \renewcommand\tablename{Table}} +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} +% +% \begin{environment}{french} +% And now the same thing for French (option \verb|french|); note that +% since option |english| is executed by default, all the names defined +% by \cs{newcommand} in that option have to be redefined by +% \cs{renewcommand} here\dots +% \begin{macrocode} +\DeclareOption{french}{% +% \end{macrocode} +% +% \begin{macro}{\ifNRC@french} +% General flag for odds and ends +% \begin{macrocode} +\let\ifNRC@french\iftrue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@DeclareText} +% Establish the declaration of texts +% \begin{macrocode} +\def\NRC@DeclareText#1#2#3{\def#1{#3}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\refname} +% \begin{macro}{\tablename} +% \begin{macrocode} + \AtBeginDocument{\renewcommand\refname{Bibliographie}% + \renewcommand\tablename{Tableau}% + } +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} +% +% Execute the options that define our defaults: +% \begin{macrocode} +%\ExecuteOptions{type1fonts,YandY} +%<*authors> +\IfFileExists{times.sty}% + {\ExecuteOptions{type1rest,genTeX,author}}% + {\ExecuteOptions{cmfonts,genTeX,author}}% +% +\ExecuteOptions{nobreakaddress,notrimmarks,english,% + numbib,nofinalverso% +} +%\ExecuteOptions{onecolid,leqno} +%\ExecuteOptions{reqno} +% +% \end{macrocode} +% +% \begin{environment}{finalbalance} +% \begin{environment}{nofinalbalance} +% \begin{macro}{\ifNRC@finalbalance} +% For the \textsf{baltools} package, we provide just one option, and +% its negation: whether or not to balance columns at the end of the +% document. The default is to balance. +% \begin{macrocode} +%<*balance> +\newif\ifNRC@finalbalance +\DeclareOption{finalbalance}{\NRC@finalbalancetrue} +\DeclareOption{nofinalbalance}{\NRC@finalbalancefalse} +\DeclareOption*{\PackageError{baltools}% + {Option \CurrentOption\space not recognised}} +\ExecuteOptions{finalbalance} +\ProcessOptions +\ifNRC@finalbalance + \AtEndDocument{\if@twocolumn\BalanceColumns\fi} +\fi +% +% \end{macrocode} +% \end{macro} +% \end{environment} +% \end{environment} +% +% Finally (back with the classes), dispose of any remaining options via +% \textsf{article.cls}, tell it to use |leqno| if necessary, and +% |fleqn|, and load it: +% \begin{macrocode} +%<*nrc1cls|nrc2cls> +\DeclareOption*{\PassOptionsToClass\CurrentOption{article}} +\ProcessOptions +\iflefteqnos + \PassOptionsToClass{leqno}{article} +\fi +\LoadClass[fleqn,twoside]{article} +% \end{macrocode} +% +% \subsection{Tidying up after options} +% +% The \textsf{babel} package has the unfortunate habit of changing all +% the structural text elements when the language changes: +% `unfortunate' because we need to use text other than \textsf{babel} +% chooses\dots +% +% We therefore have to arrange that enthusiasm of some of +% \textsf{babel}'s commands is somewhat curtailed. However, at the +% present stage we don't even know if \textsf{babel} is going to be +% loaded, so we dump stuff into the token stream at begin document to +% do the job for us. +% +% For English, the list is relatively straightforward: +% \begin{macrocode} +\AtBeginDocument{\NRC@stripdef{english}\figurename} +% \end{macrocode} +% +% For French, the situation is complicated by the existence of three +% different established language definition files: one distributed +% with current babel itself (\textsf{frenchb}), one distributed with +% the previous edition of babel (\textsf{francais}), and the one +% distributed with the GUTenberg French language support bundle +% (\textsf{french}). At this stage, the only way of determining +% what's going to be loaded, if it does get loaded, is to look for the +% file it will be loaded from: so we have three paths through the code, +% distinguishing on the existence of the various \texttt{*.ldf} files. +% +% The GUTenberg \textsf{french} style does various unamendable things +% that clash with the NRC's requirements, so we warn of the +% possibility of slight confusion if it proves to be present. (The +% NRC themselves do not use the GUTenberg style in production, but +% potential authors may.) +% \begin{macrocode} +\IfFileExists{french.ldf}{% + \def\NRC@french@lang{french}% + \NRC@warning{GUTenberg Babel french style detected -- + \MessageBreak + some corruption of NRC-defined format may occur\@gobble + }% +}{% + \IfFileExists{frenchb.ldf}{% + \def\NRC@french@lang{frenchb}% +% \end{macrocode} +% +% \textsf{frenchb.ldf} has these other odd ideas about how lists +% should be formatted. +% \begin{macrocode} + \AtBeginDocument{% + \@nameuse{bbl@nonfrenchlistspacing}% + }% + }{% + \IfFileExists{francais.ldf}{% + \def\NRC@french@lang{francais}% + }{% + \NRC@warning{No Babel french style detected -- + \MessageBreak + French sections of paper will not be correctly formatted\@gobble}% + \let\NRC@french@lang\@empty + }% + }% +} +\ifx\NRC@french@lang\@empty +\else + \AtBeginDocument{% + \expandafter\NRC@stripdef{\NRC@french@lang}\figurename + \expandafter\NRC@stripdef{\NRC@french@lang}\tablename + \expandafter\NRC@stripdef{\NRC@french@lang}\abstractname + \expandafter\NRC@stripdef{\NRC@french@lang}\refname +% \end{macrocode} +% +% We define our own list spacing and item label layouts, thank you +% very much; this ensures that \textsf{babel}'s |french| option +% doesn't interfere. +% \begin{macrocode} + \@ifpackageloaded{babel}{% + \expandafter\addto\csname extras\NRC@french@lang\endcsname + {\bbl@nonfrenchitemize}% + }{}% + } +\fi +% \end{macrocode} +% +% +% \subsection{Auxiliary package requirements} +% +% Current thinking (at least) is that the \textsf{nrc2} class needs to +% load the \textsf{multicol} package, so (in default of a better place) +% we do that here. +% \begin{macrocode} +%\RequirePackage[infoshow]{multicol} +% \end{macrocode} +% +% +% \subsection{Declaring texts} +% +% A lot of `fixed' texts are used in the classes, and these are +% declared using a \cs{NRC@DeclareText} command, which is established +% during option processing to select the appropriate language for the +% substitution text. +% +% \begin{macro}{\NRC@DeclareText} +% Syntax: \cs{NRC@DeclareText}\marg{\cs{cmd}}\marg{english text}% +% \marg{french text} +% +% Declares `\cs{cmd}' to have English or French substitution text. +% This section of the classes makes use of the command. +% \end{macro} +% +% \begin{macro}{\NRC@text@and} +% Err, a conjunction +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@and}{and}{et} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@text@NRC} +% The name for the National Research Council Canada, for use in page +% footers +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@NRC}{Published by NRC Research Press}% + {Publi\'e par NRC Research Press} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@text@vol} +% The name for `volume', for use in page footers +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@vol}{Vol.}{Vol.} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@text@correspondAll} +% The name for the author for correspondence, when no other +% information is given +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@correspondAll}{Author to whom all + correspondence should be addressed.}{Auteur correspondant.} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@text@correspond} +% The text for the author for correspondence, when extra address, or +% whatever, is given +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@correspond}% + {Corresponding author (e-mail: \@tempa).}% + {Auteur correspondant (courriel~\string: \@tempa).} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@text@present} +% The text for the author's present address +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@present}{Present Address:}% + {Adresse actuelle~\string:} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@text@telephone} +% \begin{macro}{\NRC@text@fax} +% \begin{macro}{\NRC@text@telefax} +% \begin{macro}{\NRC@text@email} +% Texts for telephone, fax, `telefax' and email +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@telephone}{Telephone:}% + {T\'el\'ephone\protect~\string:} +\NRC@DeclareText{\NRC@text@fax}{FAX:}% + {t\'el\'ecopie\protect~\string:} +\NRC@DeclareText{\NRC@text@telefax}{Telephone/FAX:}% + {T\'el\'ephone/t\'el\'ecopie\protect~\string:} +\NRC@DeclareText{\NRC@text@email}{e-mail:}% + {courriel\protect~\string:} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@text@received} +% \begin{macro}{\NRC@text@accepted} +% \begin{macro}{\NRC@text@revreceived} +% \begin{macro}{\NRC@text@revaccepted} +% Texts for `received' and `accepted' +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@received}{Received}% + {Re\c{c}u le} +\NRC@DeclareText{\NRC@text@accepted}{Accepted}% + {Accept\'e le} +\NRC@DeclareText{\NRC@text@revreceived}{Revision received}% + {R\'{e}vision re\c{c}u le} +\NRC@DeclareText{\NRC@text@revaccepted}{Revision accepted}% + {R\'{e}vision accepte\'{e} le} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@text@webpub} +% \begin{macro}{\NRC@text@assoced} +% \begin{macro}{\NRC@text@corred} +% \begin{macro}{\NRC@text@commdate} +% The web publication notice +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@webpub}% + {Published on the NRC Research Press Web site at + \@tempa{} on \@tempb}% + {Publi\'{e} sur le site Web des Presses + scientifiques du CNRC, \`a \@tempa, le \@tempb} +\NRC@DeclareText{\NRC@text@assoced}% + {Paper handled by Associate Editor:}% + {Production de l'article coordonn\'{e}e par + le directeur scientifique associ\'{e}~\string:} +\NRC@DeclareText{\NRC@text@corred}% + {Corresponding Editor:}% + {Directeur scientifique correspondant~\string:} +\NRC@DeclareText{\NRC@text@commdate}% + {Written discussion of this article is welcomed and + will be received by the Editor until}% + {Les commentaires sur le contenu de cet article + doivent \^{e}tre envoy\'{e}s au directeur + scientifique de la revue avant le} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@text@abbreviations} +% Text for `abbreviations' +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@abbreviations}{Abbreviations}% + {Abbr\'eviations} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@text@proof} +% \begin{macro}{\NRC@text@pagination} +% These two appear with both languages in their representation for +% each language mode; doing them in this way makes it possible, +% however, for us to change them to single-language forms with little +% difficulty. +% \begin{macrocode} +\NRC@DeclareText{\NRC@text@proof}{Proof/\'Epreuve}% + {Proof/\'Epreuve} +\NRC@DeclareText{\NRC@text@pagination}{Pagination not final/% + Pagination non finale}% + {Pagination not final/% + Pagination non finale} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@text@citation} +% Citation information: used in the title page footer (in new title +% page layout). +% \begin{macrocode} +%<*newtplayout> +\NRC@DeclareText{\NRC@text@citation}% + {Citation information:}% + {Citation information\protect~\string:}% +% +% \end{macrocode} +% \end{macro} +% +% +% \section{Font usage} +% +% The switch \texttt{@usecmfonts} tells us which fonts are to be used. +% If we're going to use {\small CM} fonts (\cs{@usecmfontstrue}), we +% need to define various things that enable us to use them at sizes +% and in weights required for the use of Helvetica. If we're using +% Times and Helvetica, we merely have to change the default families +% to use (we assume that the |.fd| files carry all the weights we have +% available, or at least those we need to use). +% \begin{macrocode} +\if@usecmfonts + \DeclareFontShape{OT1}{cmss}{m}{n} + { + <5><6><7><8>cmss8 + <9>cmss9 + <10><10.95>cmss10 + <12><14.4><16>cmss12 + <17.28><18><20.74><24.88>cmss17 + }{} + \DeclareFontShape{OT1}{cmss}{l}{n} + {<->ssub*cmss/m/n}{} + \DeclareFontShape{OT1}{cmss}{m}{sl} + { + <5><6><7><8>cmssi8 <9> cmssi9 + <10><10.95>cmssi10 + <12><14.4><16>cmssi12 + <17.28><18><20.74><24.88>cmssi17 + }{} + \DeclareFontShape{OT1}{cmss}{m}{it} + {<->ssub*cmss/m/sl}{} + \DeclareFontShape{OT1}{cmss}{l}{sl} + {<->ssub*cmss/m/sl}{} + \DeclareFontShape{OT1}{cmss}{l}{it} + {<->ssub*cmss/m/sl}{} + \DeclareFontShape{OT1}{cmss}{bx}{n} + { + <5> <6> <7> <8> <9> cmssbx10 + <10> <10.95> <12> <14.4> <16> <17.28> <18> <20.74> <24.88> cmssbx10 + }{} + \DeclareFontShape{OT1}{cmss}{c}{n} + {<->ssub*cmss/bx/n}{} + \DeclareFontShape{OT1}{cmss}{bx}{sl} + {<->sub*cmss/m/sl}{} + \DeclareFontShape{OT1}{cmss}{bx}{it} + {<->sub*cmss/m/sl}{} + \DeclareFontShape{OT1}{cmss}{c}{sl} + {<->sub*cmss/m/sl}{} + \DeclareFontShape{OT1}{cmss}{c}{it} + {<->sub*cmss/m/sl}{} +\else + \renewcommand\rmdefault{ptm} + \renewcommand\sfdefault{phv} + \if@yandy + \RequirePackage[LY1]{fontenc} + \RequirePackage[LY1,mtbold]{mathtime} +% \end{macrocode} +% +% we add the following here, for convenience: +% \begin{macrocode} + \PassOptionsToPackage{dvipsone}{graphics} + \PassOptionsToPackage{dvipsone}{color} + \fi +% \end{macrocode} +% +% If we're using a restricted Type 1 set, establish substitutions that +% can be used by those who haven't released any arms or legs for +% Adobe's use\dots +% \begin{macrocode} + \if@restrictedtypeone + \AtBeginDocument{{\sf + \DeclareFontShape{OT1}{phv}{c}{n}% + {<->ssub*phv/b/n}{}% + \DeclareFontShape{OT1}{phv}{c}{sl}% + {<->ssub*phv/b/sl}{}% + \DeclareFontShape{OT1}{phv}{c}{it}% + {<->ssub*phv/b/sl}{}% + \DeclareFontShape{OT1}{phv}{l}{n}% + {<->ssub*phv/m/n}{}% + \DeclareFontShape{OT1}{phv}{l}{sl}% + {<->ssub*phv/m/sl}{}% + \DeclareFontShape{OT1}{phv}{l}{it}% + {<->ssub*phv/m/sl}{}% + }}% +% \end{macrocode} +% +% If we're using restricted Type1, we assume we're in a puckah PSNFSS +% system, and play safe with \cs{textcopyright} +% \begin{macrocode} + \providecommand\textcopyright{\textcircled{c}} + \else +% \end{macrocode} +% +% We'll assume that full Type1 is using the PC\TeX{} font encodings, +% and proceed to declare symbols on that basis. Sadly, there are no +% standard \LaTeX-style font encoding command sets for this +% encoding\dots +% \begin{macrocode} + \DeclareTextSymbol{\textcopyright}{OT1}{169} + \DeclareTextSymbolDefault{\textcopyright}{OT1} + \DeclareTextSymbol{\textguillemetleft}{OT1}{171} + \DeclareTextSymbolDefault{\textguillemetleft}{OT1} + \DeclareTextSymbol{\textguillemetright}{OT1}{187} + \DeclareTextSymbolDefault{\textguillemetright}{OT1} + \fi +\fi +\providecommand\textcopyright{\textcircled{c}} +% \end{macrocode} +% +% \section{General information} +% +% \begin{macro}{\volyear} +% \begin{macro}{\NRC@volume} +% \begin{macro}{\NRC@year} +% \begin{macro}{\NRC@copyrightyear} +% \begin{macro}{\NRC@years} +% Syntax: \cs{volyear}\marg{volume}\oarg{copyright year}\marg{year} +% +% This volume's number (presumably derivable from the year\dots), +% the year of publication and (optionally) the copyright year (which +% may validly differ from the year of publication, but defaults to +% that year if the optional argument isn't given). +% \begin{macrocode} +\newcommand*\NRC@volume{99} +\newcommand*\NRC@year{} +\edef\NRC@year{\the\year} +\newcommand*\NRC@copyrightyear{} +\let\NRC@copyrightyear\NRC@year +\newcommand\volyear[1]{% + \renewcommand*\NRC@volume{#1}% + \@dblarg\NRC@years +} +\newcommand\NRC@years[2][]{% + \renewcommand*\NRC@copyrightyear{#1} + \renewcommand*\NRC@year{#2}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\journal} +% \begin{macro}{\NRC@text@journal} +% \begin{macro}{\ifNRC@journalcommand} +% \begin{macro}{\ifNRC@knownjournal} +% Syntax: \cs{journal}\marg{journal-name} +% +% Sets up the journal name for use in running feet, etc. If we've +% already had a \cs{journalcode} command that gave us a known journal code, we +% now check for consistency between our journal name and the +% journal code. This command (and \cs{journalcode}) sets up +% \cs{ifNRC@journalcommand} to say at least one of them has been +% processed, and \cs{ifNRC@knownjournal} to say that the argument was +% acceptable. +% \begin{macrocode} +\newif\ifNRC@journalcommand \NRC@journalcommandfalse +\newif\ifNRC@knownjournal +\newcommand*{\journal}[1]{% + \NRC@journalcommandtrue + \renewcommand*\NRC@text@journal{#1}% + \@ifundefined{NRC@jlist@text@journal}% + {% + \NRC@knownjournalfalse + \expandafter\NRC@checkonejournal\NRC@journallist + \ifNRC@knownjournal + \edef\NRC@journal@linenumber{\the\inputlineno}% + \else + \NRC@warning{Journal "\NRC@text@journal" not recognised}% + \fi + }% + {% + \ifx\NRC@text@journal\NRC@jlist@text@journal + \else + \NRC@warning{Journal name inconsistent between\MessageBreak + \string\journalcode\space command on line + \NRC@journalcode@linenumber\space and\MessageBreak + \string\journal\space command}% + \fi + }% +} +\newcommand*{\NRC@text@journal}{} +\@onlypreamble\journal +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\filenumber} +% \begin{macro}{\NRC@a@filenumber} +% \begin{macro}{\NRC@filenumber} +% \begin{macro}{\ifNRC@pagewithfile} +% \begin{macro}{\ifNRC@hadfilenumber} +% \begin{macro}{\NRC@tpfooter@centre} +% Syntax: \cs{NRCfilenumber}\texttt{[*]}\marg{file number string} +% +% Sets the file number to be used in the title page footer and +% (optionally) in printed page numbers. Authors aren't expected to +% know this, so we provide a default; diagnostic code to spot that +% editors haven't provided the command is not yet available. +% +% If the optional \texttt{*} is present, page numbers in the paper +% will be prefixed by the file number. +% \begin{macrocode} +\newif\ifNRC@pagewithfile +\newif\ifNRC@hadfilenumber +\newcommand*{\filenumber}{\@ifstar + {\NRC@pagewithfiletrue\NRC@a@filenumber}% + {\NRC@pagewithfilefalse\NRC@a@filenumber}% +} +\newcommand*{\NRC@a@filenumber}[1]{% + \NRC@hadfilenumbertrue + \renewcommand*{\NRC@filenumber}{#1}% +} +\newcommand*{\NRC@filenumber}{\emph{Zxx-xxx}} +% \end{macrocode} +% +% in case we're not doing a \texttt{proof} or \texttt{pagnf} paper, +% define the centre item of the title page footer; the only +% significant information in it is the file number\dots +% \begin{macrocode} +%<*!newtplayout> +\ifcase\NRC@footer@defd + \renewcommand*{\NRC@tpfooter@centre}{% + \fontsize\@viiipt\@xpt + \usefont\f@encoding\rmdefault mn% + DOI:\ 10.1139/\NRC@filenumber + }% +\fi +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\journalcode} +% \begin{macro}{\jcode} +% \begin{macro}{\NRC@journalcode} +% Syntax: \cs{journalcode}\marg{journal code}, or +% \par\noindent\phantom{Syntax: }\cs{jcode}\marg{journal code} +% +% Defines the code of the journal this paper is aimed at. +% \begin{macrocode} +\newcommand*{\journalcode}[1]{% + \NRC@journalcommandtrue + \renewcommand*{\NRC@journalcode}{#1}% + \NRC@knownjournalfalse + \expandafter\NRC@checkonejournalcode\NRC@journallist + \ifNRC@knownjournal + \ifx\NRC@text@journal\@empty + \let\NRC@text@journal\NRC@jlist@text@journal + \edef\NRC@journalcode@linenumber{\the\inputlineno}% + \else + \ifx\NRC@text@journal\NRC@jlist@text@journal + \else + \NRC@warning{Journal name inconsistent between\MessageBreak + \string\journal\space command on line + \NRC@journal@linenumber\space and \MessageBreak + \string\journalcode\space command% + }% + \fi + \fi + \else + \NRC@warning{Journal code \NRC@journalcode\space not recognised}% + \fi +} +\newcommand{\jcode}{} +\let\jcode\journalcode +\newcommand*{\NRC@journalcode}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\issuenumber} +% \begin{macro}{\NRC@issuenumber} +% \begin{macro}{\NRC@issuenumber@parens} +% Syntax: \cs{issuenumber}\marg{issue number} +% +% The issue number is used in new-style citation information +% \begin{macrocode} +%<*newtplayout> +\newcommand*{\issuenumber}[1]{% + \renewcommand{\issuenumber}{#1}% +} +\newcommand*{\NRC@issuenumber}{} +\newcommand{\NRC@issuenumber@parens}{% + \ifx\NRC@issuenumber\@empty + \else + (\NRC@issuenumber)% + \fi +} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\NRC@journallist} +% A list of journal names, their journal codes and web site addresses. +% Each journal appears as a triple: +% \begin{center} +% \marg{journal code}\marg{English site address}% +%\marg{French site address}\marg{Journal abbrev.} +% \end{center} +% The ``addresses'' here are the first component of the journal's web +% site, to be quoted (by default) in \cs{webpub} +% \begin{macrocode} +\newcommand{\NRC@journallist}{% + {bcb}{bcb}{bbc}{Biochem. Cell Biol.}% + {cgj}{cgj}{rcg}{Can. Geotech. J.}% + {cjb}{canjbot}{revcanbot}{Can. J. Bot.}% + {cjc}{canjchem}{revcanchim}{Can. J. Chem.}% + {cjce}{cjce}{rcgc}{Can. J. Civ. Eng.}% + {cjes}{cjes}{rcst}{Can. J. Earth Sci.}% + {cjfas}{cjfas}{jcsha}{Can. J. Fish. Aquat. Sci.}% + {cjfr}{cjfr}{rcrf}{Can. J. For. Res.}% + {cjm}{cjm}{rcm}{Can. J. Microbiol.}% + {cjp}{cjp}{rcp}{Can. J. Phys.}% + {cjpp}{cjpp}{rcpp}{Can. J. Physiol. Pharmacol.}% + {cjz}{cjz}{rcz}{Can. J. Zool.}% + {er}{er}{de}{Environ. Rev.}% + {gen}{genome}{genome}{Genome}% + {jees}{jees}{rgse}{J. Environ. Eng. Sci.}% + {}{}{}{}% +} +\@onlypreamble\NRC@journallist +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@checkonejournal} +% \begin{macro}{\NRC@checkonejournalcode} +% \begin{macro}{\NRC@jlist@text@journal} +% \begin{macro}{\NRC@def@webaddress} +% Syntax: \cs{NRC@checkonejournal}\marg{journal short code}% +%\marg{english web addr}\par\noindent +%\phantom{Syntax: \cs{NRC@checkonejournal}}\marg{french web addr}% +%\marg{running foot abbrev.}\par\noindent +%\phantom{Syntax: }\cs{NRC@checkonejournalcode} identical +% +% The \cs{check*} commands are actually called with a sequence of +% short codes, web addresses and abbreviations, and munches through +% the lot. This isn't as efficient as it might be, but it's no big +% deal when the job only happens at most three times\dots +% \begin{macrocode} +\newcommand{\NRC@checkonejournal}[4]{% + \def\reserved@a{#4}% + \ifx\reserved@a\@empty + \else + \ifx\reserved@a\NRC@text@journal + \NRC@knownjournaltrue + \def\NRC@jlist@journalcode{#1}% + \def\NRC@def@webaddress{% + http://\ifNRC@french#3.cnrc\else#2.nrc\fi.ca/% + }% + \fi + \expandafter\NRC@checkonejournal + \fi +} +\newcommand{\NRC@checkonejournalcode}[4]{% + \def\reserved@a{#1}% + \ifx\reserved@a\@empty + \else + \ifx\reserved@a\NRC@journalcode + \NRC@knownjournaltrue + \def\NRC@jlist@text@journal{#4}% + \def\NRC@def@webaddress{% + http://\ifNRC@french#3.cnrc\else#2.nrc\fi.ca/% + }% + \fi + \expandafter\NRC@checkonejournalcode + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@setupdefaults} +% Now diagnose the absence of either sort of journal command, and +% provide default values; also diagnose missing \cs{filenumber} +% command here, for good measure +% \begin{macrocode} +\AtBeginDocument{\NRC@setupdefaults} +\newcommand*{\NRC@setupdefaults}{% + \providecommand\NRC@def@webaddress{% + http://www.\ifNRC@french cnrc\else nrc\fi.ca/% + }% + \ifNRC@journalcommand + \else + \NRC@warning{No \string\journal\space or \string\journalcode\space + command given\@gobble + }% + \fi + \ifx\NRC@text@journal\@empty + \def\NRC@text@journal{\texttt{\emph{unknown}}}% + \fi +%<*!newtplayout> + \ifx\NRC@journalcode\@empty + \def\NRC@journalcode{???}% + \fi +% + \ifNRC@hadfilenumber + \else + \ifNRC@author@use + \else + \NRC@warning{No \string\filenumber\space command given\@gobble}% + \fi + \fi +} +\@onlypreamble{\journalcode} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@tpfooter@centre} +% \begin{macro}{\NRC@tpfooter@left} +% \emph{\textbf{Note:}} This code is for the proposed title page +% layout: it is not used in current papers. +% +% Define the footer texts for use on the title page, in terms of +% the things that have been defined in the commands above. +% \begin{macrocode} +%<*newtplayout> +\newcommand*{\NRC@tpfooter@centre}{% + \fontsize\@viiipt\@xpt + \usefont\f@encoding\rmdefault mn% + DOI:\ 10.1139/\NRC@filenumber.% +}% +\newcommand*{\NRC@tpfooter@left}{% + \fontsize\@viiipt\@xpt + \usefont\f@encoding\rmdefault mn% + \NRC@text@citation\ \NRC@text@journal\ % + \textbf{\NRC@volume}\NRC@issuenumber@parens:\ % + (\NRC@year).% +} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Page layout, etc.} +% \subsection{Page dimensions} +% +% \begin{macro}{\hoffset} +% \begin{macro}{\voffset} +% We cancel the curious enforced one-inch-margins\dots +% \begin{macrocode} +\hoffset -1in +\voffset -1in +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@columnwidth} +% Horizontal layout: we treat this fairly `trivially', +% \begin{macrocode} +% \textwidth 34pc +%<*nrc2> +\newdimen\NRC@columnwidth +\paperwidth 51pc +\textwidth 43pc +\NRC@columnwidth 20.75pc +\columnsep 1.5pc +\columnseprule \z@ +% +\hsize \textwidth +\@tempdima \paperwidth +\advance \@tempdima -\textwidth +\evensidemargin 0.5\@tempdima +\oddsidemargin 0.5\@tempdima +% \end{macrocode} +% \end{macro} +% +% Height of text on page is unambiguously defined in NRC1 class: +% \begin{macrocode} +% \textheight 49.5pc +% \end{macrocode} +% +% but is a bit of an ephemeral concept in NRC2 class, since it's +% supposed to be variable within a quoted range. The specification +% says 56pc \ensuremath{\pm} 0.5pc; but \TeX{} doesn't have a concept +% of a limited stretch so we make the basic height 55.5pc, and then +% add a 1pc skip that can shrink to zero at the bottom of the page. +% \begin{macrocode} +%<*nrc2> +\textheight 55.5pc +\def\@textbottom{\vskip 1pc \@minus 1pc} +% +% \end{macrocode} +% +% The head height and separation, and foot skip are set `wrongly' for +% us in \textsf{size10.clo}: +% \begin{macro}{\headheight} +% \begin{macro}{\headsep} +% \begin{macro}{\footskip} +% \begin{macrocode} +\setlength\headheight{10\p@} +%\setlength\headsep {14\p@} +%\setlength\headsep {17\p@} +\setlength\footskip {20\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% We don't change \cs{topskip} and \cs{maxdepth} (which \LaTeX{} +% inscrutably relates to one another\dots) +% +% Now, generate \cs{topmargin} +% \begin{macrocode} +\setlength\topmargin{\paperheight} +\addtolength\topmargin{-\headheight} +\addtolength\topmargin{-\headsep} +\addtolength\topmargin{-\textheight} +\addtolength\topmargin{-\footskip} +\addtolength\topmargin{-.5\topmargin} +% \end{macrocode} +% +% However, that's not quite good enough for letter paper (where we +% seem only to have about \ensuremath{\frac{1}{12}''} to spare when the +% trim marks are there)\dots +% +% Therefore, we boil some sugar, cream and butter to create this nice +% little fudge: +% \begin{macrocode} +\addtolength\topmargin{7.5pt} +% \end{macrocode} +% +% \begin{macro}{\textfloatsep} +% \begin{macro}{\dbltextfloatsep} +% Float separations are quoted relative to the baseline. We achieve +% this using a notional value for \cs{baselineskip}: this is fairly +% safe, given the NRC's style of setting tables, which more-or-less +% guarantees that floats have zero depth. There \emph{is} the slight +% problem of the section head (with attendant larger skip) immediately +% below a float, but there's nothing we can do about that. +% \begin{macrocode} +\setlength{\textfloatsep} +%{3pc} +%{20\p@} +\addtolength{\textfloatsep}{-10\p@} +%\setlength{\dbltextfloatsep}{\textfloatsep} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@restore@dbltextfloatsep} +% Syntax: \cs{NRC@restore@dbltextfloatsep} +% +% For use in pagestyle commands to restore the text float separation +% (currently, just for the first page, where it has been zapped by +% two-column version of \cs{maketitle} +% \begin{macrocode} +%<*nrc2> +\edef\NRC@restore@dbltextfloatsep{% + \global\noexpand\dbltextfloatsep \the\dbltextfloatsep} +% +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Page Styles} +% +% \begin{macro}{\ps@nrctitlepage} +% Syntax: \cs{thispagestyle}|{nrctitlepage}| +% +% Establishes the page layout for the title page of a paper. The +% definition is not needed for \verb'nrc1' preprints, but (because the +% page style is used when creating one-column IDboxes) it is defined +% for \verb'nrc2' preprints, in a form that doesn't differ much from +% the body style \cs{ps@nrc} +% \begin{macrocode} +\ifNRC@preprint + \newcommand\ps@nrctitlepage{% + \let\@evenhead\@empty + \let\@oddhead\@empty + \def\@evenfoot{% + {% +% \end{macrocode} +% +% pull the one-column IDbox into the text area if necessary +% \begin{macrocode} +%<*nrc2> + \if@onecolid\else + \NRC@restorefootskip + \raise\footskip\hb@xt@\z@{% + \vbox to\z@{\vss\box\NRC@theIDbox}% + \hss + }% + \fi +% +% \rlap{\NRC@tpfooter@left}% + \hfill\NRC@xlap{\NRC@tpfooter@centre}% + \hfill\llap{% + \fontsize\@viiipt\@xpt + \usefont\f@encoding\rmdefault mn% + \NRC@text@NRC% + }% + }% + }% + \let\@oddfoot\@evenfoot + \let\@mkboth\@gobbletwo + \let\sectionmark\@gobble + \let\subsectionmark\@gobble + \let\appendixmark\@gobble + } +\else + \newcommand\ps@nrctitlepage{% + \renewcommand\@oddhead{% + {% + \NRC@toptrim + \hfill + {% +%<*newtplayout> + \hfill + \NRC@xlap{\NRC@tpheader@centre}% + \hfill\llap{% +% + \fontsize\@ixpt\@xiipt + \usefont\f@encoding\sfdefault ln% + \ifNRC@pagewithfile\NRC@filenumber-\fi\thepage +% }% + }% +% \NRC@restore@dbltextfloatsep + }% + }% + \renewcommand\@evenhead{% + {% + \NRC@toptrim + {% +% \rlap{% + \fontsize\@ixpt\@xiipt + \usefont\f@encoding\sfdefault ln% + \ifNRC@pagewithfile\NRC@filenumber-\fi\thepage +%<*newtplayout> + }% + \hfill + \NRC@xlap{\NRC@tpheader@centre}% + \hfill +% + }% +% \NRC@restore@dbltextfloatsep + }% + }% + \renewcommand\@oddfoot{% + {% + \NRC@bottomtrim +%<*nrc2> +% \end{macrocode} +% +% If we have a column-spanning ID box, we insert it here, raised into +% the position it would (ought to) be if it had appeared as a bottom +% float\dots +% \begin{macrocode} + \if@onecolid\else + \NRC@restorefootskip + \raise\footskip\hb@xt@\z@{% + \vbox to\z@{\vss\box\NRC@theIDbox}% + \hss + }% + \fi +% +% \rlap{\NRC@tpfooter@left}% +%<*!newtplayout> + \rlap{% + \fontsize\@viiipt\@xpt + \usefont\f@encoding\rmdefault mn% + \NRC@text@journal\ \textbf{\NRC@volume}% + \ifNRC@french\ \fi: + \ifNRC@pagewithfile\NRC@filenumber-\fi + \pageref{\jobname.start.page}--% + \ifNRC@pagewithfile\NRC@filenumber-\fi + \pageref{\jobname.end.page} + (\NRC@year)% + }% +% + \hfill\NRC@xlap{\NRC@tpfooter@centre}% + \hfill\llap{% + \fontsize\@viiipt\@xpt + \usefont\f@encoding\rmdefault mn% + \NRC@text@NRC% + }% + }% + }% + \let\@evenfoot\@oddfoot + \let\@mkboth\@gobbletwo + \let\sectionmark\@gobble + \let\subsectionmark\@gobble + \let\appendixmark\@gobble + } +\fi +% \end{macrocode} +% \end{macro} +% +% The above uses two labels, one each for the start and the end of the +% paper. We need to arrange that they get defined (note that the +% start page has to be defined \cs{AtBeginDocument} because typically +% the start page isn't even set until then, and in any case its number +% has to be written to the \verb'.aux' output which isn't open until +% just before \cs{AtBeginDocument}). +% +% \begin{macrocode} +\AtBeginDocument{\immediate\write\@auxout{\string\newlabel + {\jobname.start.page}{{}{\thepage}}}} +\AtEndDocument{\clearpage + \@tempcnta\c@page + \advance\@tempcnta-1 + \immediate\write\@auxout{\string\newlabel{\jobname.end.page}% + {{}{\number\@tempcnta}}}% + \if@finalverso\thispagestyle{nrcempty}\cleardoublepage\fi +} +% \end{macrocode} +% +% [The code for the last page is derived from \texttt{lastpage.sty} by +% Jeff Goldberg, which is available on CTAN.] +% +% \begin{macro}{\ps@nrc} +% Syntax: \cs{pagestyle}|{nrc}| +% +% Establishes the page layout for the body of a paper (or, in the case +% of a preprint, for all of a paper, since a preprint has no +% distinctions\dots) +% \begin{macrocode} +\ifNRC@preprint + \newcommand\ps@nrc{% + \def\@evenhead{% + {% + \fontsize\@ixpt\@xiipt + \usefont\f@encoding\sfdefault ln% + \hfill + \NRC@text@journal + }% + }% + \def\@oddhead{% + {% + \fontsize\@ixpt\@xiipt + \usefont\f@encoding\sfdefault ln% + \@shortauthor\hfill + }% + }% + \def\@evenfoot{% + {% + \hfill\NRC@xlap{\NRC@footer@centre}% + \hfill\llap{% + \fontsize\@viiipt\@xpt + \usefont\f@encoding\rmdefault mn% + \NRC@text@NRC% + }% + }% + }% + \let\@oddfoot\@evenfoot + \let\@mkboth\@gobbletwo + \let\sectionmark\@gobble + \let\subsectionmark\@gobble + \let\appendixmark\@gobble + } +\else + \newcommand\ps@nrc{% + \def\@evenhead{% + {% + \NRC@toptrim + \fontsize\@ixpt\@xiipt + \usefont\f@encoding\sfdefault ln% + \ifNRC@pagewithfile\NRC@filenumber-\fi\thepage\hfill + \NRC@text@journal\ \NRC@text@vol\ \NRC@volume, \NRC@year + }% + }% + \def\@oddhead{% + {% + \NRC@toptrim + \fontsize\@ixpt\@xiipt + \usefont\f@encoding\sfdefault ln% + \@shortauthor\hfill + \ifNRC@pagewithfile\NRC@filenumber-\fi\thepage + }% + }% + \def\@evenfoot{% + {% + \NRC@bottomtrim + \hfill\NRC@xlap{\NRC@footer@centre}% + \hfill\llap{% + \fontsize\@viiipt\@xpt + \usefont\f@encoding\rmdefault mn% + \NRC@text@NRC% + }% + }% + }% + \let\@oddfoot\@evenfoot + \let\@mkboth\@gobbletwo + \let\sectionmark\@gobble + \let\subsectionmark\@gobble + \let\appendixmark\@gobble + } +\fi +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ps@nrcplain} +% Syntax: \cs{pagestyle}|{nrcplain}| +% +% The page style for special title (only) pages (i.e., those +% containing a \cs{specialtitle*} command). +% \begin{macrocode} +\ifNRC@preprint + \newcommand\ps@nrcplain{% + \let\@evenhead\@empty + \let\@oddhead\@evenhead + \def\@evenfoot{% + {% + \hfill + \fontsize\@ixpt\@xiipt + \usefont\f@encoding\rmdefault mn% + \ifNRC@pagewithfile\NRC@filenumber-\fi\thepage + \hfill + }% + }% + \let\@oddfoot\@evenfoot + \let\@mkboth\@gobbletwo + \let\sectionmark\@gobble + \let\subsectionmark\@gobble + \let\appendixmark\@gobble + } +\else + \newcommand\ps@nrcplain{% + \def\@evenhead{% + \NRC@toptrim + \hfill + }% + \let\@oddhead\@evenhead + \def\@evenfoot{% + {% + \NRC@bottomtrim + \hfill + \fontsize\@ixpt\@xiipt + \usefont\f@encoding\rmdefault mn% + \ifNRC@pagewithfile\NRC@filenumber-\fi\thepage + \hfill + }% + }% + \let\@oddfoot\@evenfoot + \let\@mkboth\@gobbletwo + \let\sectionmark\@gobble + \let\subsectionmark\@gobble + \let\appendixmark\@gobble + } +\fi +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\ps@nrcempty} +% Syntax: \cs{pagestyle}|{nrcempty}| +% +% The page style for blank final (uncounted) verso pages +% \begin{macrocode} +\ifNRC@preprint + \let\ps@nrcempty\ps@empty +\else + \newcommand\ps@nrcempty{% + \def\@evenhead{% + \NRC@toptrim + \hfill + }% + \let\@oddhead\@evenhead + \def\@evenfoot{% + \NRC@bottomtrim + \hfill + }% + \let\@oddfoot\@evenfoot + \let\@mkboth\@gobbletwo + \let\sectionmark\@gobble + \let\subsectionmark\@gobble + \let\appendixmark\@gobble + } +\fi +% \end{macrocode} +% \end{macro} +% +% +% +% The default page style is that for the body of journal\dots +% \begin{macrocode} +\pagestyle{nrc} +% \end{macrocode} +% +% \subsection{Trim marks} +% +% \begin{macro}{\NRC@dotoptrim} +% \begin{macro}{\NRC@dobottomtrim} +% +% These commands generate the trim marks, and are for use +% (respectively) in the headers and footers of pages +% \begin{macrocode} +\newcommand\NRC@dotoptrim{% + \hb@xt@\z@{% + \vbox to\z@{% + \vss + \hb@xt@\textwidth{% + \llap{% + \NRC@left@trimrule + \NRC@up@trimrule + \hskip\NRC@trimhsep + }% + \hss + \rlap{% + \hskip\NRC@trimhsep + \NRC@up@trimrule + \NRC@right@trimrule + }% + }% + \vskip\NRC@trimtopsep + }% + \hss + }% +} +\newcommand\NRC@dobottomtrim{% + \hb@xt@\z@{% + \vbox to\z@{% + \vskip\NRC@trimbotsep + \hb@xt@\textwidth{% + \llap{% + \NRC@left@trimrule + \NRC@down@trimrule + \hskip\NRC@trimhsep + }% + \hss + \rlap{% + \hskip\NRC@trimhsep + \NRC@down@trimrule + \NRC@right@trimrule + }% + }% + \vss + }% + \hss + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@trimhsep} +% \begin{macro}{\NRC@trimtopsep} +% \begin{macro}{\NRC@trimbotsep} +% +% These macros define separations of the trim marks from the body of +% the text of the page. Note that \cs{NRC@trimhsep} is as specified, +% but \cs{NRC@trimtopsep} and \cs{NRC@trimbotsep} are specified in +% terms of distances from the text body, and so have \cs{headsep} and +% \cs{footskip} (respectively) subtracted from them. +% \begin{macrocode} +\newcommand\NRC@trimhsep{4pc} +\newcommand\NRC@trimtopsep{54pt} +\newcommand\NRC@trimbotsep{30pt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@up@trimrule} +% \begin{macro}{\NRC@down@trimrule} +% \begin{macro}{\NRC@left@trimrule} +% \begin{macro}{\NRC@right@trimrule} +% +% These macros construct the constituent bits of the trim marks +% \begin{macrocode} +\newcommand\NRC@up@trimrule{% + \vrule\@height\NRC@trimvsize + \@depth\NRC@trimvgap + \@width\NRC@trimthickness +} +\newcommand\NRC@down@trimrule{% + \vrule\@height\NRC@trimvgap + \@depth\NRC@trimvsize + \@width\NRC@trimthickness +} +\newcommand\NRC@left@trimrule{% + \vrule\@height\NRC@trimhalfthick + \@depth\NRC@trimhalfthick + \@width\NRC@trimhsize + \hskip\NRC@trimhgap +} +\newcommand\NRC@right@trimrule{% + \hskip\NRC@trimhgap + \vrule\@height\NRC@trimhalfthick + \@depth\NRC@trimhalfthick + \@width\NRC@trimhsize +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@trimhsize} +% \begin{macro}{\NRC@trimvsize} +% \begin{macro}{\NRC@trimhalfthick} +% \begin{macro}{\NRC@trimthickness} +% \begin{macro}{\NRC@trimhgap} +% \begin{macro}{\NRC@trimvgap} +% +% These macros specify the dimensions of trim marks; requirements are: +% \begin{itemize} +% \item \cs{NRC@trimhalfthick} should be half \cs{NRC@trimthickness} +% \item \cs{NRC@trim*size} are \emph{nominally} 3pc each +% \item \cs{NRC@trimvsize} should incorporate \cs{NRC@trimvgap} +% \end{itemize} +% \begin{macrocode} +\newcommand\NRC@trimhsize{36\p@} +\newcommand\NRC@trimvsize{39\p@} +\newcommand\NRC@trimhalfthick{0.1\p@} +\newcommand\NRC@trimthickness{0.2\p@} +\newcommand\NRC@trimhgap{3\p@} +\newcommand\NRC@trimvgap{-3\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \subsection{Parallel setting of multilingual text} +% +% \begin{environment}{par-text} +% \begin{macro}{\NRC@enclosingenv} +% Syntax: \cs{begin}\verb|{par-text}|\oarg{right language}\oarg{left +% width}\oarg{separation}\oarg{right width} +% +% Set parallel (bilingual) text. +% +% If \meta{right language} is present, it will be selected as a +% language (using Babel commands) in the right column. If \meta{left +% width} is present, it will be used as the width of the left column; +% otherwise the width will be set to \texttt{15.5pc} (nrc1), or +% \texttt{20.75pc} (nrc2). If +% \meta{separation} is present, it will be used as the separation +% between the two columns; otherwise that separation will be set to +% \texttt{1.5pc}. If \meta{right width} is present, it will be used as +% the width of the right column; otherwise the width will be set to +% \cs{textwidth}\(-\)\meta{left width}\(-\)\meta{separation}. +% +% Thus the two `standard' ways of using the environment start with the +% commands: +% \begin{itemize} +% \item\verb|\begin{par-text}[french]| +% +% Which assumes that Babel has been loaded, and that the main language +% in the document is English. In this case, the left column will be +% in English, the right column in French. +% \item\verb|\begin{par-text}[english][17pc]| +% +% Which assumes that Babel has been loaded, and the surrounding text +% is in French. En ce cas, la colonne gauche se presente en fran\c cais, +% la colonne droite en anglais. +% \end{itemize} +% +% We start by grabbing the first argument. If it's present, we +% transform it to a \textsf{babel} \cs{select@language} command. +% (Note that the `natural' \cs{selectlanguage} command would write +% language selection guff to the \verb|.aux| file, which causes havoc +% with box alignment, so we use the internal command instead.) +% \begin{macrocode} +\newenvironment{par-text}[1][]{% +% \end{macrocode} +% +% If we're in a two-column class, ensure we've got the full width +% available to us\dots +% \begin{macrocode} +%<*nrc2> + \if@twocolumn + \BalanceColumns[0.5]% + \fi +% + \def\@rightlanguage{#1}% + \ifx\@rightlanguage\@empty + \else + \edef\@rightlanguage{% + \noexpand\select@language{\@rightlanguage}% + }% + \fi +% \end{macrocode} +% +% Now we set \cs{NRC@enclosingenv} and look for the second, third and +% fourth optional arguments. This is boring code indeed\dots +% \begin{macrocode} + \let\NRC@enclosingenv\@currenvir + \@ifnextchar[%] + \NRC@partext@a +% {\NRC@partext@a[15.5pc][1.5pc][17pc]}% +% {\NRC@partext@a[20.75pc][1.5pc][20.75pc]}% +}% +{\par} +% \end{macrocode} +% +% \cs{NRC@enclosingenv} is set either to \cs{relax} or to the +% enclosing \verb|par-text| environment name. +% \begin{macrocode} +\let\NRC@enclosingenv\relax +% \end{macrocode} +% \end{macro} +% \end{environment} +% +% Three syntax support commands follow. +% +% \begin{macro}{\NRC@partext@a} +% \begin{macro}{\NRC@par@leftwidth} +% Syntax: \cs{NRC@partext@a}\oarg{left +% width}\oarg{separation}\oarg{right width} +% \begin{macrocode} +\def\NRC@partext@a[#1]{% + \def\NRC@par@leftwidth{#1}% + \@ifnextchar[%] + \NRC@partext@b + {\NRC@partext@b[1.5pc][\z@]}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@partext@b} +% \begin{macro}{\NRC@par@separation} +% Syntax: \cs{NRC@partext@b}\oarg{separation}\oarg{right width} +% \begin{macrocode} +\def\NRC@partext@b[#1]{% + \def\NRC@par@separation{#1}% + \NRC@partext@c +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@partext@c} +% \begin{macro}{\NRC@par@rightwidth} +% \begin{macro}{\NRC@warning@inconpar} +% Syntax: \cs{NRC@partext@c}\oarg{right width} +% \begin{macrocode} +\newcommand\NRC@partext@c[1][\z@]{% + \@tempdima#1\relax + \ifdim\@tempdima>\z@ + \def\NRC@par@rightwidth{#1}% + \@tempdima #1\relax + \advance\@tempdima \NRC@par@separation\relax + \advance\@tempdima \NRC@par@leftwidth\relax + \ifdim\@tempdima > \textwidth + \NRC@warning@inconpar + \fi + \else + \@tempdima\textwidth + \advance\@tempdima -\NRC@par@leftwidth\relax + \advance\@tempdima -\NRC@par@separation\relax + \ifdim\@tempdima>\z@ + \else + \NRC@warning@inconpar + \fi + \edef\NRC@par@rightwidth{\the\@tempdima}% + \fi + \NRC@last@parparafalse + \par +} +\def\NRC@warning@inconpar{% + \NRC@warning{Inconsistent parameters for environment par-text}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\ifNRC@last@parpara} +% \begin{macro}{\NRC@last@parparatrue} +% \begin{macro}{\NRC@last@parparafalse} +% Controlling vertical spacing in between blocks of parallel +% paragraphs +% \begin{macrocode} +\def\NRC@last@parparatrue{\global\let\ifNRC@last@parpara\iftrue} +\def\NRC@last@parparafalse{\global\let\ifNRC@last@parpara\iffalse} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\parallelparsep} +% \begin{macro}{\NRC@parpara@sep} +% Syntax: \cs{parallelparsep}\marg{paragraph separation} +% +% Sets the separation between paragraphs in a \verb|par-text| +% environment to the argument (which is a rubber length) +% \begin{macrocode} +\newcommand\parallelparsep[1]{\gdef\NRC@parpara@sep{#1}} +\parallelparsep{1pc} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Now the original environments for setting left and right columns +% separately. +% +% \begin{environment}{leftcolumn} +% \begin{macro}{\ifNRC@firstleftcolumn} +% \begin{macro}{\NRC@checknesting} +% Set the left-hand column of the bilingual text. The left column is +% presumed to be in the base language of the document. +% \begin{macrocode} +\newif\ifNRC@firstleftcolumn \global\NRC@firstleftcolumntrue +\newenvironment{leftcolumn}{% + \ifNRC@last@parpara + \vskip\NRC@parpara@sep\relax + \else + \NRC@last@parparatrue + \fi + \NRC@checknesting + \noindent + \begin{minipage}[t]{\NRC@par@leftwidth}% + \NRC@sectragged + \usefont\f@encoding\sfdefault mn% + \ifNRC@firstleftcolumn + \global\NRC@firstleftcolumnfalse + \else + \hspace*{\NRC@par@parindent}% + \fi + \strut\ignorespaces +}{% + \strut + \end{minipage}% + \NRC@insertignore\NRC@colsepskip +}% +\def\NRC@checknesting{% + \def\@tempa{par-text}% + \ifx\@tempa\NRC@enclosingenv + \else + \NRC@warning{\@currenvir\space environment may only be used% + \MessageBreak + within a \@tempa\space environment}% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} +% +% \begin{environment}{rightcolumn} +% \begin{macro}{\ifNRC@firstrightcolumn} +% Set the right-hand column of the bilingual text. This is set either +% in the \meta{right language} (if that argument was given), or in the +% base language. +% \begin{macrocode} +\newif\ifNRC@firstrightcolumn \global\NRC@firstrightcolumntrue +\newenvironment{rightcolumn}{% + \NRC@checknesting + \noindent + \begin{minipage}[t]{\NRC@par@rightwidth}% + \NRC@sectragged + \usefont\f@encoding\sfdefault mn% + \@rightlanguage + \ifNRC@firstrightcolumn + \global\NRC@firstrightcolumnfalse + \else + \hspace*{\NRC@par@parindent}% + \fi + \strut\ignorespaces +}{% + \strut + \end{minipage}% + \NRC@insertignore\par +}% +% \end{macrocode} +% \end{macro} +% \end{environment} +% +% +% \begin{macro}{\NRC@par@parindent} +% Simply defined to be the `paragraph' indentation in parallel text +% \begin{macrocode} +\def\NRC@par@parindent{\@xiipt\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@colsepskip} +% Syntax: \cs{NRC@colsepskip} +% +% Skip to separate the columns in a 2-column section. Default is +% \texttt{2pc}: this value is programmed into \cs{NRC@par@separation} +% at the time the arguments to the \verb|par-para| environment are +% decoded +% \begin{macrocode} +\def\NRC@colsepskip{\hskip\NRC@par@separation\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{par-para} +% \begin{macro}{\othercol} +% \begin{macro}{\NRC@leftbox} +% \begin{macro}{\NRC@rightbox} +% Syntax: \cs{begin}\verb|{par-para}| \meta{left text} \cs{othercol} +% \meta{right text} \cs{end}\verb|{par-para}| +% +% Set a pair of paragraphs of parallel text +% \begin{macrocode} +\newbox\NRC@leftbox +\newbox\NRC@rightbox +\newenvironment{par-para}{% + \ifNRC@last@parpara + \vskip\NRC@parpara@sep\relax + \else + \NRC@last@parparatrue + \fi + \NRC@checknesting + \NRC@ignorespacesandpars\NRC@gatherleft +}% +% \end{macrocode} +% So here we are, with the left paragraph in \cs{NRC@leftbox} and an +% unterminated right paragraph being set into \cs{NRC@rightbox} +% \begin{macrocode} +{% + \unskip + \egroup +% \end{macrocode} +% +% Now we've got both paragraphs in their boxes, so we have to play +% them out into single lines of parallel text. +% \begin{macrocode} + {% + \vbadness\@M + \vfuzz5ex + \let\@tempa\p@ + \par + \loop + \ifvoid\NRC@leftbox + \ifvoid\NRC@rightbox + \let\@tempa\z@ + \fi + \fi + \ifdim\@tempa>\z@ + \hb@xt@\textwidth{% + \vbox{\ifvoid\NRC@leftbox + \hrule\@width\NRC@par@leftwidth\@height\z@\@depth\z@ + \else + \setbox\@tempboxa\vsplit\NRC@leftbox to\p@ + \unvbox\@tempboxa + \fi}% + \NRC@colsepskip + \vbox{\ifvoid\NRC@rightbox + \hrule\@width\NRC@par@rightwidth\@height\z@\@depth\z@ + \else + \setbox\@tempboxa\vsplit\NRC@rightbox to\p@ + \unvbox\@tempboxa + \fi}% + }% + \repeat + }% + \par +} +% \end{macrocode} +% +% \begin{macro}{NRC@gatherleft} +% \cs{NRC@gatherleft} sets up gathering the left column paragraph of a +% \verb|par-para| environment into its box. The process is terminated +% in \cs{othercol} +% \begin{macrocode} +\newcommand\NRC@gatherleft{% + \setbox\NRC@leftbox\vbox\bgroup + \hsize\NRC@par@leftwidth\relax + \usefont\f@encoding\sfdefault mn% + \noindent + \ifNRC@firstleftcolumn + \global\NRC@firstleftcolumnfalse + \else + \hspace*{\NRC@parallelparindent}% + \fi + \NRC@sectragged + }% +% \end{macrocode} +% +% \begin{macro}{\othercol} +% \cs{othercol} terminates the collection that \cs{NRC@gatherleft} +% started, and then initiates the collection of the right column via +% \cs{NRC@gatherright} +% paragraph (which collection is completed in the +% \cs{end}\verb|{par-para}| `macro'). +% \begin{macrocode} +\newcommand\othercol{% + \unskip + \egroup + \NRC@ignorespacesandpars\NRC@gatherright +} +% \end{macrocode} +% +% \begin{macro}{\NRC@gatherright} +% \cs{NRC@gatherright} completes the |par-para| environment, by +% initiating collection of the right hand column of the pair, which +% collection is terminated in the \cs{end}|{par-para}| `macro' +% \begin{macrocode} +\newcommand\NRC@gatherright{% + \setbox\NRC@rightbox\vbox\bgroup + \hsize\NRC@par@rightwidth\relax + \usefont\f@encoding\sfdefault mn% + \@rightlanguage + \noindent + \ifNRC@firstrightcolumn + \global\NRC@firstrightcolumnfalse + \else + \hspace*{\NRC@parallelparindent}% + \fi + \NRC@ignorespacesandpars\NRC@sectragged +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{environment} +% +% \begin{macro}{\NRC@parallelparindent} +% Simply defined to be the `paragraph' indentation in parallel text +% \begin{macrocode} +\def\NRC@parallelparindent{10\p@} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Full-width intervals in two-column papers} +% +% Naturally, this code is not provided in the one-column class, just +% the 2-column class and the column-balancing package. +% \begin{macrocode} +% +%<*nrc2cls|balance> +% \end{macrocode} +% +% \begin{macro}{\BalanceColumns} +% \begin{macro}{\@tempboxb} +% +% Syntax: \cs{BalanceColumns}\oarg{epsilon} +% +% Balances what's left as contributions to the final page, subject to +% fudge-factor \emph{epsilon} in the final balancing: the default +% factor is \texttt{0.5}, and it's multiplied by \cs{baselineskip} and +% then added to the `target' height of the left column which is passed +% to the \cs{vsplit} primitive +% +% A spare temporary box, needed for \cs{BalanceColumns}~\dots\ or could +% we use \cs{@holdpg}? +% \begin{macrocode} +\newbox\@tempboxb +% \end{macrocode} +% +% \begin{macrocode} +\newcommand\BalanceColumns[1][0.5]{% +% \end{macrocode} +% +% ensure we're in vertical mode +% \begin{macrocode} + \par +% \end{macrocode} +% +% insert a zero penalty to ensure that the penultimate page is output +% properly +% \begin{macrocode} + \penalty\z@ +% \end{macrocode} +% +% define a dummy output routine for gathering up what's left at the +% end of the last page: +% \begin{macrocode} + \def\@dummy@balance@output{% + \if@firstcolumn + \ifx\@toplist\@empty + \global\setbox\@tempboxa \vbox{\unvbox\@cclv}% + \else + % 1. (?) get rid of \topskip glue at the top of \@cclv + % 2. insert the top float(s) and the appropriate separations + % 3. adjust \@colroom and so on + \global\setbox\@tempboxa \vbox{% + \@tempswatrue + \NRC@return@floats\@toplist\@toproom\@topnum\@empty + \vspace\textfloatsep + \unvbox\@cclv + }% + % 4. (?) warn about potential problems? + % ... or ... + % moan about the thing being there in the first place? + \fi + \else +% \end{macrocode} +% +% we were in the right-hand column, so box 255 has (at this stage) got +% a \cs{topskip} glue in it (which we definitely don't want), so we +% stick in a penalty and \cs{vsplit} if off again, which loses the +% glue for us\dots +% \begin{macrocode} + \setbox\@cclv \vbox{% + \penalty-\@M + \unvbox\@cclv}% + \splittopskip\topskip + \splitmaxdepth\maxdepth + \setbox\@tempboxa \vsplit\@cclv to\z@ +% \end{macrocode} +% +% now reassemble the two columns into one, in \cs{@tempboxa} +% \begin{macrocode} + \ifx\@toplist\@empty + % insert top floats in the right column here? + % ... or ... + \else + % moan at their very existence? +% \PackageWarning{baltools}{% +% \NRC@warning{% + Top float(s) (2nd column) lost in balancing}% + \@tempswafalse + \NRC@return@floats\@toplist\@toproom\@topnum\@empty + \fi + \global\setbox\@tempboxa \vbox{% + \unvbox\@leftcolumn + \unskip + \unvbox\@cclv}% + \fi + }% +% \end{macrocode} +% +% now check if there are outstanding floats, and moan if so (I'm not +% in the slightest particular sure whether the presence of floats can +% be dealt with at all without major restructuring, so we complain +% instead\dots). +% +% Note, we \emph{don't}, now, complain about deferred floats (they're +% the user's problem), but bottom floats have me stumped. (In-text +% floats have already been committed by the time we get to this stage, +% and it's acceptable simply to return them): +% \begin{macrocode} + \ifx\@botlist\@empty\else +% \PackageWarning{baltools}{% +% \NRC@warning{% + Bottom floats outstanding when balancing may be lost\MessageBreak + What's more, balancing may be invalid}% + \fi + \xdef\@freelist{\@freelist\@midlist} +% \end{macrocode} +% +% Acquire the output contributions so far, by exercising our little +% dummy output routine +% \begin{macrocode} + {% + \output{\@dummy@balance@output}% + \eject + }% +% \end{macrocode} +% +% Establish the total height of the boxes we've thereby acquired +% \begin{macrocode} + {% + \@tempdima .5\ht\@tempboxa + \advance\@tempdima .5\dp\@tempboxa + \splittopskip\topskip + \splitmaxdepth\maxdepth +% \PackageInfo{baltools}{% +% \ClassInfo\NRC@clsname{% + \string\BalanceColumns: total height of page is + \the\@tempdima\space--\MessageBreak + \string\vsplit\space to half of that + (plus #1\string\baselineskip)}% + \advance\@tempdima #1\baselineskip + \vbadness\@M + \setbox\@tempboxb \vsplit\@tempboxa to\@tempdima +% \end{macrocode} +% +% Log what we've done\dots +% \begin{macrocode} +% \PackageInfo{baltools}{% +% \ClassInfo\NRC@clsname{% + Column balance: left column height + \the\ht\@tempboxb+\the\dp\@tempboxb + \MessageBreak + right column height \the\ht\@tempboxa+\the\dp\@tempboxa}% +% \end{macrocode} +% +% Reassemble the two columns we now have into the `top of the page' +% \begin{macrocode} + \@tempdima \ht\@tempboxa + \advance\@tempdima \dp\@tempboxa + \dimen@ \ht\@tempboxb + \advance\dimen@ \dp\@tempboxb + \ifdim \dimen@ < \@tempdima + \dimen@ \@tempdima + \fi + \global\setbox\@tempboxa \vbox {% + \ifx\@dbltoplist\@empty + \else + \@tempswatrue + \NRC@return@floats\@dbltoplist\@dbltoproom\@dbltopnum{dbl}% + \vspace\dbltextfloatsep + \fi + \hb@xt@\textwidth {% + \hb@xt@\columnwidth {% + \vbox to\dimen@{% + \unvbox\@tempboxb + \vfill + }% + \hss + }% + \hfill + \vrule \@width\columnseprule + \hfill + \hb@xt@\columnwidth {% + \vbox to\dimen@{% + \unvbox\@tempboxa + \vfill + }% + \hss + }% + }% + }% +% \end{macrocode} +% +% Preserve the value of the \cs{columnwidth} for use in the +% \cs{*ColumnBar} commands +% \begin{macrocode} + \xdef\NRC@narrow@width{\the\columnwidth} +% \end{macrocode} +% +% We now have the two columns, nestling happily together, in (global) +% \cs{@tempboxa}, so we simulate a \cs{onecolumn} command, so that we +% can proceed as if we've now given up on this two column game\dots +% \begin{macrocode} + \global\columnwidth\textwidth + \global\hsize\columnwidth + \global\linewidth\columnwidth + \global\@twocolumnfalse + \col@number \@ne +% \end{macrocode} +% +% Finally, dump the contents of the \@tempboxa we prepared earlier +% into this new one-columned environment +% \begin{macrocode} + \unvbox\@tempboxa + }% +} +% \end{macrocode} +% +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@return@floats} +% Syntax: \cs{NRC@return@floats}\marg{flt list}\marg{flt room}^^A +% \marg{flt cnt}\marg{dbl ind} +% +% `Return' a list of floats that existed for the present page, and +% recover the space they would have occupied in the present column; +% note that since this operation redefines the float list \cs{@elt} +% macro, it operates inside a group, and all its external actions need +% to be done \cs{global}. \cs{if@tempswa}, the body(ies) of the +% float(s) is(are) inserted; otherwise they're simply lost. It is the +% responsibility of the calling routine to add \cs{textfloatsep} (or +% whatever), where necessary, to ensure the floats are properly +% positioned with respect to the rest of the matter in the column. +% +% The \meta{dble ind} parameter is either \verb'dbl' (if we're +% returning a double-top list) or empty (it's used to determine which +% separation to use in calculations (and in the case of returning +% multiple floats, even when making inter-float skips) +% \begin{macrocode} +\newcommand{\NRC@return@floats}[4]{{% +% \end{macrocode} +% +% \cs{@elt} macro for returning the first float in the list. Note +% that it doesn't insert any separation of its own\dots +% \begin{macrocode} + \def\@elt##1{% + \global\advance#3\@ne + \global\advance\@colnum\@ne + \@tempdima\ht##1% + \advance\@tempdima\dp##1% + \advance\@tempdima\csname#4textfloatsep\endcsname + \csname NRC@advance@#4colspace\endcsname{#2}% + \if@tempswa\vbox{\unvbox##1}\fi +% \end{macrocode} +% +% now the \cs{@elt} macro for returning subsequent floats in the +% list. Since we know that at least one float has already been added, +% we insert \cs{\#4floatsep} before inserting the float's actual body. +% \begin{macrocode} + \def\@elt####1{% + \global\advance#3\@ne + \global\advance\@colnum\@ne + \@tempdima\ht####1% + \advance\@tempdima\dp####1% + \advance\@tempdima\csname#4floatsep\endcsname + \csname NRC@advance@#4colspace\endcsname{#2}% + \if@tempswa + \vskip\csname#4floatsep\endcsname% + \vbox{\unvbox####1}% + \fi + }% + }% +% \end{macrocode} +% +% Now we simply execute the list, and it will self-insert. +% \begin{macrocode} + #1% + }% +% \end{macrocode} +% +% Having closed the group in which \cs{@elt} was defined, we can +% safely do the following to return the list to the free list, since +% \cs{@elt} \emph{should} always be \cs{let} to \cs{relax} +% \begin{macrocode} + \let\@elt\relax + \xdef\@freelist{\@freelist#1}% + \xdef#1{}% + \global\vsize\@colroom +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\NRC@advance@colspace} +% \begin{macro}{\NRC@advance@dblcolspace} +% +% Add \cs{@tempdima} to the space available in the column(s). The +% version for double-column floats also restores space to \cs{@colht}. +% \begin{macrocode} +\newcommand{\NRC@advance@colspace}[1]{% + \global\advance\@colroom\@tempdima + \global\advance#1\@tempdima +} +\newcommand{\NRC@advance@dblcolspace}[1]{% + \global\advance\@colroom\@tempdima + \global\advance#1\@tempdima + \global\advance\@colht\@tempdima +% \end{macrocode} +% +% \cs{@topnum} gets advanced in the \cs{@elt} macros and shouldn't be +% in this case +% \begin{macrocode} + \global\advance\@topnum\m@ne +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Now code for restarting double columns\dots +% +% \begin{macro}{\RestartDouble} +% +% \begin{macrocode} +\newcommand{\RestartDouble}{% + \penalty\z@ + {% + \output{\NRC@gather@top} + \vfill + \eject + }% + \twocolumn[\unvbox\@tempboxb]% + \NRC@restorefootskip +} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{FullWidth} +% Syntax: \cs{begin}\verb'{FullWidth}'\oarg{epsilon} +% +% This environment encapsulates \cs{BalanceColumns} and +% \cs{RestartDouble} in a single user-friendly, hyper-buzz-word, +% package. +% +% The optional \emph{epsilon} argument is the same as that to +% \cs{BalanceColumns} and should not ordinarily be required. +% \begin{macrocode} +\newenvironment{FullWidth}[1][0.5]% + {\BalanceColumns[#1]}% + {\RestartDouble} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\NRC@gather@top} +% +% Another dummy output routine, whose sole task is to salt away the +% contents of a (nominally) single-column output-page-so-far +% \begin{macrocode} +\newcommand{\NRC@gather@top}{% + \global\setbox\@tempboxb\vbox{\unvbox\@cclv}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\LeftColumnBar} +% \begin{macro}{\RightColumnBar} +% +% \cs{LeftColumnBar} and \cs{RightColumnBar} place bars across +% columns, as are required to separate the two-column portion of the +% text from interposed full-width material. They are to be used +% \emph{within} the full-width material, in vertical mode +% \begin{macrocode} +\newcommand{\LeftColumnBar}{% + \addvspace{0.75\baselineskip}% + \hbox{\rule{\NRC@narrow@width}{\p@}}% + \addvspace{0.75\baselineskip}% +} +\newcommand{\RightColumnBar}{% + \par + \addvspace{0.75\baselineskip}% + \hb@xt@\textwidth{\hfill\rule{\NRC@narrow@width}{\p@}}% + \addvspace{0.75\baselineskip}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{environment}{WideText} +% \begin{macro}{\NRC@widetext@i} +% \begin{macro}{\NRC@widetext@ii} +% +% Syntax: \verb'\begin{WideText}'\oarg{left indent}\oarg{right indent} +% +% The \verb'WideText' environment allows variation of the text margins +% for a short period. It will typically be used to narrow the right +% margin of full-width text in the two-column style, hence the default +% values for the argument of \emph{left}:~\verb'0pc', +% \emph{right}:~\verb'3pc'. +% +% \begin{macrocode} +\newenvironment{WideText}{% + \@testopt{\NRC@widetext@i}{\z@}% +}{% + \endlist +} +\def\NRC@widetext@i[#1]{% + \@testopt{\NRC@widetext@ii{#1}}{3pc}% +} +\def\NRC@widetext@ii#1[#2]{% + \list{}{% + \topsep\z@ + \leftmargin#1\relax + \rightmargin#2\relax + \listparindent\parindent + \parsep\parskip + }% + \item[]% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} +% +% \noindent At the going down of the sun, and in the morning, we will +% remember them. +% +% \noindent 11:02 {\small GMT\@}, 8\textsuperscript{th} November +% 1998 (Remembrance Sunday). +% \begin{macrocode} +% +%<*nrc1cls|nrc2cls> +% \end{macrocode} +% +% +% \subsection{Other miscellaneous layout} +% +% \begin{macro}{\frenchspacing} +% We use \cs{frenchspacing} throughout. Fortunately, \textsf{babel} +% respects our wishes, and doesn't reset \cs{nonfrenchspacing} every +% time we select English from within French. (\textsf{babel} accords +% English a haughty position whereby every other language is required +% to restore the original English state, so that the selection of +% English doesn't give us a problem here.) +% \begin{macrocode} +\frenchspacing +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parindent} +% Paragraph indentation is smaller than normal in the the two-column +% classes: +% \begin{macrocode} +%<*nrc2> +\parindent 10pt +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parskip} +% And the inter-paragraph skip contributes to the stretchability of +% vertical lists: +% \begin{macrocode} +\parskip 0pt plus 2pt +% +% \end{macrocode} +% \end{macro} +% +% +% \section{Support macros} +% +% Pseudo-counters are implemented in \cs{NRC@c@*} macros. The +% following bits of code manipulate these macros. We refer to these +% things via the name part (the |*|, as it were). +% +% \begin{macro}{\NRC@definecounter} +% Syntax: \cs{NRC@definecounter}\marg{macro-name} +% +% \cs{NRC@definecounter} creates and zeroes a counter macro |#1|: +% \begin{macrocode} +\newcommand\NRC@definecounter[1]{% + \global\expandafter\newcommand\csname NRC@c@#1\endcsname{0}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@addtocounter} +% Syntax: \cs{NRC@addtocounter}\marg{macro-name}\marg{increment} +% +% \cs{NRC@addtocounter} adds |#2| to counter macro |#1|: +% \begin{macrocode} +\newcommand\NRC@addtocounter[2]{\bgroup + \expandafter\@tempcnta\csname NRC@c@#1\endcsname\relax + \advance\@tempcnta#2\relax + \expandafter\xdef\csname NRC@c@#1\endcsname{\the\@tempcnta}% + \egroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@stepcounter} +% Syntax: \cs{NRC@stepcounter}\marg{counter-name} +% +% Advance a counter by 1 +% \begin{macrocode} +\newcommand\NRC@stepcounter[1]{\NRC@addtocounter{#1}1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@NRCcounter} +% Syntax: +% \cs{if@NRCcounter}\marg{counter-name}\meta{condition}\meta{integer-value} +% +% \cs{if@NRCcounter} establishes an \cs{ifnum} test on the contents of +% a counter +% \begin{macrocode} +\newcommand\if@NRCcounter[1]{\expandafter\ifnum\csname + NRC@c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@valcounter} +% Syntax: \cs{NRC@valcounter}\marg{counter-name} +% +% \cs{NRC@valcounter} simply inserts the value of a counter into the +% token stream +% \begin{macrocode} +\newcommand\NRC@valcounter[1]{\csname NRC@c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@condgobble} +% Syntax: \cs{NRC@condgobble}\marg{ignore}, or just +% \cs{NRC@condgobble} +% +% \cs{NRC@condgobble} looks to see if it's got an `argument' and if +% so, gobbles it +% \begin{macrocode} +\def\NRC@condgobble{\futurelet\reserved@a\NRC@relayto@gobble} +\def\NRC@relayto@gobble{\ifx\reserved@a\bgroup\expandafter\@gobble\fi} +% \end{macrocode} +% \end{macro} +% +% A few odds and ends for the parallel-text setting\dots +% +% \begin{macro}{\NRC@insertignore} +% \begin{macro}{\@@ignorespaces} +% Syntax: \cs{NRC@insertignore}\marg{execute next} +% +% Insert \cs{NRC@ignorespacesandpars}\marg{execute next} after the +% current environment by mucking about with \cs{if@ignore} and +% \cs{ignorespaces} +% \begin{macrocode} +\newcommand\NRC@insertignore[1]{% + \@ignoretrue + \gdef\ignorespaces{% + \global\let\ignorespaces\@@ignorespaces + \def\@tempa{\NRC@ignorespacesandpars{#1}}% + \expandafter\@tempa + }% +} +\let\@@ignorespaces\ignorespaces +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@ignorespacesandpars} +% Syntax: \cs{NRC@ignorespacesandpars}\marg{execute next} +% +% Ignore any blank space following the present environment, then +% ignore any \cs{par} tokens, then execute our argument +% \begin{macrocode} +\newcommand\NRC@ignorespacesandpars[1]{% + \def\@tempb\par{\@tempa}% + \def\@tempa{\@long@ifnextchar\par\@tempb{#1}}% + \@tempa +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@long@ifnextchar} +% Syntax: \cs{@long@ifnextchar}\marg{token}\marg{match}\marg{no match} +% +% As \cs{@ifnextchar} (from which the code is derived), but +% \marg{token} is allowed to be \cs{par}\dots +% \begin{macrocode} +\long\def\@long@ifnextchar#1#2#3{% + \let\reserved@d=#1% + \def\reserved@a{#2}\def\reserved@b{#3}% + \futurelet\@let@token\@ifnch} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@stripdef} +% \begin{macro}{\NRC@stripdef@} +% Syntax: \cs{NRC@stripdef}\cs{\emph{defining}}\cs{\emph{defined}} +% +% Strip the defnition of \cs{\emph{defined}} from the definition of +% \cs{captions\meta{defining}}, if it proves that +% \cs{captions\meta{defining}} actually exists +% \begin{macrocode} +\newcommand\NRC@stripdef[2]{% + \@ifundefined{captions#1}{}{% + \def\NRC@stripdef@##1\def#2##2##3\NRC@stripdef@{% + \@namedef{captions#1}{##1##3}% + }% + \edef\@tempa{\noexpand\expandafter + \noexpand\NRC@stripdef@ + \expandafter\noexpand\csname captions#1\endcsname + \noexpand\NRC@stripdef@ + }% + \@tempa + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \section{Titles and origins} +% +% \subsection{Title material} +% +% The number of authors is a counter macro; it is used as an index in +% the author number definitions, too: +% \begin{macrocode} +\NRC@definecounter{author} +% \end{macrocode} +% +% \begin{macro}{\author} +% \begin{macro}{\@NRC@dblauthor} +% Syntax: \cs{author}\oarg{author initials}\marg{author name} +% +% A new author is defined by the \cs{author} macro. The mandatory +% argument is the author's `full' name; the optional argument gives +% the author's name in abbreviated form, which will be used in the +% IDbox on the title page in place of the full name.\footnote{In +% principal, this short name could be used to derive an author +% `list' for the running head (saving the editor the use of the +% \cs{shortauthor} command if there are sufficiently few authors) +% but this facility has not yet been implemented.} +% \begin{macrocode} +\renewcommand\author{\@dblarg\@NRC@dblauthor} +\newcommand\@NRC@dblauthor[2][]{% + \if@NRCcounter{author}>0 + \expandafter\ifx\csname NRC@addr\NRC@c@author\endcsname\relax +% \end{macrocode} +% +% If no address was given for the previous author, things are going to +% fall apart unless we allocate a (spurious) one. +% \begin{macrocode} + \NRC@warning{No address given for author \NRC@c@author}% + \address{(\emph{\texttt{address missing}})}% + \fi + \fi + \let\NRC@tempb\NRC@c@author% + \NRC@stepcounter{author}% + \NRC@definecounter{AN\NRC@c@author} + \@namedef{NRC@author\NRC@c@author}{#2}% + \@namedef{NRC@initialsonly\NRC@c@author}{#1}% + \ifnum\NRC@tempb=0 +% \end{macrocode} +% +% We explicitly \cs{let} the first address to \cs{relax}, in case that +% we're on the second or subsequent paper of an issue of the journal: +% otherwise, we're in danger of picking up an address from the +% previous paper in the error case where the address has been omitted. +% \begin{macrocode} + \expandafter\let\csname NRC@addr\NRC@c@author\endcsname\relax + \else +% \end{macrocode} +% +% Otherwise, we start by assuming that the address is the same as that +% of the previous author. An explicit address command is needed +% somewhere or other, though. (Of course\dots) +% \begin{macrocode} + \expandafter\edef\csname NRC@addr\NRC@c@author\endcsname + {\csname NRC@addr\NRC@tempb\endcsname} + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\shortauthor} +% \begin{macro}{\@shortauthor} +% Syntax: \cs{shortauthor}\marg{author-spec} +% +% Defines the reference to be made to the authors in the running +% heads, in the case where it's not derivable from the author +% specifications.\footnote{There's currently no provision for deriving +% `\cs{shortauthor}' from the names given (in either argument) to +% \cs{author} commands.} +% \begin{macrocode} +\newcommand\shortauthor[1]{\newcommand\@shortauthor{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% An author's address is defined by the \cs{address} macro. The +% mandatory argument is the address defined; the optional argument (if +% present) allows the address to be tagged for future reference from +% other authors. +% +% For each author \meta{n} there's an \cs{NRC@addr\meta{n}} which +% expands to the address label. If an address is defined by +% \cs{address}\marg{address}, the label is simply `the current author +% number'; otherwise, it's \cs{address}'s optional argument. If an +% author isn't given an explicit address, she is assumed to be at the +% same place as the previous author (which all falls apart if there's +% been no author defined yet). +% +% For each address \meta{label}, there's an +% \cs{NRC@addr@\meta{label}} that expands to the actual address. +% \begin{macrocode} +\newcommand\address{\@ifnextchar[%] + \NRC@address@l \NRC@address@nl +} +% \end{macrocode} +% +% If there's no optional argument, the command simply defines the +% current author's address to be that in the argument: +% \begin{macrocode} +\newcommand\NRC@address@nl[1]{% +% \end{macrocode} +% +% First, define the address for label `author number' +% \begin{macrocode} + \@namedef{NRC@addr@\NRC@c@author}{#1}% +% \end{macrocode} +% +% And then allocate `this author's number' as this author's label +% \begin{macrocode} + \expandafter\edef\csname NRC@addr\NRC@c@author\endcsname + {\NRC@c@author}% +% \end{macrocode} +% +% Finally, register the empty tree of +% author\ensuremath{\rightarrow}address mappings: +% \begin{macrocode} + \NRC@allocaddr\NRC@c@author% +} +% \end{macrocode} +% +% The optional argument could represent two forms, according to +% whether the `mandatory' (-seeming) argument is present. Preserve +% the optional (label) argument and split on whether we're actually +% defining an address, or merely referring to one. Whatever, we +% define the current author's address label. +% \begin{macrocode} +\def\NRC@address@l[#1]{% + \@namedef{NRC@addr\NRC@c@author}{#1}% + \def\NRC@tempa{#1}% + \futurelet\reserved@a\NRC@address@lsw +} +% \end{macrocode} +% +% If we now enter with \cs{reserved@a} the same as \cs{bgroup}, we've +% got an address definition, and a label definition to go with it. +% Otherwise, we merely have a label reference +% \begin{macrocode} +\def\NRC@address@lsw{% + \ifx\reserved@a\bgroup + \expandafter\NRC@address@ldef + \fi +} +% \end{macrocode} +% +% +% Address with label definition: set up the address itself, and +% allocate an entry in the tree of addresses +% \begin{macrocode} +\def\NRC@address@ldef#1{% + \@namedef{NRC@addr@\NRC@tempa}{#1}% + \NRC@allocaddr\NRC@tempa% +} +% \end{macrocode} +% +% \begin{macro}{\NRC@addresses} +% \begin{macro}{\NRC@allocaddr} +% Syntax: \cs{NRC@allocaddr}\marg{addr-label} +% +% Allocate a root of a tree and register it in the list \cs{NRC@addresses} +% \begin{macrocode} +\gdef\NRC@addresses{} +\newcommand\NRC@allocaddr[1]{% + \expandafter\gdef\csname NRC@addrlist#1\endcsname{}% + \NRC@definecounter{addr@#1}% + \NRC@addtolist\NRC@addresses{#1}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@addtolist} +% Syntax: \cs{NRC@addtolist}\marg{list-cs-name}\marg{list-element} +% +% Adds an element |#2| to list |#1| +% \begin{macrocode} +\newcommand\NRC@addtolist[2]{\bgroup + \let\do\relax + \xdef#1{#1\do{#2}}% + \egroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@addauthortoaddress} +% Syntax: \cs{NRC@addauthortoaddress}\marg{author-count} +% +% Adds the author specified by the \emph{count} to the relevant +% address list, and counts the author in the counter +% \texttt{@addr@\meta{addr-label}} +% \begin{macrocode} +\newcommand\NRC@addauthortoaddress[1]{% + \expandafter\edef\expandafter\@tempa\expandafter{% + \csname NRC@addr#1\endcsname}% + \expandafter\NRC@addtolist + \csname NRC@addrlist\@tempa\endcsname{#1}% + \NRC@stepcounter{addr@\@tempa}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\correspond} +% \begin{macro}{\@correspond} +% \begin{macro}{\@correspond@a} +% Syntax: \cs{correspond}\marg{correspondence-details} (argument, +% despite looking as if it's mandatory, is in fact optional) +% +% Designate one author as the target for correspondence: +% \begin{macrocode} +\newcommand\correspond{% + \futurelet\reserved@a\@correspond +} +% \end{macrocode} +% +% Now, if there actually is an argument, \cs{reserved@a} will contain an +% opening brace +% \begin{macrocode} +\newcommand\@correspond{% + \ifx\reserved@a\bgroup + \expandafter\@correspond@a + \else + \AddressNote{\NRC@text@correspondAll}% + \fi +} +% \end{macrocode} +% +% Deal with a \cs{correspond} command with arguments +% \begin{macrocode} +\newcommand\@correspond@a[1]{% + \def\@tempa{#1}% + \protected@xdef\@tempa{\noexpand\AddressNote{\NRC@text@correspond}} + \@tempa +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\present} +% Syntax: \cs{present}\marg{address} +% +% Record that this author has an alternative address. +% \begin{macrocode} +\newcommand\present[1]{% + \AddressNote{\NRC@text@present\ #1}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\AddressNote} +% \begin{macro}{\IDnote} +% Syntax: \cs{AddressNote}\marg{note} +% +% Define an anonymous address note (\cs{IDnote} is a synonym). +% \begin{macrocode} +\newcommand\AddressNote[1]{% + \NRC@stepcounter{AN\NRC@c@author} + \bgroup + \@NRC@AddressCommands + \expandafter\protected@xdef + \csname NRC@AN\NRC@c@author.% + \@nameuse{NRC@c@AN\NRC@c@author}\endcsname{% + \noexpand\NRC@addrfnote{#1}% + }% + \egroup +} +\let\IDnote\AddressNote +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@NRC@AddressCommands} +% \begin{macro}{\phone} +% \begin{macro}{\fax} +% \begin{macro}{\telefax} +% \begin{macro}{\email} +% +% Define the auxiliary address commands for use in the arguments of +% \cs{AddressNote} and \cs{address} commands. The commands are +% themselves declared as null robust commands, and their expansions +% are only declared within the groups where the commands are going to +% be used +% \begin{macrocode} +\def\@NRC@AddressCommands{% + \expandafter\def\csname phone \endcsname##1{% + \NRC@text@telephone\protect~##1}% + \expandafter\def\csname fax \endcsname##1{|% + \NRC@text@fax\protect~##1}% + \expandafter\def\csname telefax \endcsname##1{% + \NRC@text@telefax\protect~##1}% + \expandafter\def\csname email \endcsname##1{% + \mbox{\NRC@text@email}\protect~##1}% +} +\DeclareRobustCommand\phone[1]{} +\DeclareRobustCommand\fax[1]{} +\DeclareRobustCommand\telefax[1]{} +\DeclareRobustCommand\email[1]{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\received} +% \begin{macro}{\NRC@received} +% \begin{macro}{\NRC@received@sep} +% \begin{macro}{\accepted} +% \begin{macro}{\revreceived} +% \begin{macro}{\revaccepted} +% Syntax: \cs{received}\marg{received date}~\dots~\cs{accepted}\marg{accepted +% date} \dots\ \cs{revreceived}\marg{date revision received} +% \dots\ \cs{revaccepted}\marg{date revision accepted} +% +% Preserve the `received' and `accepted' dates (two sorts of each). +% +% The \cs{received} |[...| \cs{accepted}|]| |[...| \cs{revreceived}|]| +% |[...| \cs{revaccepted}|]| form is now preferred. +% \begin{macrocode} +\newcommand\NRC@received@sep{} +\def\NRC@received{} +\newcommand\received[1]{% + \protected@xdef\NRC@received{\NRC@received\NRC@received@sep + \protect\NRC@text@received\ #1.% + }% + \let\NRC@received@sep\space +} +\newcommand\accepted[1]{% + \protected@xdef\NRC@received{\NRC@received\NRC@received@sep + \protect\NRC@text@accepted\ #1.% + }% + \let\NRC@received@sep\space +} +\newcommand\revreceived[1]{% + \protected@xdef\NRC@received{\NRC@received\NRC@received@sep + \protect\NRC@text@revreceived\ #1.% + }% + \let\NRC@received@sep\space +} +\newcommand\revaccepted[1]{% + \protected@xdef\NRC@received{\NRC@received\NRC@received@sep + \protect\NRC@text@revaccepted\ #1.% + }% + \let\NRC@received@sep\space +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\IDdates} +% \begin{macro}{\IDdate} +% Syntax: \cs{IDdates}\marg{Date text} +% +% Provides the means of entering a more freely-specified date entry. +% If present, it's tagged on the end of the \cs{accepted} stuff, with +% a separating space if appropriate. Repeated \cs{IDdates} commands +% are acceptable, and their arguments are tagged on, one after +% another, with a separating space. (\cs{IDdate} is an alias for +% \cs{IDdates}.) +% \begin{macrocode} +\newcommand{\IDdates}[1]{% + \protected@xdef\NRC@received{\NRC@received\NRC@received@sep#1}% + \let\NRC@received@sep\space +} +\let\IDdate\IDdates +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\dedication} +% \begin{macro}{\NRC@dedication} +% \begin{macro}{\ifNRC@dedication} +% Syntax: \cs{dedication}\marg{pious words} +% +% Preserve a dedicatory text to be printed in the ident box at the +% bottom of the title page +% \begin{macrocode} +\newif\ifNRC@dedication \NRC@dedicationfalse +\newcommand\dedication[1]{\gdef\NRC@dedication{#1}% + \NRC@dedicationtrue +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\assoced} +% \begin{macro}{\NRC@assoced} +% \begin{macro}{\ifNRC@assoced} +% Syntax: \cs{assoced}\marg{details of associate editor} +% +% Preserve details of the associate editor, to be printed in the ident +% box at the bottom of the title page +% \begin{macrocode} +\newif\ifNRC@assoced \NRC@assocedfalse +\newcommand\assoced[1]{\gdef\NRC@assoced{\NRC@text@assoced{} #1.}% + \NRC@assocedtrue +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\corred} +% \begin{macro}{\NRC@corred} +% \begin{macro}{\ifNRC@corred} +% Syntax: \cs{corred}\marg{details of corresponding editor} +% +% Preserve details of the corresponding editor, to be printed in the ident +% box at the bottom of the title page +% \begin{macrocode} +\newif\ifNRC@corred \NRC@corredfalse +\newcommand\corred[1]{\gdef\NRC@corred{\NRC@text@corred{} #1.}% + \NRC@corredtrue +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\commdate} +% \begin{macro}{\NRC@commdate} +% \begin{macro}{\if@NRCcommdate} +% Syntax: \cs{commdate}\marg{comment date} +% +% Preserve the date by which comments should be received, to be +% printed in the ident box at the bottom of the title page +% \begin{macrocode} +\newif\ifNRC@commdate \NRC@commdatefalse +\newcommand\commdate[1]{\gdef\NRC@commdate{\NRC@text@commdate{} #1.}% + \NRC@commdatetrue +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\webpub} +% \begin{macro}{\NRCurl} +% \begin{macro}{\NRC@a@webpub} +% \begin{macro}{\NRC@webpub} +% \begin{macro}{\ifNRC@webpub} +% \begin{macro}{\NRC@def@webaddress} +% \begin{macro}{\NRC@url} +% \begin{macro}{\NRC@url@command} +% Syntax: \cs{webpub}\marg{web address}\marg{date of web publication}\par +% \noindent\phantom{Syntax: }\cs{NRCurl}\marg{url command name} +% +% \cs{webpub} preserves the location and date of publication on the WWW, to be +% printed in the ident box at the bottom of the title page. The +% \emph{first} `mandatory' argument may in fact be omitted: the +% presence of two such arguments is determined by there being a ``{'' % } +% immediately after the first argument. +% \begin{macrocode} +\newif\ifNRC@webpub \NRC@webpubfalse +\newcommand\webpub[1]{\@ifnextchar\bgroup + {\def\@tempa{#1}\NRC@a@webpub}% + {% + \def\@tempa{\protect\NRC@url{\protect\NRC@def@webaddress}}% + \NRC@a@webpub{#1}% + }% +} +\newcommand\NRC@a@webpub[1]{% + \def\@tempb{#1}% + \protected@xdef\NRC@webpub{\NRC@text@webpub.}% + \NRC@webpubtrue +} +\newcommand*{\NRC@def@webaddress}{\emph{unknown}} +% \end{macrocode} +% +% \cs{NRCurl} sets up typesetting of URLs in \cs{webpub}; there's a +% complicated sequence of protections and non-expansions and things +% whose real purpose is to ensure that \cs{NRC@def@webaddress} doesn't +% get expanded until the web address is actually put into the IDbox. +% \begin{macrocode} +\DeclareRobustCommand\NRCurl[1]{\expandafter\let\expandafter + \NRC@url@command\csname#1\endcsname} +\NRCurl{@firstofone} +\newcommand\NRC@url[1]{{% + \let\protect\@empty + \edef\@tempa{\noexpand\NRC@url@command{#1}}% + \@tempa +}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\abbreviations} +% \begin{macro}{\@abbreviations} +% \begin{macro}{\if@abbreviations} +% Syntax: \cs{abbreviations}\marg{set of abbrev.\ specs} +% +% Preserve a set of abbreviations to be printed in the ident box, +% between the dedication and list of authors. +% \begin{macrocode} +\newif\if@abbreviations \@abbreviationsfalse +\newcommand\abbreviations[1]{\gdef\@abbreviations{#1}% + \@abbreviationstrue +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Support code for \cs{maketitle}} +% +% Make a list of all the authors +% \begin{macrocode} +\newcommand\NRC@defaultauthorlist{\bgroup + \let\correspond\NRC@condgobble + \expandafter\@tempcnta\NRC@c@author\relax + \advance\@tempcnta -2 + \@tempcntb 0 + \loop + \ifnum\@tempcnta>0 + \advance\@tempcntb 1 + \NRC@addauthortoaddress{\the\@tempcntb}% + \ignorespaces\csname NRC@author\number\@tempcntb\endcsname\unskip, + \advance\@tempcnta -1 + \repeat + \expandafter\@tempcnta\NRC@c@author\relax + \advance\@tempcnta -\@tempcntb + \expandafter\ifnum\NRC@c@author>0 + \ifnum\@tempcnta>1 + \expandafter\@tempcnta\NRC@c@author\relax + \advance\@tempcnta -1 + \NRC@addauthortoaddress{\the\@tempcnta}% + \ignorespaces\csname NRC@author\number\@tempcnta\endcsname\unskip + \expandafter\ifnum\NRC@c@author>2 + \ifNRC@french\else,\fi + \fi\ \NRC@text@and\ + \fi + \NRC@addauthortoaddress\NRC@c@author + \ignorespaces\csname NRC@author\NRC@c@author\endcsname\unskip + \fi +\egroup +} +% \end{macrocode} +% +% \begin{macro}{\NRC@default@authaddlist} +% Output the list of authors sorted by address, as in the ident box on +% the title page +% \begin{macrocode} +\newcommand\NRC@default@authaddlist{\bgroup + \let\do\NRC@output@authorline + \NRC@addresses + \egroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@output@authorline} +% Syntax: \cs{NRC@output@authorline}\marg{addr-label} +% +% Outputs all the authors associated with that address, then a full +% stop (having put the correspondence mark in place if required), then +% the address +% \begin{macrocode} +\newcommand\NRC@output@authorline[1]{\bgroup + \@tempswafalse + \expandafter\@tempcnta\NRC@valcounter{addr@#1}\relax +% \end{macrocode} +% +% Decide how to do separators between author names on the basis of how +% many there are: case 0 can't happen, and in case 1 the separator +% never gets used +% \begin{macrocode} + \ifcase\@tempcnta + \or +% \end{macrocode} +% +% in case 2, there's only one separator `` and '' +% \begin{macrocode} + \or \def\NRC@authorseparator{\NRC@optfnmark{} \NRC@text@and\ }% +% \end{macrocode} +% +% in case of 3 or more authors at the same address, we need an +% intelligent separator +% \begin{macrocode} + \else + \def\NRC@authorseparator{% + \ifnum\@tempcnta>0\relax + \ifNRC@french + \NRC@optfnmark, + \else + ,\NRC@optfnmark{} + \fi + \advance\@tempcnta-1\relax + \else + \ifNRC@french + \NRC@optfnmark\ \NRC@text@and{} + \else + ,\NRC@optfnmark{} \NRC@text@and{} + \fi + \fi + }% + \advance\@tempcnta-2\relax + \fi + \let\do\NRC@output@oneauthor + \noindent{\usefont\f@encoding\rmdefault {bx}n% + \csname NRC@addrlist#1\endcsname + \ifNRC@french + \NRC@optfnmark.% + \else + .\NRC@optfnmark + \fi} + \if@breakaddress\par\noindent\fi + \csname NRC@addr@#1\endcsname\par + \egroup +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@output@oneauthor} +% Syntax: \cs{NRC@output@oneauthor}\marg{author-number} +% +% Outputs one author: for use during processing lists of authors at +% one address. Switch |@tempswa| set true by first author, and +% subsequent ones get separated by a comma. +% \begin{macrocode} +\newcommand\NRC@output@oneauthor[1]{% + \if@tempswa\NRC@authorseparator\else\@tempswatrue\fi + \csname NRC@initialsonly#1\endcsname + \def\NRC@optfnmark{\NRC@processAN{#1}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@addrfnote} +% \begin{macro}{\NRC@addrfnbody} +% Syntax: \cs{NRC@addrfnote}\marg{address footnote matter} +% +% This code (rather closely modelled on \cs{thanks}) saves up any +% `footnotes' (i.e., corresponding or present addresses) that may +% occur during typesetting of the ident box +% \begin{macrocode} +\newcommand\NRC@addrfnote[1]{% + \NRC@addrfnmark + \protected@xdef\NRC@addrfnbody{\NRC@addrfnbody + \protect\NRC@addrfntext[\the\c@footnote]{#1}\protect\par}% +} +\def\NRC@addrfnbody{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@addrfnmark} +% For use by \cs{NRC@addrfnote}; differs from standard +% \cs{footnotemark} only in that it uses current body font for the +% superscripted character. +% \begin{macrocode} +\newcommand{\NRC@addrfnmark}{% + {% + \stepcounter{footnote}% + \protected@xdef\@thefnmark{\thefootnote}% + }% + \leavevmode + \edef\@x@sf{\the\spacefactor}% + \nobreak + \hbox{\textsuperscript{\@thefnmark}}% + \spacefactor\@x@sf\relax +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thanks} +% Syntax: \cs{thanks}\marg{comment} +% +% This redefinition of the standard \LaTeX{} command puts the notes +% into the IDbox. +% \begin{macrocode} +\let\thanks\NRC@addrfnote +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@addrfntext} +% Syntax: \cs{NRC@addrfntext}\oarg{mark}\marg{body} +% +% Does the slightly gutted footnotes we have in the ident block +% \begin{macrocode} +\def\NRC@addrfntext[#1]#2{% + \begingroup + \csname c@\@mpfn\endcsname #1\relax + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup + \@makefntext{% + \rule\z@\footnotesep + \NRC@sectragged\ignorespaces + #2% + \@finalstrut\strutbox}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@processAN} +% Syntax: \cs{NRC@processAN}\marg{author number} +% +% Generate the \cs{AddressNote}s for this author; takes account of +% multiple notes for one author (placing a comma between the note +% numbers superscripted after the author's name) +% \begin{macrocode} +\newcommand\NRC@processAN[1]{% + \@tempcntb 0\relax + \loop + \if@NRCcounter{AN#1}>\@tempcntb + \advance\@tempcntb 1\relax + \csname NRC@AN#1.\the\@tempcntb\endcsname +% \end{macrocode} +% +% Note, we can't use \cs{if@NRCcounter} here, because we need to have +% something that the parser will cope with as being a conditional +% command +% \begin{macrocode} + \expandafter\ifnum\csname NRC@c@AN#1\endcsname>\@tempcntb + \textsuperscript{,}% + \fi + \repeat +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\specialtitle} +% \begin{macro}{\@specialtitle} +% \begin{macro}{\if@specialtitle} +% \begin{macro}{\if@specialonly} +% Syntax: \cs{specialtitle}\marg{title}, or +% \cs{specialtitle*}\marg{title} +% +% Declares a boxed reversed-colour box at the top of the page. The +% \marg{title} appears in the box. If the \texttt{*}-form of the +% command is used, no `regular' title block is expected, and the +% reversed box is the only title for this item; otherwise, a normal +% title box exists, with the special title block included within it. +% \begin{macrocode} +\newcommand\specialtitle{\@ifstar + {\@specialonlytrue\@specialtitle}% + {\@specialonlyfalse\@specialtitle}} +\newcommand\@specialtitle[1]{\gdef\@special@title{#1}\@specialtitletrue} +\newif\if@specialtitle \@specialtitlefalse +\newif\if@specialonly +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \subsection{Setting the title} +% +% \begin{macro}{\NRC@titleoffset} +% \cs{NRC@titleoffset} holds the offset of titles from the left margin +% (note, this is larger than the distance between the heavy left bar +% and the title, and is also the left margin used for the abstract/ +% r\'esum\'e) +% \begin{macrocode} +\def\NRC@titleoffset{5pc\relax} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifNRC@IDbox} +% \begin{macro}{\NRC@theIDbox} +% \cs{ifNRC@IDbox} is globally set to determine whether an IDbox is +% needed (initially false: may be set true inside \cs{NRC@maketitle}). +% If we're doing a two-column IDbox, it gets set into \cs{NRC@theIDbox} +% \begin{macrocode} +\newif\ifNRC@IDbox +\global\NRC@IDboxfalse +%\newbox\NRC@theIDbox +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\maketitle} +% \begin{macro}{\ifNRC@closingrule} +% Syntax: \cs{maketitle}\meta{optional-asterisk} +% +% Simply use what's gone before. If the \meta{optional-asterisk} is +% present (two-column classes only), a 1pc rule is placed after the +% abstract/r\'esum\'e: this is required if the whole is so long that +% it runs over to a second page. +% +% First, let's define a flag for this closing rule +% \begin{macrocode} +%<*nrc2> +\newif\ifNRC@closingrule +\NRC@closingrulefalse +% +% \end{macrocode} +% +% Start the definition. There's not actually much code in common for +% the 1-column and the 2-column cases. The 1-column case is in +% fact \emph{much} simpler. +% \begin{macrocode} +\renewcommand\maketitle{% +% \end{macrocode} +% +% For 1-column setting, we start by adjusting the skip from the base of +% the headline (consisting, in this case, merely of the folio) to the +% baseline of the title. Flying blind (calculation doesn't seem to +% get this right, so this is an empirical separation)\dots +% \begin{macrocode} +%<*nrc1> + \NRC@maketitle + \vspace*{2pc}% + \ifNRC@IDbox\NRC@makeIDbox{\textwidth}\fi +} +% +% \end{macrocode} +% +% The other (2-column) journals set themselves with a title at the +% top, and the rest in 2 columns. First detect (and save the flag +% for) the closing rule; then continue +% \begin{macrocode} +%<*nrc2> + \@ifstar{\NRC@closingruletrue\NRC@iimaketitle}{\NRC@iimaketitle}% +} +\newcommand{\NRC@iimaketitle}{% + \NRC@maketitle + \ifNRC@IDbox\NRC@makeIDbox{% + \if@onecolid\NRC@columnwidth\else\textwidth\fi}% + \fi + \ifx\NRC@abstract@i\@undefined + \NRC@warning{Neither abstract nor resume given}% + \else + \begingroup + \the\NRC@abstract@i + \@topsepadd\z@ + \endtrivlist + \endgroup + \ifx\NRC@abstract@ii\@undefined + \NRC@warning{One of abstract and resume missing}% + \else + \gdef\NRC@absressep{8}% + \begingroup + \the\NRC@abstract@ii + \@topsepadd\z@ + \endtrivlist + \endgroup + \fi + \fi +% \end{macrocode} +% +% Now we insert the closing rule, if the user asked for it. The space +% above and below the rule is to be \texttt{1pc} nominal, but in a +% properly formatted paper, the abstract or r\'esum\'e (whichever +% came second) will have added \texttt{8pt} by way of \cs{topsep} at +% the bottom of the list. We therefore only add \texttt{4pt} above +% the rule. +% +% The spacing in the absence of the rule is still that derived from +% \texttt{nrc1.cls} --- it may need adjustment. +% \begin{macrocode} + \ifNRC@closingrule + \vskip 4\p@ + \noindent\rule{\textwidth}{\p@} + \vskip 1pc + \else + \vspace*{8\p@}% + \fi + \global\dbltextfloatsep \z@ + \RestartDouble + \if@onecolid + \ifNRC@IDbox + \@float{figure}[b!] + \box\NRC@theIDbox + \end@float + \fi + \fi +} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@maketitle} +% Syntax: \cs{NRC@maketitle} +% +% Makes the title of a paper, which will reside at the top of the +% first page of the paper. +% +% First, do we have a reversed-box special title? If we do, and it's +% the only title we have, we create it now. +% \begin{macrocode} +\newcommand{\NRC@maketitle}{% + \vspace*{-6\p@}% + \if@specialtitle + \if@specialonly + \bgroup + \fboxsep\z@ + \noindent\hspace{\NRC@titleoffset}% + \colorbox{black}{% + \hskip 1pc\relax +%<*nrc2> + \parbox[t]{37pc}{%} match extra parbox opening + \fontsize{18}{28}% +% +%<*nrc1> + \parbox[t]{28pc}{% + \fontsize{16}{24}% +% + \usefont\f@encoding\sfdefault mn% + \NRC@sectragged + \advance\rightskip 1pc\relax + \textcolor{white}{% + \vrule \@height21\p@ \@depth\z@ \@width\z@ + \@special@title + \vrule \@height\z@ \@depth9\p@ \@width\z@}% + }% + }% + \par + \pagestyle{nrcplain}% + \thispagestyle{nrcplain}% + \egroup +% \end{macrocode} +% +% This article \emph{only} has a special title, so we're now +% done\dots\par\noindent\dots\ but how do we signal that? Pro tem, +% we'll do a touch of the \cs{if@tempswa} diddling +% \begin{macrocode} + \@tempswafalse + \else + \@tempswatrue + \fi + \else + \@tempswatrue + \fi +% \end{macrocode} +% +% Now, we know whether we're to do an `ordinary' paper title (possibly +% in addition to a reversed-box special title); this knowledge is +% encoded in \cs{if@tempswa}, which we now use. +% +% Thereafter, we're generating an `ordinary title'. Evaluate width +% for box to hold the title (allowing for indent but not left rule) +% \begin{macrocode} + \if@tempswa + \@tempdima\textwidth + \advance\@tempdima -\NRC@titleoffset + \setbox\@tempboxa\vbox{% + \hsize\@tempdima +% \end{macrocode} +% +% Is there an `ordinary' special title? If so, we put it in now, so +% as to get it into the bit with a vertical bar along its side +% \begin{macrocode} + \if@specialtitle + \bgroup + \fboxsep\z@ + \noindent + \colorbox{black}{% + \hskip 1pc\relax +%<*nrc2> + \parbox[t]{37pc}{%} match extra parbox opening + \fontsize{18}{28}% +% +%<*nrc1> + \parbox[t]{28pc}{% + \fontsize{16}{24}% +% + \usefont\f@encoding\sfdefault mn% + \NRC@sectragged + \advance\rightskip 1pc\relax + \textcolor{white}{% + \vrule \@height21\p@ \@depth\z@ \@width\z@ + \@special@title + \vrule \@height\z@ \@depth9\p@ \@width\z@}% + }% + }% + \par + \vspace*{2pc}% + \egroup + \fi +% \end{macrocode} +% +% Now the common-or-garden `ordinary' title +% \begin{macrocode} + \fontsize{18}{24}% + \usefont\f@encoding\sfdefault cn% + \NRC@sectragged + \noindent\@title\par + \@tempdima 2.5pc + \advance\@tempdima -\prevdepth + \advance\@tempdima -11pt% *** pragmatic value *** + \vspace\@tempdima + \fontsize{11}\@xiipt + \selectfont\NRC@sectragged + \noindent\NRC@defaultauthorlist\par + \@tempdima 17\p@% 1.5pc - 1pt + \advance\@tempdima -\prevdepth + \vspace\@tempdima + }% + \@tempdima \NRC@titleoffset + \advance\@tempdima -4\p@ + \bgroup + \noindent\hb@xt@\hsize{% + \vrule \@width4\p@ + \kern \@tempdima + \vbox{\box\@tempboxa}% + }% + \parskip\z@skip + \par + \noindent\hrule \@height\p@ + \egroup + \global\NRC@IDboxtrue + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@makeIDbox} +% Syntax: \cs{NRC@makeIDbox}\marg{width} +% +% Makes an `ident box' for a paper, in the given width (which will +% typically be \cs{textwidth} or \cs{columnwidth}) +% +% If we are doing the original sort of ID box (either for the 1-column +% case, or the 2-column classes in the one-column-only case), we set +% the box into a float at the bottom of the page. It being an +% unknown sort of float, we could allocate it a float classification, +% but that seems a little \emph{de trop}, so we call it a figure. +% \begin{macrocode} +\newcommand{\NRC@makeIDbox}[1]{% +%\@float{figure}[b!] +%<*nrc2> +% \end{macrocode} +% +% For the 2-column classes, we +% simply stick the ID box into a (\TeX) box, for later use by the +% title-page page style (if it's a 2-column-wide box), or for putting +% into a float \emph{after} two-column typesetting has been +% established. +% \begin{macrocode} + \setbox\NRC@theIDbox\vbox\bgroup + \hsize #1 +% + \noindent\hrule \@height\p@ + \@tempdima #1 + \advance\@tempdima -1pc + \setbox\@tempboxa\hbox{% + \smallt\NRC@received + }% + \setbox\@tempboxa\vbox{% + \hsize \@tempdima + \@tempdima 1pc + \advance\@tempdima -\ht\@tempboxa + \vspace{\@tempdima}% +% \end{macrocode} +% +% If the IDbox is going to be set in two columns internally, start up +% multicols now; we zero the multicolumn separator to avoid excessive +% vertical spacing at the top of the IDbox (note that since we're +% inside a \cs{vbox} at this stage we can rely on grouping to restore +% the value for us) +% \begin{macrocode} +%<*nrc2> + \if@onecolid\else + \if@multcolid + \linewidth \hsize + \multicolsep\z@skip + \columnsep 1.5pc + \begin{multicols}{2} + \fi + \fi +% +% \end{macrocode} +% +% Insert the received/accepted/`other ID dates'/`published on the web +% site' line(s). The [rev]received/[rev]accepted commands sort out their +% own internal spacing, and a global marker (\cs{NRC@received@sep}) says +% whether a space is needed before the next thing in the ID box. +% \begin{macrocode} + \noindent + {% + \smallt + \NRC@received + \ifNRC@webpub + \NRC@received@sep + \NRC@webpub + \fi + \par + }% + \vspace{7\p@}% *** pragmatic value *** +% \end{macrocode} +% +% Change font size for the next few things +% \begin{macrocode} + \smallt +% \end{macrocode} +% +% Insert the associate editor's name, if there is one +% \begin{macrocode} + \ifNRC@assoced + \noindent\NRC@assoced\par + \vspace{7\p@}% *** pragmatic value *** + \fi +% \end{macrocode} +% +% Insert the corresponding editor's name, if there is one +% \begin{macrocode} + \ifNRC@corred + \noindent\NRC@corred\par + \vspace{7\p@}% *** pragmatic value *** + \fi +% \end{macrocode} +% +% Insert the dedication, if there is one +% \begin{macrocode} + \ifNRC@dedication + \bgroup + \NRC@sectragged + \noindent + \textit{\NRC@dedication}\par + \vspace{7\p@}% *** pragmatic value *** + \egroup + \fi +% \end{macrocode} +% +% Insert the list of abbreviations, if there is one +% \begin{macrocode} + \if@abbreviations + \bgroup + \NRC@sectragged + \noindent + \textbf{\NRC@text@abbreviations\ifNRC@french~\fi\string:}% + \ \@abbreviations\par + \vspace{7\p@}% *** pragmatic value *** + \egroup + \fi +% \end{macrocode} +% +% Now the list of authors and their +% addresses +% \begin{macrocode} + {% + \@NRC@AddressCommands + \NRC@default@authaddlist +% \end{macrocode} +% +% Add the comment deadline note +% \begin{macrocode} + \ifNRC@commdate + \vspace{7\p@}% pragmatic + \noindent\NRC@commdate\par + \fi +% \end{macrocode} +% +% and finally the footnote bodies, if there are any +% \begin{macrocode} + \ifx\NRC@addrfnbody\@empty + \else + \vspace{7\p@}% *** pragmatic value *** + \NRC@addrfnbody + \fi + }% +%<*nrc2> + \if@onecolid\else + \if@multcolid + \end{multicols} + \fi + \fi +% + }% +% \end{macrocode} +% (That brace closes the assignation to \cs{@tempboxa}.) +% +% And now finish off the float that makes up the ID box +% \begin{macrocode} + \@tempdima 1pc + \advance\@tempdima -4\p@ + \noindent\hb@xt@#1{% + \vrule \@width4\p@ + \kern \@tempdima + \vbox{\box\@tempboxa}% + } +%\end@float +%<*nrc2> + \egroup + \if@onecolid + \else +% \typeout{\string\NRC@theIDbox: ht=\the\ht\NRC@theIDbox, +% dp=\the\dp\NRC@theIDbox}% + \@tempdima \ht\NRC@theIDbox + \advance\@tempdima \dp\NRC@theIDbox + \advance\@tempdima \textfloatsep + \global\advance\@colht -\@tempdima + \global\@colroom \@colht + \global\vsize \@colht + \global\pagegoal \@colht + \global\advance\footskip \@tempdima + \fi +% + \thispagestyle{nrctitlepage}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@restorefootskip} +% Used to restore \cs{footskip} after mucking about with it in +% case we're going to encounter a huge great monster +% abstract/r\'esum\'e; can be used anywhere at any time, since it's +% restoring a default value\dots +% \begin{macrocode} +\xdef\NRC@restorefootskip{% + \global\noexpand\footskip\the\footskip}% +% \end{macrocode} +% \end{macro} +% +% \subsection{Abstract and R\'esum\'e} +% +% \begin{environment}{abstract} +% \begin{environment}{resume} +% \begin{macro}{\NRC@absressep} +% \begin{macro}{\NRC@extract@name} +% The abstract and r\'esum\'e are specified as simple list +% environments, and preserved in a token register. Nothing special is +% done about their body, and no effort is made to enforce the order +% (i.e., English or French first) that they appear. Apart from the +% name (and the fact that the abstract environment already exists, so +% that it must needs be redefined) they are implemented by identical +% code. If Babel is loaded with the appropriate language, each +% environment safely (i.e., without writing the \verb|.aux| file) +% selects the appropriate language within itself. +% +% In the case of the nrc1 class, the token register is immediately +% typeset. In the case of the nrc2 class, the token registers are +% stored for use when a \cs{maketitle} command is issued. +% +% \cs{NRC@absressep} is the value to use for \cs{topsep} for the +% \emph{top} only of the \texttt{trivlist} implementation of the +% environments (\cs{z@} is used at the bottom of the environments: +% things get out of hand otherwise\dots). It gets multiplied by +% \cs{p@}. +% +% The other skips are played fast and loose with, too, inside the +% environments' groups. \cs{partopsep} is set zero, since we want +% absolute control of separation, and the stretchability of +% \cs{parskip} is also stamped upon while we execute the \cs{trivlist} +% command that establishes our `list'. +% \begin{macrocode} +\newcommand\NRC@absressep{18} +\renewenvironment{abstract}{% + \NRC@gather@env{\expandafter\topsep\NRC@absressep\p@ + \partopsep\z@ + \parskip\z@ + \trivlist + \parskip0\p@ \@plus\p@ + \leftmargin \NRC@titleoffset + \advance\linewidth -\leftmargin + \advance\linewidth -\rightmargin + \advance\@totalleftmargin \leftmargin + \parshape \@ne \@totalleftmargin \linewidth + \item[]% + \let\NRC@extract@name\@firstoftwo + \ifx\extrasenglish\@undefined + \else + \select@language{english}% + \fi + \smalll + \textbf{\abstractname}:% + \NRC@sectragged + \ \ignorespaces}}% +%<*nrc1> + {% + \the\NRC@gather@toks + \@topsepadd\z@ + \endtrivlist + \gdef\NRC@absressep{8}} +% +% \end{macrocode} +% +% In the two-column classes, we don't typeset the abstract (or +% r\'esum\'e) as we come to it, merely relying on having saved it in +% \cs{NRC@abstract@i(i)} and dumping it out in the course of +% \cs{maketitle}'s ``full-width'' phase. +% \begin{macrocode} +% {} +% \end{macrocode} +% +% Now the analagous things for the French r\'esum\'e +% \begin{macrocode} +\newenvironment{resume}{% + \NRC@gather@env{\expandafter\topsep\NRC@absressep\p@ + \partopsep\z@ + \parskip\z@ + \trivlist + \parskip0\p@ \@plus\p@ + \leftmargin \NRC@titleoffset + \advance\linewidth -\leftmargin + \advance\linewidth -\rightmargin + \advance\@totalleftmargin \leftmargin + \parshape \@ne \@totalleftmargin \linewidth + \item[]% + \let\NRC@extract@name\@secondoftwo + \ifx\extrasfrench\@undefined + \else + \select@language{french}% + \fi + \smalll + \textbf{\nomresume}\,:% + \NRC@sectragged + \ \ignorespaces}}% +%<*nrc1> + {% + \the\NRC@gather@toks + \@topsepadd\z@ + \endtrivlist + \gdef\NRC@absressep{8}} +% +% {} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} +% \end{environment} +% +% \begin{macro}{\nomresume} +% \begin{macro}{\traduit} +% \begin{macro}{\Traduit} +% \begin{macro}{\translation} +% \begin{macro}{\keywords} +% \begin{macro}{\motscles} +% \begin{macro}{\PACS} +% \begin{macro}{\NRC@PACS@en} +% \begin{macro}{\NRC@PACS@ens} +% \begin{macro}{\NRC@PACS@fr} +% \begin{macro}{\NRC@PACS@frs} +% Various small supporting macros for the above. +% +% \cs{traduit} is used at the end of a r\'esum\'e when the author +% hasn't provided a French version: the editors have translated the +% English abstract, and \cs{traduit} records this fact. Similarly, +% \cs{translation} is used at the end of an abstract that has been +% translated for a French-writing author. +% +% \cs{Traduit} is as \cs{traduit}, but with a capital letter for +% r\'edaction\dots +% +% \cs{keywords} and \cs{motscles} may also be used within an abstract +% or resume (respectively) environment. If used, they should appear +% immediately after the body of the abstract and above any +% \cs{traduit} or \cs{translation} command. +% +% \cs{PACS} generates PACS code entries for the end of abstracts or +% resum\'es; it ``knows'' which language to use, from the setting of +% \cs{NRC@extract@name}. +% \begin{macrocode} +\newcommand\nomresume{R\'esum\'e} +\newcommand\traduit{\par\vspace{4\p@}\noindent + [Traduit par la r\'edaction]% +} +\newcommand\Traduit{\par\vspace{4\p@}\noindent + [Traduit par la R\'edaction]% +} +\newcommand\translation{\par\vspace{4\p@}\noindent + [Journal translation]% +} +\newcommand\keywords[1]{\par\vspace{4\p@}\noindent + \emph{Key words:}\ #1.% +} +\newcommand\motscles[1]{\par\vspace{4\p@}\noindent + \emph{Mots cl\'es\,:}\ #1.% +} +\newcommand\PACS{% + \par\vspace{4\p@}% + \noindent PACS\ % + \@ifstar{% + \NRC@extract@name\NRC@PACS@ens\NRC@PACS@frs + }{% + \NRC@extract@name\NRC@PACS@en\NRC@PACS@fr + }% +} +\newcommand\NRC@PACS@ens[1]{No.:\ #1} +\newcommand\NRC@PACS@en[1]{Nos.:\ #1} +\newcommand\NRC@PACS@frs[1]{N\textsuperscript{o}\,:\ #1} +\newcommand\NRC@PACS@fr[1]{N\textsuperscript{os}\,:\ #1} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@abstract@toks} +% \begin{macro}{\NRC@resume@toks} +% \begin{macro}{\NRC@gather@toks} +% In the two-column classes, \cs{NRC@abstract@toks} and +% \cs{NRC@resume@toks} are used to gather the abstract or r\'esum\'e; +% in the physics class both are gathered in \cs{NRC@gather@toks} +% \begin{macrocode} +%\newtoks\NRC@abstract@toks +%\newtoks\NRC@resume@toks +%\newtoks\NRC@gather@toks +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@gather@env} +% Syntax: \cs{NRC@gather@env}\marg{preamble} +% +% Gather the contents of a text environment into the corresponding +% token register. The routine assumes that it's gathering an +% abstract's content, and inserts the \meta{preamble} in front of the +% gathered text (this will be language selection, `Abstract' or +% `R\'esum\'e', and the start of the doings of the abstract +% environment itself). (There's no need of a postamble, since the +% same termination is used in both cases. This is a bit of a relief, +% since it would be dead tricky to program.) +% +% The routine has the side effect of setting up \cs{NRC@abstract@i} +% (to the token register containing the first abstract gathered) and +% \cs{NRC@abstract@ii} (to the second one) +% +% This code uses what (now) seems a Usual trick (it originally +% derives, in my experience, from David Carlisle's tabularx package). +% \begin{macrocode} +\newcommand\NRC@gather@env[1]{% + \let\NRC@gathering\@currenvir +%<*nrc2> + \expandafter\let\expandafter\NRC@gather@toks + \csname NRC@\NRC@gathering @toks\endcsname +% + \global\NRC@gather@toks{#1}% + {\ifnum0=`}\fi + \NRC@gather@body +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@gather@body} +% Syntax: \cs{NRC@gather@body}\marg{body-portion}\cs{end} +% +% Gathers the body of an environment up to the next instance of +% \cs{end} +% \begin{macrocode} +\long\def\NRC@gather@body#1\end{% + \global\NRC@gather@toks\expandafter{\the\NRC@gather@toks#1}% + \NRC@gather@findend +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@gather@findend} +% Syntax: \cs{NRC@gather@findend}\marg{end-arg} +% +% Checks the `argument' that the user thought she was giving to the +% \cs{end} `command' that terminated the argument of a +% \cs{NRC@gather@body} +% \begin{macrocode} +\newcommand\NRC@gather@findend[1]{% + \def\@tempa{#1}% + \ifx\@tempa\NRC@gathering + \expandafter\NRC@gather@end + \else + \global\NRC@gather@toks\expandafter{\the\NRC@gather@toks\end{#1}}% + \expandafter\NRC@gather@body + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@gather@end} +% \begin{macro}{\NRC@abstract@i} +% \begin{macro}{\NRC@abstract@ii} +% Syntax: \cs{NRC@gather@end} +% +% Terminates a gathering operation, by closing the group it's operated +% in, setting up the appropriate \cs{NRC@abstract@i(i)} if necessary +% and finally issuing an `end \meta{gather-environment}' command. +% \begin{macrocode} +\newcommand\NRC@gather@end{% + \ifnum0=`{\fi}% +% \end{macrocode} +% +% we only need preserve the token registers if we're in a two-column +% class +% \begin{macrocode} +%<*nrc2> + \ifx\NRC@abstract@i\@undefined + \global\let\NRC@abstract@i \NRC@gather@toks + \else + \global\let\NRC@abstract@ii\NRC@gather@toks + \fi +% + \expandafter\end\expandafter{\NRC@gathering}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \section{Font size definitions} +% +% \begin{macro}{\easebaselines} +% \begin{macro}{\ifNRC@easedbaselines} +% \begin{macro}{\ifNRC@relaxedspacing} +% Syntax: \cs{easebaselines} +% +% An editorial command for two-column papers: if a decision is taken +% to ease the baselines of the paper, this command is issued: the +% effect is very slightly to ease the values for \cs{baselineskip} +% used for \cs{normalsize}, \cs{small} and \cs{footnotesize} font +% selections. A preamble command, only. +% +% \cs{ifNRC@relaxedspacing} allows the extended relaxation of skips +% (above sectioning commands, around floats, and around equations) +% that seems to be necessary in some cases. The switch is a separate +% on from \cs{ifNRC@easedbaselines}, at present, though implemented +% (as it were) as a sub-switch; however it always has the same value +% as the main switch. +% \begin{macrocode} +\newif\ifNRC@easedbaselines \NRC@easedbaselinesfalse +\newif\ifNRC@relaxedspacing \NRC@relaxedspacingfalse +\newcommand*{\easebaselines}{% + \ifNRC@author@use + \NRC@warning{\string\easebaselines\space is an editor command} + \fi + \NRC@easedbaselinestrue +% \NRC@relaxedspacingtrue + \AtBeginDocument{\renewcommand{\arraystretch}{1.05}}% +} +\@onlypreamble\easebaselines +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\normalsize} +% The user level command for the main size is |\normalsize|. +% Internally \LaTeX{} uses |\@normalsize| when it refers to the +% main size. |\@normalsize| will be defined to work like +% |\normalsize| if the latter is redefined from its default +% definition (that just issues an error message). Otherwise +% |\@normalsize| simply selects a \texttt{10pt}/\texttt{12pt} size. +% +% The |\normalsize| macro also sets new values for\\ +% |\abovedisplayskip|, |\abovedisplayshortskip| and +% |\belowdisplayshortskip|. +% \begin{macrocode} +\renewcommand{\normalsize}{% +% \ifNRC@easedbaselines + \@setfontsize\normalsize\@xpt\@xiipt +%<*nrc2> + \else + \@setfontsize\normalsize\@xpt{11}% + \fi +% + \ifNRC@relaxedspacing + \abovedisplayskip 10\p@ \@plus0.0003fil \@minus5\p@ + \else + \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ + \fi + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ +% \end{macrocode} +% +% The |\belowdisplayskip| is always equal to the +% |\abovedisplayskip|. The parameters of the first level list at +% \cs{normalsize} are always given by |\@listI|. +% \begin{macrocode} + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI} +% \end{macrocode} +% +% We initially choose the normalsize font (article class does this, +% but it's also done in \cs{begin}|{document}|, so it's not entirely +% clear what the point is\dots). +% \begin{macrocode} +\normalsize +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\small} +% This is similar to |\normalsize|. +% \begin{macrocode} +\renewcommand{\small}{% +% \ifNRC@easedbaselines + \@setfontsize\small\@ixpt{11}% +%<*nrc2> + \else + \@setfontsize\small\@ixpt\@xpt + \fi +% + \ifNRC@relaxedspacing + \abovedisplayskip 8.5\p@ \@plus0.0003fil \@minus4\p@ + \else + \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ + \fi + \abovedisplayshortskip \z@ \@plus2\p@ + \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 4\p@ \@plus2\p@ \@minus2\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\smalll} +% \begin{macro}{\smallt} +% These are variants of \cs{small} for use where the baseline spacing +% is fixed regardless of the state of \cs{easedbaselines}; \cs{smalll} +% (loose small) has 11pt baseline skip; \cs{smallt} (tight small) has +% 10pt baseline skip. +% \begin{macrocode} +\newcommand{\smalll}{% + \@setfontsize\small\@ixpt{11}% + \abovedisplayshortskip \z@ \@plus2\p@ + \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 4\p@ \@plus2\p@ \@minus2\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +} +\newcommand{\smallt}{% + \@setfontsize\small\@ixpt\@xpt + \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ + \abovedisplayshortskip \z@ \@plus2\p@ + \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 4\p@ \@plus2\p@ \@minus2\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +} + % \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\footnotesize} +% This is similar to |\normalsize|. +% \begin{macrocode} +\renewcommand{\footnotesize}{% +% \ifNRC@easedbaselines + \@setfontsize\footnotesize\@viiipt{9.5}% +%<*nrc2> + \else + \@setfontsize\footnotesize\@viiipt\@ixpt + \fi +% + \ifNRC@relaxedspacing + \abovedisplayskip 6\p@ \@plus0.0003fil \@minus4\p@ + \else + \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ + \fi + \abovedisplayshortskip \z@ \@plus\p@ + \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 3\p@ \@plus\p@ \@minus\p@ + \parsep 2\p@ \@plus\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\scriptsize} +% \begin{macro}{\tiny} +% \begin{macro}{\large} +% \begin{macro}{\Large} +% \begin{macro}{\LARGE} +% \begin{macro}{\huge} +% \begin{macro}{\Huge} +% These are all much simpler than the previous macros: they just +% select a new fontsize, but leave the parameters for displays and +% lists alone. +% \begin{macrocode} +\renewcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt} +\renewcommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt} +\renewcommand{\large}{\@setfontsize\large\@xiipt{14}} +\renewcommand{\Large}{\@setfontsize\Large\@xivpt{18}} +\renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{22}} +\renewcommand{\huge}{\@setfontsize\huge\@xxpt{25}} +\renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt{30}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Divisions of the paper} +% +% \begin{macro}{\NRC@sectragged} +% All the section titles that aren't run-in (as well as a whole bunch +% of other things) are set ragged right, which we define as: +% \begin{macrocode} +\newcommand{\NRC@sectragged}{\hyphenpenalty\@M + \rightskip\z@ \@plus 5em + \parfillskip\z@ \@plus 1fil + \spaceskip=0.3333em\relax + \xspaceskip=0.5em\relax +} +% \end{macrocode} +% \end{macro} +% +% \subsection{\LaTeX{} `sections'} +% +% \begin{macro}{\section} +% \begin{macro}{\Asection} +% \begin{macro}{\subsection} +% \begin{macro}{\Bsection} +% \begin{macro}{\subsubsection} +% \begin{macro}{\Csection} +% \begin{macro}{\subsubsubsection} +% \begin{macro}{\Dsection} +% \begin{macro}{\paragraph} +% \begin{macro}{\Esection} +% +% The following definitions all incorporate the baseline-baseline +% skips of the specification in a slightly cavalier way: the skip is +% calculated out in points, and the font size of the following text is +% subtracted. This is inaccurate because (1) the depth of the text +% above is ignored (how would one find it?), and (2) the font size is +% only rather loosely related to the typical height of a line of +% text. However, the results prove acceptable, so let's not worry! +% \begin{macrocode} +\renewcommand\section{% + \@startsection{section}% + \@ne + \z@ +%<*nrc1> + {12\p@ \@plus4.5\p@ \@minus1.5\p@}% + {6\p@}% +% +%<*nrc2> + {18\p@ \@plus6\p@}% + {6\p@ \@plus3\p@}% +% + {\fontsize{11}{12}% +% \let\@hangfrom\@firstofone\noindent + \usefont\f@encoding\sfdefault cn% + \NRC@sectragged}% + } +\let\Asection\section +\renewcommand\subsection{% + \@startsection{subsection}% + \tw@ + \z@ +%<*nrc2> + {12\p@ \@plus6\p@}% + {.1\p@ \@plus2\p@}% +% +%<*nrc1> + {14\p@ \@plus4.5\p@ \@minus1.5\p@}% + {2\p@ \@plus \p@}% +% + {\reset@font\bfseries +% \let\@hangfrom\@firstofone\noindent + \NRC@sectragged}% + } +\let\Bsection\subsection +\renewcommand\subsubsection{% + \@startsection{subsubsection}% + \thr@@ + \z@ +%<*nrc2> + {9\p@ \@plus3\p@}% + {.1\p@ \@plus2\p@}% +% +%<*nrc1> + {14\p@ \@plus4.5\p@ \@minus1.5\p@}% + {2\p@ \@plus \p@}% +% + {\reset@font\bfseries\itshape +% \let\@hangfrom\@firstofone\noindent + \NRC@sectragged}% + } +\let\Csection\subsubsection +\newcommand\subsubsubsection{% + \@startsection{paragraph}% + 4% + \z@ +%<*nrc2> + {7\p@ \@plus2\p@}% + {.1\p@ \@plus2\p@}% +% +%<*nrc1> + {14\p@ \@plus4.5\p@ \@minus1.5\p@}% + {2\p@ \@plus \p@}% +% + {\reset@font\itshape +% \let\@hangfrom\@firstofone\noindent + \NRC@sectragged}% + } +\let\Dsection\subsubsubsection +% \renewcommand\paragraph{% +% \@startsection{subparagraph}% +% 5% +% \z@ +% {3.25ex \@plus1ex \@minus.2ex}% +% {-1em}% +% {\normalfont\normalsize\bfseries}% +% } +\renewcommand\paragraph{% + \@startsection{subparagraph}% + 4% + \z@ + {8\p@ \@plus2.5\p@ \@minus\p@}% + {-0.5em}% + {\reset@font\itshape}% + } +\let\Esection\paragraph +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@seccntformat} +% \begin{macro}{\NRC@seccnt@paragraph} +% +% Section counters have a trailing full stop. +% \begin{macrocode} +\renewcommand\@seccntformat[1]{% + \@ifundefined{NRC@seccnt@#1}% + {\@nameuse{the#1}.\hskip0.5em\relax}% + {\@nameuse{NRC@seccnt@#1}}% +} +\newcommand\NRC@seccnt@paragraph{\theparagraph.\ } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{environment}{secnumdepth} +% +% For the above to have the effect we require, we must allow +% \cs{paragraph}'s section number to appear\dots +% \begin{macrocode} +\setcounter{secnumdepth}{4} +% \end{macrocode} +% \end{environment} +% +% +% \subsection{Appendices} +% +% We introduce a minor extension of the \LaTeX{} \cs{appendix} +% command. (Used as in \LaTeX{}, the command behaves in the standard +% way.) +% +% \begin{macro}{\appendix} +% \begin{macro}{\NRC@appendix} +% \begin{macro}{\NRC@@appendix} +% \begin{macro}{\NRC@seccnt@section} +% Syntax: \cs{appendix}\meta{optional-asterisk} +% +% Used as in `bare' \LaTeX{}, the command merely does the \LaTeX{} +% thing, \emph{viz}., reset section numbering and change the form of +% the section counter. In the form \cs{appendix*}, the command +% additionally prepends section headings with `Appendix'. +% \begin{macrocode} +\let\NRC@@appendix\appendix +\renewcommand{\appendix}{\@ifstar \NRC@appendix\NRC@@appendix} +\newcommand{\NRC@appendix}{\NRC@@appendix + \gdef\NRC@seccnt@section{\appendixname\ % + \thesection\ifNRC@french~\string:\else:\fi\hskip0.5em\relax + }% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \section{Miscellaneous typesetting} +% +% \subsection{Footnotes} +% +% The footnotes used within the ident box on the title page are dealt +% with separately; here we specify footnotes for the body text. +% +% \begin{macro}{\footnoterule} +% The skip allows for 3pt (nrc1) or 4pt (nrc2) between the rule and +% the text of the footnote (the \cs{footnoterule} command adds nothing +% to the vertical spacing, as is proper). +% \begin{macrocode} +%<*nrc1> +\skip\footins20\p@ +\renewcommand\footnoterule{\kern-4\p@ + \hrule \@height\p@ + \kern3\p@ +} +% +%<*nrc2> +\skip\footins14\p@\@plus10\p@ +\renewcommand\footnoterule{\kern-5\p@ + \hrule \@height\p@ + \kern4\p@ +} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@footnotetext} +% Since we use a non-standard size for footnotes, we reproduce the +% whole of the \cs{@footnotetext} command here, with the size +% changed. The size used is ``tight'' small (9/10pt). +% \begin{macrocode} +\long\def\@footnotetext#1{% + \insert\footins{% + \reset@font\smallt + \interlinepenalty\interfootnotelinepenalty + \splittopskip\footnotesep + \splitmaxdepth \dp\strutbox \floatingpenalty \@MM + \hsize\columnwidth \@parboxrestore + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark + }% + \color@begingroup + \@makefntext{% + \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox + }% + \color@endgroup + }% +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefntext} +% And the body of footnotes looks as follows: +% \begin{macrocode} +\renewcommand\@makefntext[1]{% + \@hangfrom{% + \ifNRC@french + \@thefnmark.\hskip0.3333em% + \else + \hb@xt@4\p@{\@makefnmark\hss}% + \fi + }% + #1% +} +% \end{macrocode} +% \end{macro} +% +% \subsection{Mathematics} +% +% \begin{macro}{\mathindent} +% We set \cs{mathindent} according to which side the equations are +% going to appear (it can be either side in either class, nowadays). +% \begin{macrocode} +\iflefteqnos + \mathindent32pt +\else + \mathindent\z@ +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifNRC@amsmath} +% In case that \verb'amsmath' has been loaded, things are going to be +% somewhat different. So, first of all, we need to detect whether +% this is the case\dots +% \begin{macrocode} +\newif\ifNRC@amsmath +\NRC@amsmathfalse +\AtBeginDocument{% + \@ifundefined{tagform@}\relax{% + \NRC@amsmathtrue +% \end{macrocode} +% +% If we are indeed under the sway of \verb'amsmath', we need to patch a +% different skip for margin adjustment. If equation numbers are to be +% set on the left, this will be set non-zero because of the allowance +% needed for the equation tag. +% \begin{macrocode} + \iflefteqnos + \@mathmargin32\p@\relax + \else + \@mathmargin\z@skip + \fi + } +} +% \end{macrocode} +% \end{macro} +% +% In case \verb'amsmath' is going to be loaded (we don't know at this +% stage, of course), we ensure it gets told about equations being set +% flush left; we also tell it about left-positioned equation numbers +% if we're doing those: +% \begin{macrocode} +\iflefteqnos + \PassOptionsToPackage{fleqn,leqno}{amsmath} +\else + \PassOptionsToPackage{fleqn}{amsmath} +\fi +% \end{macrocode} +% +% +% \begin{macro}{\@eqnnum} +% Set an equation number, potentially at the left (this will be zapped +% by amsmath if it's loaded) +% \begin{macrocode} +\renewcommand{\@eqnnum}{% + \iflefteqnos + \hb@xt@1sp{}% + \rlap{\normalfont\normalcolor + \hskip -\displaywidth \eqnoformat\theequation}% + \else + {% + \normalfont\normalcolor \eqnoformat\theequation + }% + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\eqnoformat} +% Syntax: \cs{eqnoformat}\marg{equation number} +% +% Defines the layout of an equation tag; by default this is +% \verb'[number]' (except in \verb'nrc1', in its default state of +% equation numbers being on the right, when it's \verb'(number)'), but +% the user may redefine\dots +% \begin{macrocode} +% \iflefteqnos + \newcommand{\eqnoformat}[1]{[\ignorespaces#1\unskip\@@italiccorr]} +%<*nrc1> +\else + \newcommand{\eqnoformat}[1]{(\ignorespaces#1\unskip\@@italiccorr)} +\fi +% +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\tagform@} +% If \verb'amsmath' has been loaded, we need to redo the above when the +% document is actually `starting'. We also note that \cs{@eqnnum} +% will have been hacked, but that the thing that makes the difference +% is \cs{tagform@}, so we also redo that at this stage. +% \begin{macrocode} +\AtBeginDocument{\ifNRC@amsmath + \def\tagform@#1{% + \maketag@@@{\eqnoformat{#1}}} + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@displaymath} +% \begin{macro}{\NRC@@displaymath} +% \begin{macro}{\NRC@enddisplaymath} +% \begin{macro}{\NRC@@enddisplaymath} +% In the first version of the \textsf{nrc2} class, we had the +% \texttt{displaymath} environment ($\equiv$ \cs{[}\cs{]}) as a +% non-indented un-numbered version. The NRC's editors have come to +% rely on this, even though it provoked problems following a change in +% specification of the maths margins; we therefore restore the +% original functionality here, in a safe way. +% \begin{macrocode} +%\iflefteqnos +\def\NRC@displaymath{\begingroup + \ifNRC@amsmath + \@mathmargin\z@skip + \else + \mathindent\z@skip + \fi + \NRC@@displaymath +} +\def\NRC@enddisplaymath{\NRC@@enddisplaymath\endgroup} +\AtBeginDocument{\let\NRC@@displaymath\[% + \let\[\NRC@displaymath + \let\NRC@@enddisplaymath\]% + \let\]\NRC@enddisplaymath}% +%\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Maths sizes affect sub- and superscripts done in text mode, too. +% Specifications exist for all text sizes we actually use: we declare, +% below, only for those sizes that differ from what is in the \LaTeX{} +% kernel. +% \begin{macrocode} +\DeclareMathSizes {18} {18} \@xiipt \@xpt +\DeclareMathSizes {16} {16} \@xiipt \@xpt +\DeclareMathSizes {15} {15} \@xpt {8} +\DeclareMathSizes \@xipt \@xipt \@ixpt {7} +\DeclareMathSizes \@ixpt \@ixpt {6} {5} +% \end{macrocode} +% +% \begin{macro}{\numberby} +% Syntax: \cs{numberby}\marg{counter}\marg{division-name} +% +% Arrange that \meta{counter} is reset every time \meta{division-name} +% is stepped, and that \cs{the\meta{counter}} is represented as +% `\meta{division-name}.\meta{counter}' +% \begin{macrocode} +\newcommand\numberby[2]{% + \@ifundefined{c@#1}{\@nocounterr{#1}}% + \@ifundefined{c@#2}{\@nocounterr{#2}}% + \@addtoreset{#1}{#2}% + \expandafter\gdef\csname the#1\expandafter\endcsname + \expandafter{\csname the#2\endcsname.\arabic{#1}}% +} +% \end{macrocode} +% \end{macro} +% +% \emph{Note}: \cs{numberby} is in this section because of its only +% present expected use for number equations by section. +% +% \subsection{Tables} +% +% We need to provide a simple handle on overweight rules. This we do +% by a modification of the \textsf{variline} package I wrote for the +% TUG'95 proceedings. +% +% \begin{macro}{\hline} +% \begin{macro}{\@shline} +% \begin{macro}{\arrayrulewidth} +% Syntax: \cs{hline}\meta{optional-asterisk} +% +% \cs{hline} and \cs{@shline} are a division into two parts of the +% kernel's \cs{hline}; we set \cs{arrayrulewidth}, too, since it has +% a non-standard value +% \begin{macrocode} +\renewcommand\hline{% + \noalign{\ifnum0=`}\fi\@ifstar + {\@shline{2\p@}}% + {\@shline{\arrayrulewidth}}} +\newcommand\@shline[1]{\hrule \@height #1\relax + \futurelet \reserved@a \@xhline} +\arrayrulewidth\p@ +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{tabular} +% \begin{environment}{NRC@@tabular} +% Syntax: unchanged +% +% We save the \LaTeX{} \textsf{tabular} environment definition, and +% sneak a size setting into our redefinition. We have to do this +% \cs{AtBeginDocument}, since useful packages (such as \textsf{array}) +% mangle the definition of \textsf{tabular} +% \begin{macrocode} +\AtBeginDocument{% + \let\NRC@@tabular\tabular + \let\endNRC@@tabular\endtabular + \renewenvironment{tabular}% + {\smalll\NRC@@tabular}% + {\endNRC@@tabular}% +} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \subsection{Text subscripts} +% +% \LaTeX{} itself provides a \cs{textsuperscript} command, but nothing +% for subscripts. +% +% \begin{macro}{\textsubscript} +% \begin{macro}{\@textsubscript} +% Syntax: \cs{textsubscript}\marg{subscripting text} +% +% The code comes from |subscript.sty| on CTAN (written by the author +% of the NRC classes). +% \begin{macrocode} +\DeclareRobustCommand*\textsubscript[1]{% + \@textsubscript{\selectfont#1}} +\def\@textsubscript#1{% + {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \section{Lists, etc.} +% +% Specialised versions of the \texttt{list} environment. +% +% +% \begin{environment}{flenumerate} +% \begin{environment}{flitemize} +% Syntax: \emph{As \texttt{enumerate}/\texttt{itemize}} +% +% We make no provision for the nesting of these lists: they must be +% the outermost list of a nested set (though the specification makes +% no mention of nesting at all). +% \begin{macrocode} +\newenvironment{flenumerate}% + {% + \ifnum \@enumdepth>\z@ + \@toodeep + \else + \advance\@enumdepth\@ne + \def\@enumctr{enumi}% + \leftmargini1.5pc\relax + \labelwidth\leftmargini + \labelsep\z@ + \list + \labelenumi + {% + \usecounter\@enumctr + \def\makelabel##1{##1\hss}% + }% + \fi + }% + \endlist +\newenvironment{flitemize}% + {% + \ifnum \@itemdepth>\z@ + \@toodeep + \else + \advance\@itemdepth\@ne + \def\@itemitem{labelitemi}% + \leftmargini10\p@ + \labelwidth\leftmargini + \labelsep\z@ + \list + \labelitemi + {\def\makelabel##1{##1\hss}}% + \fi + }% + \endlist +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% +% \subsection{Captions and general float handling} +% +% \begin{macro}{\caption} +% \begin{macro}{\topcaption} +% \begin{macro}{\if@topcaption} +% \begin{macro}{\NRC@@caption} +% \begin{macro}{\NRC@topcaptcounter} +% Syntax: \cs{caption} unchanged; \cs{topcaption} the same +% +% \cs{caption} and \cs{topcaption} set their version of +% \cs{if@topcaption} and relay to the saved copy \cs{NRC@@caption}. +% \cs{caption} does nothing else, but \cs{topcaption} also sets up for +% remembering the width of the following table. +% \begin{macrocode} +\let\NRC@@caption\caption +\renewcommand\caption{\@topcaptionfalse\NRC@caption} +\newcommand\topcaption{\@topcaptiontrue + \global\advance\NRC@topcaptcounter\@ne + \NRC@caption +} +\newif\if@topcaption +\@topcaptionfalse +\newcount\NRC@topcaptcounter +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@caption} +% \begin{macro}{\NRC@capt@left} +% \begin{macro}{\NRC@capt@right} +% \cs{NRC@caption} relays from \cs{caption}/\cs{topcaption} to +% \cs{NRC@@caption} (the preserved copy of the kernel \cs{caption}), +% making note of the values of \cs{leftskip} and \cs{rightskip} as we +% go. +% \begin{macrocode} +\newcommand{\NRC@caption}{% + \edef\NRC@capt@left{\the\leftskip}% + \edef\NRC@capt@right{\the\rightskip}% + \NRC@@caption +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@makecaption} +% \begin{macro}{\figurename} +% \begin{macro}{\captionwidth} +% \begin{macro}{\@makecaption} +% Syntax: unchanged from \cs{@makecaption}, but takes account of +% \cs{if@topcaption} +% +% None of the fancy centring code found in standard \LaTeX, and we use +% a fixed size (though the size \emph{is} adjustable by the user). +% The above caption skip is adjusted if in a \cs{topcaption}, to take +% account of effects arising from different font sizes in different +% columns. +% +% We have to defer our definition of \cs{@makecaption} to the start of +% the document, since \textsf{babel} has taken to mucking up our +% definition, if we're usuing `french'. +% +% The width in which to set the caption is \cs{captionwidth} if that's +% set non-zero; otherwise, if this is a topcaption which is followed +% by a tabular whose width we've recorded, we use that; failing both +% conditions we use \cs{hsize} +% \begin{macrocode} +\newcommand\NRC@makecaption[2]{% + \if@topcaption \@tempdima\belowcaptionskip \advance\@tempdima 3.5\p@ + \else \@tempdima\abovecaptionskip \fi \vskip\@tempdima + \@tempdima\captionwidth + \ifdim\@tempdima=\z@ + \if@topcaption + \expandafter\let\expandafter\@tempa + \csname NRC@tabwd@\the\NRC@topcaptcounter\endcsname + \@tempdima\ifx\@tempa\relax + \hsize + \else + \@tempa + \fi + \else + \@tempdima\hsize + \fi + \fi + \hb@xt@\hsize{% + \hskip\NRC@capt@left + \vbox{% + \hsize\@tempdima +% \NRC@sectragged + \smalll + \textbf{#1.}\enspace\ignorespaces#2\unskip\par + }% + \hskip\NRC@capt@right + }% + \@tempdima\if@topcaption + \abovecaptionskip + \advance\@tempdima -6\p@ % pragmatic value from NRC experience + \else + \belowcaptionskip + \fi + \vskip\@tempdima +} +\renewcommand\figurename{Fig.} +\newdimen\captionwidth +\captionwidth\z@ +\AtBeginDocument{\let\@makecaption\NRC@makecaption} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\endtabular} +% \begin{macro}{\endtabular*} +% \begin{macro}{\NRC@@endtabular} +% Termination of tabulars, with code to preserve the width of the +% table just set. Again, this needs to be done \cs{AtBeginDocument} +% (for the same reason that the size change for tabulars has to be). +% \begin{macrocode} +\AtBeginDocument{% + \let\NRC@@endtabular\endtabular + \def\endtabular{\NRC@@endtabular + \if@topcaption + \if@filesw + \setbox\z@\lastbox + \immediate\write\@auxout{% + \string\NRC@tabwd{\the\NRC@topcaptcounter}% + {\the\wd\z@}% + }% + \box\z@ + \fi + \fi + }% + \expandafter\let\csname endtabular*\endcsname\endtabular +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\NRC@tabwd} +% \begin{macro}{\NRC@tabwd@atend} +% Syntax: \cs{NRC@tabwd}\marg{topcaption number}\marg{table width} +% +% \verb|.aux| file command for processing table widths. (Note, we set +% up a dummy version of the command in the file, for the usual +% precautionary reason.) +% +% \cs{NRC@tabwd@atend} is the version of the command to be used in +% end-document \verb|.aux| processing. +% \begin{macrocode} +\newcommand\NRC@tabwd[2]{% + \global\@namedef{NRC@tabwd@#1}{#2}% +} +\AtBeginDocument{\immediate\write\@auxout{% + \noexpand\providecommand\noexpand\NRC@tabwd{% + \noexpand\@gobbletwo}% + }% +} +\newcommand\NRC@tabwd@atend[2]{% + \edef\@tempa{\@nameuse{NRC@tabwd@#1}}% + \def\@tempb{#2}% + \ifx\@tempa\@tempb\else\@tempswatrue\fi +} +\AtEndDocument{\let\NRC@tabwd\NRC@tabwd@atend} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\sepcaption} +% Syntax: \cs{sepcaption}\oarg{\texttt{.lo\emph{x}} text}\marg{caption} +% +% Produce a caption that's to be separated from its figure or table. +% This requires the caption to be of a fixed width, and that there +% should be a full-width rule underneath the caption. The caption +% makes up the whole of a float. +% \begin{macrocode} +\newcommand{\sepcaption}{% + \ifdim \textwidth=\hsize + \def\@tempa{{\NRC@sepcaption{0.8}}}% + \else + \def\@tempa{{\NRC@sepcaption{0.7}}}% + \fi + \expandafter\@dblarg\@tempa +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NRC@sepcaption} +% Syntax: \cs{NRC@sepcaption}\marg{fraction of width}\oarg{caption opt}% +% \marg{caption} +% +% Orchestrate \cs{sepcaption} +% \begin{macrocode} +\def\NRC@sepcaption#1[#2]#3{% + \setlength{\captionwidth}{#1\columnwidth}% + \topcaption[#1]{#2}% + \vrule \@depth.5\p@ \@height.5\p@ \@width\hsize +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@fptop} +% \begin{macro}{\@dblfptop} +% +% We set these two to prevent floats from dribbling down float pages +% \begin{macrocode} +\setlength\@fptop{\z@} +\setlength\@dblfptop{\z@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsection{The bibliography} +% +% \begin{environment}{thebibliography} +% \begin{macro}{\thebibliography} +% \begin{macro}{\NRC@thebibliography} +% \begin{macro}{\NRC@thebib@brace} +% \begin{macro}{\NRC@thebib@nobrace} +% \begin{macro}{\endthebibliography} +% \begin{macro}{\NRC@bibitem} +% Syntax: \cs{begin}|{thebibliography}|\marg{widest label} +% +% \noindent\phantom{Syntax: }\cs{begin}|{thebibliography}| (in the +% presence of the |nonumbib| class option) +% +% First, the bibliography environment, which we repeat, patched in a +% minor way, from \textsf{article.cls} (we suppress the open +% bibliography switch) +% \begin{macrocode} +\ifNRC@numbib +\renewenvironment{thebibliography}[1]{% + \section*{\refname}% + \smalll + \list{\@biblabel{\@arabic\c@enumiv}}% + {% + \settowidth\labelwidth{#1.}% + \leftmargin 1.5pc + \labelsep \leftmargin + \advance\labelsep -\labelwidth + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv} + }% + \sloppy +% \NRC@sectragged + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000 +% \itemsep\z@ +% \itemsep\z@ \@plus\p@ + \parsep\z@ + \parskip\z@ +}{% + \def\@noitemerr{% + \@latex@warning{Empty `thebibliography' environment}% + }% + \endlist +} +% \end{macrocode} +% +% If we're not numbering bibliography items, we need to be careful in +% a number of areas. First, we make the ``label width'' argument to +% the environment (sort of) optional. Second, if (as is usually the +% case) there's no citation name, we generate a spurious one so as to +% avoid masses of ``repeated label'' error messages. +% +% Note we define the environment as two commands, as the tricks with +% the ``optional'' argument might come unstuck otherwise; of course, +% \cs{endthebibliography} can't be defined with \cs{newcommand}\dots +% \begin{macrocode} +\else +\renewcommand{\thebibliography}{% + \futurelet\reserved@a\NRC@thebibliography +} +\newcommand{\NRC@thebibliography}{% + \ifx\reserved@a\bgroup + \expandafter\NRC@thebib@brace + \else + \expandafter\NRC@thebib@nobrace + \fi +} +\newcommand{\NRC@thebib@brace}[1]{% + \NRC@thebib@nobrace +} +\newcommand{\NRC@thebib@nobrace}{% + \section*{\refname}% + \smalll + \list{}% + {% + \let\bibitem\NRC@bibitem + \leftmargin 10\p@ + \labelwidth \z@ + \labelsep \z@ + \itemindent -\leftmargin + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv} + }% + \sloppy +% \NRC@sectragged + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000 +% \itemsep\z@ +% \itemsep\z@ \@plus\p@ + \parsep\z@ + \parskip\z@ +} +\def\endthebibliography{% + \def\@noitemerr{% + \@latex@warning{Empty `thebibliography' environment}% + }% + \endlist +} +\newcommand{\NRC@bibitem}[2][\the\value{\@listctr}]{% + \item + \if@filesw + \def\@tempa{#2}% + \ifx\@tempa\@empty + \edef\@tempa{bibitem\the\value{\@listctr}}% + \fi + \immediate\write\@auxout{% + \string\bibcite{\@tempa}{#1}% + }% + \fi + \ignorespaces +} +\fi +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{environment} +% +% \begin{macro}{\@biblabel} +% The label for a |\bibitem[...]| command is produced by this +% macro. This version marginally modifies that defined in the \LaTeX{} +% kernel. +% \begin{macrocode} +\renewcommand*{\@biblabel}[1]{\hb@xt@\labelwidth{\hfill#1.}} +% +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%<*nrc1cls|nrc2cls|balance> +\endinput +% +% \end{macrocode} +% +% \Finale +% +% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} diff --git a/macros/latex/contrib/nrc/nrc.ins b/macros/latex/contrib/nrc/nrc.ins new file mode 100644 index 0000000000..dba1dd4217 --- /dev/null +++ b/macros/latex/contrib/nrc/nrc.ins @@ -0,0 +1,42 @@ +\def\batchfile{nrc.ins} +\input docstrip.tex + +\keepsilent + +\preamble + +Copyright Her Majesty the Queen in Right of Canada (1999-2002) + as represented by the Minister responsible for + the National Research Council of Canada. + +This file is part of the NRC macros package. +-------------------------------------------- + +This is a generated file. Do not distribute this file; rather, +distribute the sources from which it was generated. + + +\endpreamble +\askforoverwritefalse +\generate{\file{nrc1.cls}{\from{nrc.dtx}{nrc1,authors,nrc1cls}} + \file{nrc1.sty}{\from{nrc.dtx}{nrc1,authors,nrc1sty}} + \file{nrc2.cls}{\from{nrc.dtx}{nrc2,authors,nrc2cls}} + \file{nrc2.sty}{\from{nrc.dtx}{nrc2,authors,nrc2sty}}} + +\keepsilent + + +\ifToplevel{ +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space All *.sty and all *.cls} +\Msg{*} +\Msg{* Recommended TDS directory: tex/latex/nrc} +\Msg{*} +\Msg{***********************************************************} +} + +\endinput diff --git a/macros/latex/contrib/nrc/userguide.pdf b/macros/latex/contrib/nrc/userguide.pdf new file mode 100644 index 0000000000..d40e37e905 Binary files /dev/null and b/macros/latex/contrib/nrc/userguide.pdf differ diff --git a/macros/latex/contrib/nrc/userguide.tex b/macros/latex/contrib/nrc/userguide.tex new file mode 100644 index 0000000000..55d4196e2a --- /dev/null +++ b/macros/latex/contrib/nrc/userguide.tex @@ -0,0 +1,2399 @@ +\begin{filecontents}{nrcdoc.sty} + +\ProvidesPackage{nrcdoc}[2002/03/14 v2.3 collection of commands for + NRC documentation] +% +\newcommand\checkNRCDOCdate[1]{\@ifl@ter{sty}{nrcdoc}{#1}% + {}% + {\ClassWarningNoLine{nrcdoc}{An old version of nrcdoc.sty has been detected% + \MessageBreak % + Please *delete* nrcdoc.sty, to allow LaTeX to + \MessageBreak generate a new version}}% +} + +% converted to a 2e package, rf 1998/04/05 +% also added \Status and provision for dealing with pdf output +% +% usage: +% "\def\Status{} \input " +% +% for example: +% pdflatex "\def\Status{1} \input user_guide" +% +% (that's un*x syntax, but the intent is (i hope) plain +\providecommand{\Status}{0} +\ifcase\Status + % default case (0): using ordinary latex + \PackageInfo{nrcdoc}{Regular LaTeX run} + \def\href#1#2{#2} +\or + % case 1: using pdflatex to generate a copy of the file + \PackageInfo{nrcdoc}{Generating hypertext pdf output} + \RequirePackage[pdftex]{hyperref} +\fi + +\RequirePackage{url} +\newcommand{\email}{\begingroup \urlstyle{tt}\Url} +% +\def\EmailURL#1{\href{mailto:#1}{\email{#1}}} +\def\ctanaddr#1{\href{ftp://ctan.tug.org/tex-archive/#1}{\path{#1}}} + + +\def\ps@myheadings{\let\@mkboth\@gobbletwo + \def\@oddhead{{\sl\rightmark}\hfil \rm\thepage}% + \def\@oddfoot{Nov. 2002\hfill}% + \def\@evenhead{\rm \thepage\hfil\sl\leftmark}% + \def\@evenfoot{Oct. 2002\hfill}% + \def\sectionmark##1{}\def\subsectionmark##1{}} + +\pagestyle{myheadings} + +\markboth{{\rm NRC:} \LaTeX{} User Guide for Journals} + {{\rm NRC:} \LaTeX{} User Guide for Journals} + + +%% Dimensions: + +%% CT> to get holes at left without touching text, changed +%% a. margins from -3.5pc to -2pc +%% b. textheight from 23cm to 24cm +%% CT> 28 SEP 00: makes no sense to use these margins for the version +%% to be posted on CTAN. Dimens now revert to original +%% value of -3.5pc for left/rightmargins. The +%% textheight, however, will remain at 24cm. +%% +\setlength{\textwidth}{19cm} +\setlength{\textheight}{24cm} +\setlength{\oddsidemargin}{-3.5pc} +\setlength{\evensidemargin}{-3.5pc} +\setlength{\headsep}{12pt} +\setlength{\topmargin}{-3.5pc} +\setlength{\columnsep}{1.5pc} + + +%% Something Robin doesn't like but it's handy for tables: + +%% Spacing commands for {tabular} (from TTN 2,3:10 -- Claudio +%% Beccari): + +\newcommand\T{\rule{0pt}{2.6ex}} % = `top' strut +\newcommand\B{\rule[-1.2ex]{0pt}{0pt}} % = `bottom' strut + + +%% Fonts: + +\font\bfsl=cmssi17 +\font\sectiontt=cmtt12 scaled\magstep1 +\font\stt=cmtt10 scaled 850 + + +%% Macros: + +\newcommand{\NRC}{{\small NRC}} +\newcommand{\blash}{{\stt\char'134}} + +\newcommand{\creditline}{{\footnotesize + Carleton Production Centre (9/00)}} + +%% def'n for \LaTeXe taken from TUGboat's tugboat.cmn file: +\newcount\TestCount \newbox\TestBox +\def\La{\TestCount=\the\fam \leavevmode L% + \setbox\TestBox=\hbox{$\fam\TestCount\scriptstyle A$}% + \kern-.5\wd\TestBox\raise.42ex\box\TestBox} +\def\LaTeX{\La\kern-.15em\TeX} +\def\LaTeXe{\LaTeX{}\kern.05em2$_{\textstyle\varepsilon}$} + + +%% \let-statements: + +\let\en=\enspace +\let\nl=\newline + +\end{filecontents} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass{article} +\usepackage{nrcdoc} + +% check we're running against a copy of nrcdoc.sty generated from this +% copy of userguide.tex. first we check that we're running against +% something that's modern enough to have the command for checking +% +\expandafter\ifx\csname checkNRCDOCdate\endcsname\relax + \typeout{*** An old version of nrcdoc.sty has been detected} + \typeout{*** Please *delete* nrcdoc.sty to allow LaTeX to generate a + new version} +\else +% +% we are using a recent enough version: use the checking command to +% compare with the date in the \ProvidePackage command in the package; +% the date here *must* be updated, in the standard latex format, in +% parallel with the date in the package. +% + \checkNRCDOCdate{2001/11/15} +\fi + +\begin{document} + +%% Titleblock: +\twocolumn[ +\begin{center} + \bfsl National Research Council \\ + \vspace{.75pc} + Research Press \\ + \vspace{.5pc} + \Large\bf \LaTeX{} User Guide for Journals\footnotemark +\end{center} + +\vspace{1pc} + +] + +\footnotetext{This document is available from your local CTAN site in + \texttt{macros/latex/contrib/supported/nrc/} in both \texttt{.ps} + and \texttt{.pdf} formats.} + + +%% Section 1: +\section{Basic coding} + +All \LaTeX{} documents must include these three commands: + +\begin{verbatim} + \documentclass{...} + ... <-- `preamble' + \begin{document} + ... <-- `body' + ... + \end{document} +\end{verbatim} + +\begin{enumerate} \itemsep=0pt + \item The \verb|documentclass| must be specified, either with a + generic package, such as \verb|article| or a specific + package, such as \verb|nrc1|). + + \item Between the first two commands comes the material known as + the `preamble', which includes additional packages (and their + options), as well as any file-specific macros. + + \item Between the 2nd and 3rd commands comes the actual contents of + the article --- known as the `body' of the file. +\end{enumerate} + +\noindent Commands are usually of the following types: + +\begin{enumerate} \itemsep=0pt + \item {\bf control sequences} begin with a backslash ( \blash\ ). + + \item {\bf environments} use matching \verb|\begin{...}| and\break + \verb|\end{...}| commands (i.e., \verb|\begin{document}| must + eventually be matched with \verb|\end{document}|). + + \item {\bf optional} arguments are within square brackets \verb|[...]| +\end{enumerate} + + +%% Section 2: +\section{Document classes and options} + +\NRC{} journals are set either in full-width, using the \texttt{nrc1} +class, or in 2-column format, using the \texttt{nrc2} document class. + +The following represent the options for both document classes. Note +that most articles will {\bf not} require all of them; as well, some +options are only for \texttt{nrc2}. + +\begin{verbatim} + \documentclass[]{} + author nrc1 + PLUS usecmfonts OR nrc2 + OR type1rest + french + nonumbib + nrc1 only: leqno + nrc2 only: reqno + +\end{verbatim} + +\newpage + +\noindent To combine options, insert a comma between each option: + +\begin{verbatim} + \documentclass[type1rest,genTeX,nonumbib]{nrc2} +\end{verbatim} + +The following sections describe the options available to both classes, +and then those options which are specific to \texttt{nrc1} or +\texttt{nrc2} only. Options specific to in-house production work are +described separately; see section~\ref{inhouse}. + + +%% Section 2.1: +\subsection{Options for both classes} + +{\bf Note:} Do not load options or packages which are never accessed; +their presence implies they are required and may cause unnecessary +searches for coded material which is not, in fact, present. + +For the convenience of authors, the publicly available class files for +authors have a number of options already automated: +% + \begin{verbatim} + author,genTeX,type1rest,usecmfonts + \end{verbatim} +% +Additionally, a number of in-house diagnostic messages are turned off, +so as not to interfere with processing. Where a default selection is +not appropriate, the following provides information on these options. + + +\begin{description} \itemsep=0pt + \item [\texttt{author}] + This option selects a configuration appropriate for author use + of the class; it is enabled by default when a + publicly distributed copy of the class is loaded. + + The \texttt{author} option automatically invokes the + \texttt{genTeX} option, as well as one of the two font + options: \texttt{type1rest} or \texttt{usecmfonts}. See below + for details. + + + \item [{\tt genTeX}] + + By use of this option, you declare that you are using a + generic/public domain version of \TeX{}; it {\bf must} be + used in conjunction with one of \texttt{usecmfonts} and + \texttt{type1rest} (see below). + + The \texttt{author} option automatically selects the + \texttt{genTeX} option. + + + \item [{\tt type1rest}] + + By use of this option, you declare that you have access to a + PostScript printer or other interpreter, and may use ``basic'' + PostScript fonts to make a rough approximation to those that + will be used in the published paper. Do not use this option in + combination with the \texttt{usecmfonts} option. + + If the \texttt{author} option has been selected, the class + will automatically decide whether to use \texttt{usecmfonts} + or \texttt{type1rest} by default. The automatic selection may + be incorrect, but you may over-ride it by specifying the + \texttt{type1rest} option. + + + \item [{\tt usecmfonts}] + + By use of this option, you declare that you do not have the + ``basic'' PostScript fonts to make a rough approximation to + those that will be used in the published paper: the \verb|cm| + (\emph{Computer Modern}) fonts that this option selects are + available in any generic/public domain \TeX{} distribution, so + this option will always be available. Do not use this option + in combination with the \texttt{type1rest} option. + + If the \texttt{author} option has been selected, the class + will automatically decide whether to use \texttt{usecmfonts} + or \texttt{type1rest} by default. The automatic selection may + be incorrect, but you may over-ride it by specifying the + \texttt{usecmfonts} option. + + + \item [{\tt french}] + + For French-language articles.\label{frenchclassoption} It + configures the \NRC{} document classes to print all the + auto\-mated textual ele\-ments (in the author IDbox, for + figures, tables, biblio\-graphies, etc.)\ in French as per + \NRC{} speci\-fi\-cations. To be used in concert with: + +\begin{verbatim} + \usepackage[english,french]{babel} +\end{verbatim} + + See section~\ref{babelinfo} for details on using the + \textsf{babel} package in all articles, regardless of + language. For two-column bilingual texts, see + section~\ref{bilingpream}. + + + \item [{\tt nonumbib}] + + This option removes numbers (i.e., `labels') from + \verb|\bibitem| entries; material is set with a hanging + indent. The default is to have numbered bibliographic + entries. +\end{description} + + +%% Section 2.2: +\subsection{Options specific to only one class} + +\begin{description} \itemsep=0pt + \item [{\tt leqno}] \hfill for \texttt{nrc1} only + + This option puts equation numbers to the left margin; + default is to have them on the right. + + \item [{\tt reqno}] \hfill for \texttt{nrc2} only + + This option puts equation numbers to the right margin; + default is to have them on the left. +\end{description} + +\noindent One other difference between the packages relates to the +position of the \verb|\maketitle| command. See +page~\pageref{maketitle} for details. + + +%% Section 3: +\section{The preamble} + +The preamble area of the file should specify all packages and macros +definitions (if any) used; macros in particular should not be defined +within the body of the file. + + +%% Section 3.1: +\subsection{Useful packages} + +The following packages and their options are often necessary (but note +that \textsf{babel} is necessary at all times). Note that package +order can be significant, on occasion. In particular, it is +recommended that graphics packages be loaded immediately after the +document class. + +\begin{description} \itemsep=0pt + \item [{\tt \blash usepackage\char`\{graphicx\char`\}}] + + Graphics (figures, illustrations,\break and so on) should be + included using the standard \LaTeX{} \texttt{graphicx} + package: use of this package permits portability across + different implementations of \TeX{} (which itself has no + graphics primitive commands). + + Your \TeX/\LaTeX{} system may offer documentation; otherwise + see \textsl{The \LaTeX{} Graphics Companion\/} (see + section~\ref{documentation}). + + Remember to specify the printer driver as a package option, + if necessary (e.g., \verb|dvips|, \verb|dvipsone|, etc.). + + \item [{\tt \blash usepackage[figuresright]\char`\{rotating\char`\}}] + + \quad The \verb|rotating|\break package\footnote{For the + NRC's production use, the standard distribution version of + this file is currently under revision. Authors can proceed + with the public version of \texttt{rotating.sty}.} is only + required when tables or figures need to be placed in + landscape (`sideways') position. It must be preceded by the + \verb|graphicx| package. + + The \verb|figuresright| option ensures that rotated + elements are oriented with the caption at the left margin of + the regular page, in accord with \NRC{} style requirements. + + \item [{\tt \blash usepackage\char`\{amsmath\char`\}}] + + A great deal of additional functionality is provided with + this package, and the \NRC{} document classes have been + designed to work smoothly with it. Using \texttt{amsmath} + automatically loads the following packages: \texttt{amstext}, + \texttt{amsgen}, and \texttt{amsbsy}. The \texttt{amsmath} + package is described in great detail in three documents: + + \begin{enumerate} \itemsep=0pt + \item The revised version of chap.~8 of {\sl The \LaTeX{} + Companion} is a good guide (see section~\ref{documentation} + for details). As printed in the book, chap.~8 is out of + date and should not be referenced. + + \item A useful set of documentation is available via the {\small + AMS}'s web site. {\small URL} + % \texttt text broken so it doesn't run into the margin and + % disappear; would be better to use the url package, but... + \texttt{http://www.ams.org/tex/ amslatex.html} offers a + ``Short Math Guide'', a set of frequently asked questions + (with answers), as well as various ``Readme'' files. + + \item Current \LaTeX{} installations have a file + \texttt{amsldoc}; it is also available via the {\small + AMS} web site (see above). The material is essentially the + same as the revised chap.~8 mentioned above, but the + differences in presentation are sometimes useful to + consider. +\end{enumerate} + + \item [{\tt \blash usepackage\char`\{amssymb\char`\}}] + + This package automatically loads the + \texttt{amsfonts} package. Together, they provide + special characters and symbols frequently used by the + mathematics and scientific communities. + + The \texttt{amsfonts} package provides access to the + following font sets: Euler (Fraktur, Roman, Script, + extensions); Computer Modern (math bold ital\-ic, symbol, + extensions, in the smaller sizes); Cyrillic (lightfact, bold, + italic, smallcaps); and the \texttt{msam} and \texttt{msbm} + fonts, familiar to Rev\TeX{} users. + + + \item [{\tt \blash usepackage\char`\{bm\char`\}}] + + This package simplifies the use of bold symbols and other + objects in math mode. It defines a single command, + \verb|\bm{...}|, which is used in math mode, and causes its + argument to be typeset in the appropriate math bold font. + See \verb|bm.sty| documentation for details.\label{bm} + + {\bf Note:} If a warning message about too many math + alphabets arises, insert the following code {\bf above} the + \verb|\usepackage{bm}| line: + +\begin{verbatim} + \newcommand\hmmax{0} % default 3 + \usepackage{bm} +\end{verbatim} +% + See \verb|bm.sty| documentation for details. + + + \item [{\tt \blash usepackage\char`\{cite\char`\}}] + + Authors should use this package, which enhances the default + options available in \LaTeX{} (e.g., \verb|\citen| prints + cross-references without brackets). See \verb|cite.sty| + documentation for additional features. + + \item [{\tt \blash usepackage[...,...]\char`\{babel\char`\}}] + + The \textsf{babel}\label{babelinfo} package is used to manage + the typesetting requirements of multilingual documents. + Different cultures have different typesetting conventions, + and \textsf{babel} enables the \LaTeX{} user to apply the + appropriate conventions to the different parts of a + multilingual document. Since \NRC{} publications are + typically multilingual, \textsf{babel} has an important + r\^ole to play in their preparation. + + \begin{itemize} \itemsep=0pt + \item English-language articles have a French-language + `Resum\'e', which requires French hyphenation and + punctuation. Insert the following line --- and notice the + order of the language options: + +\begin{verbatim} + \usepackage[french,english]{babel} +\end{verbatim} + + \item French-language articles have an English-language + `Abstract', which requires English hyphenation and + punctuation. Insert the following line and again notice + the order of the language + options:\footnote{\textsf{Babel}, like so many computer + programs, believes that the last should be first, and + therefore proceeds backwards through its options, thus + making the last one typed the one selected first.} + +\begin{verbatim} + \usepackage[english,french]{babel} +\end{verbatim} + + \textbf{In addition to} the \textsf{babel} package, + French-language articles must \textbf{also} include the + \verb|french| option to the document class, as mentioned + earlier in section~\ref{frenchclassoption}. + + The \textsf{babel} package invokes French hyphenation + patterns\footnote{Use \texttt{\blash-} to signal additional + potential hyphenation points.} as well as some of the + (European) French typesetting conventions (e.g., space before + some punctuation). + \end{itemize} +\end{description} + +\noindent These packages and others can be found either on your +machine or can be acquired from {\small CTAN}, the Comprehensive +\TeX{} Archive Network; use the search facilities at +\url{www.ctan.org/search}. The \NRC{} document classes and this +documentation can be found on {\small CTAN} in +\url{macros/latex/contrib/supported/nrc/}. + + +%% Section 3.2: +\subsection{Additional macros} + +\begin{enumerate} \itemsep=0pt + \item Avoid creating too many personal macros, which may conflict + with the \NRC{} document classes (and possibly with other + packages) and thereby slow in-house processing of files. + Where these are used, macros not actively invoked in the + file should be pruned out. + + \item Whenever possible, define your macros using the \LaTeX{} + \verb|\newcommand| mechanism, rather than the \TeX{} primitive + \verb|\def|; this way, \LaTeX{} itself will detect any name + clashes you may innocently introduce. + + \item Move all non-\NRC{} preamble material, including author + macros, to the end of the file (after \verb|\end{document}|), + rather than deleting it. Reintroduce only what is needed. + + \item Where author macros are needed, they should all be gathered + at the top of the file in the preamble area, after all + packages have been loaded, and clearly marked as being author + macros:\label{authmacros} + +\begin{verbatim} +%%%%%%%% Author macros begin: +... +... +%%%%%%%% Author macros end +\end{verbatim} + + \item Similarly, move all \verb|\let| statements to the preamble + area, where they are immediately visible to the editor. +\end{enumerate} + + +%% Section 4: +\section{The body} + +All articles have the following elements: + +\begin{enumerate} \itemsep=0pt + \item titleblock and author information + + \item abstract and resum\'e + + \item headings and subheadings + + \item text + + \item bibliography +\end{enumerate} + +\noindent Most articles also include some or all of the following +elements: + +\begin{enumerate} \itemsep=0pt + \item in-line and display mathematics + + \item enumerated lists + + \item tables + + \item figures and illustrations (e.g., PostScript) + + \item footnotes + + \item offset quoted passages + + \item acknowledgements +\end{enumerate} + + +%% Section 4.1: +\subsection{Titleblock and author information} + +All elements of the titleblock are taken care of via macros, some of +which have optional arguments, to allow for variant forms and for +`labelling' of bits of text (for cross-referencing). + +\begin{description} \itemsep=0pt + \item [{\tt \blash title\char`\{...\char`\}}] \mbox{} + + Lines will be broken automatically; line breaks can be forced + by using \verb|\\|. + + For sub- and superscripts, use \verb|\textsubscript| and + \verb|\textsuperscript|, respectively. + + Notes on the title may be inserted using the standard \LaTeX{} + command \verb|\thanks|. The text will print in the IDbox, and + numbering will be synchronised with that of the IDbox notes. + + \item [{\tt \blash author[...]\char`\{Author1\char`\}}] \mbox{} + + {\sl Author1\/}'s name as it will appear in the titleblock + and the right running head. The optional argument allows a + different form of the author's name to appear in the IDbox at + page-bottom (e.g., full first name in titleblock, but + initials only in IDbox). + + Each author is specified separately. The document class will + automatically insert `and' (Fr.\ `et') between the last and + second-last names, both in the titleblock and in the IDbox + area. + + \item [{\tt \blash address[label1]\char`\{addr1\char`\}}] \mbox{} + + Address for {\sl Author1\/}; this should be immediately below + the \verb|\author| entry. Each author's address is specified + separately. If no address is specified before the next author + entry, the immediately preceding address is used (an address + for the first author {\bf must} therefore be specified). + + The optional \verb|[label1]| argument (any sequence of + letters can be used) does not print anything; it makes it + possible to relate one address to several authors (this is + similar to \LaTeX's \verb|\label| and \verb|\ref| commands). +\end{description} + +Below is an example of using the author-address cross-referencing +macros. Notice that \verb|\address| always refers to the immediately +preceding \verb|\author|. + +\begin{description} \itemsep=0pt + \item \verb|\author{Author1}|\quad defines first author + + \item \verb|\address[label1]{Address1}|\quad defines an address for + {\sl Author1\/} and tags it as \verb|[label1]| + + \item \verb|\author{Author2}|\quad this author doesn't have an + address, so the IDbox will use the immediately preceeding + author's address (i.e., {\sl Address1} + + \item \verb|\author{Author3}|\quad defines a third author + + \item \verb|\address{Address3}|\quad third author is at an address + of their own + + \item \verb|\author{Author4}|\quad defines a fourth author + + \item \verb|\address[label1]|\quad fourth author uses the address + associated with \verb|[label1]|, above + + The net result (assuming the \verb|breakaddress| option has + been used) is the following: + + {\bf Author1, Author2, and Author4.} \\ + Address1. + + {\bf Author3.} \\ + Address3. + + \item [{\sl IDbox address notes}] \mbox{} + + Author addresses can be augmented with additional information + via numbered notes, which appear below all the authors' names + and main addresses. + + \begin{description} + \item [{\tt \blash correspond\char`\{...\char`\}}] \mbox{} + + Usually one author is selected from all co-authors to deal + with correspondence. Insert the author's e-mail address + into the argument. The following text will be prepended: + `Corresponding author (email: ).' and in French, + `Auteur correspondant (courriel\,: )'. + + + \item [{\tt \blash present\char`\{...\char`\}}] \mbox{} + + Authors may wish to indicate a temporary or current + address, different from the main one provided via + \verb|\address|. This note will begin with the text: + `Present address:' (Fr.\ `Adresse actuelle\,:'). + + + \item [\mbox{}{\tt \blash AddressNote\char`\{...\char`\}}] + Obsolete. See \verb|\IDnote|, below. + + + \item [{\tt \blash IDnote\char`\{...\char`\}}] \mbox{} + + Allows the user to input any information they wish, with + no automatic text being added (formerly called + \verb|\AddressNote|, which implied a more restricted + use). Both macros are available but \verb|\IDnote| gives + the user a more generic macro name to remember and use for + any type of note within the IDbox. + \end{description} + + \item [{\tt \blash dedication\char`\{...\char`\}}] \mbox{} + + Will print a dedicatory text (in italics) in the IDbox area, + between the `Received/Accepted' and the author/address + sections. + + \item [{\tt \blash abbreviations\char`\{...\char`\}}] \mbox{} + + Automatic printing of the word `\textit{Abbrevia\-tions: \/}' + (Fr. `\textit{Abbr\'eviations\,: \/}'), followed by text + input inside the argument (the curly braces). Forced line + breaks (via \verb|\\|) can be used to separate entries. + + \item [{\tt \blash shortauthor\char`\{author list\char`\}}] + \mbox{} + + Shortened list of author names for use in the right running + header. This macro must be present (its absence generates an + error message), and should appear below all the + author-address information + +\newpage + + \item [{\tt \blash maketitle}] \mbox{}\label{maketitle} + + This command activates the titleblock commands. + + The \verb|nrc1| class requires this command to appear + \textbf{before} the abstract/resum\'e block of text. + + The \verb|nrc2| class requires this command to appear + \textbf{after} the abstract/resum\'e block of text. + + \item [{\tt \blash maketitle*}] \hfill [an \NRC\ macro]\mbox{} + + With the \verb|nrc2| class only, when Abstracts/Resumes spill + over to a second page, a horizontal rule may be needed before + the regular article text begins. To generate this rule use + \verb|\maketitle*| instead of \verb|\maketitle|. +\end{description} + + +%% Section 4.2: +\subsection{Abstracts/R\'esum\'es} + +The syntax is the normal one expected for environments: a matched set +of either \verb|{abstract}| or \verb|{resume}|: + +\begin{description} \itemsep=0pt + \item [{\tt \blash begin\char`\{abstract\char`\}\ ... \blash + end\char`\{abstract\char`\}}] \hfill English + + \item [{\tt \blash begin\char`\{resume\char`\}\ ... \blash + end\char`\{resume\char`\}}] \hfill French +\end{description} + +\noindent Some journals may require the following, which should appear +\textbf{inside} the abstract environments: + +\begin{description} \itemsep=0pt + \item [{\tt \blash keywords\char`\{...\char`\}}] \hfill [an \NRC\ + macro]\mbox{} + + Automatically prints `\textit{Keywords:}', followed by + whatever text is input inside the argument (the curly + braces). + + \item [{\tt \blash motscles\char`\{...\char`\}}] \hfill [an \NRC\ + macro]\mbox{} + + Automatically prints `\textit{Mots cl\'es\,:}', followed by + whatever text is input inside the argument (the curly + braces). + + \item [{\tt \blash PACS\char`\{...\char`\}}] \hfill [an \NRC\ + macro]\mbox{} + + Automatically prints `PACS Nos.:' (Fr. `PACS + N\textsuperscript{os}\,:'), followed by whatever material is + input inside the argument. + + \item [{\tt \blash PACS*\char`\{...\char`\}}] \hfill [an \NRC\ + macro]\mbox{} + + Automatically prints `PACS No.:' (Fr. `PACS + N\textsuperscript{o}\,:'), followed by whatever material is + input inside the argument. +\end{description} + + +%% Section 4.3: +\subsection{Headings and subheadings} + +Five levels, numbered automatically.\footnote{An alternate set of +headings commands also exists: \texttt{\blash Asection}, +\texttt{\blash Bsection}, \texttt{\blash Csection}, \texttt{\blash +Dsection}, and \texttt{\blash Esection}, for levels 1 through 5, +respectively.} Line breaks can be forced by using \verb|\\|. To +suppress numbering (e.g., for `Acknowledgements'), use an asterisk +before the opening curly brace: \verb|\section*{Acknowledgements}|. + +For sub- and superscripts in section titles, use the macros +\verb|\textsubscript| and \verb|\textsuperscript|, respectively. + +\begin{enumerate} \itemsep=0pt + \item {\tt \blash section\char`\{...\char`\}} Level-1 heading + + \item {\tt \blash subsection\char`\{...\char`\}} Level-2 heading + + \item {\tt \blash subsubsection\char`\{...\char`\}} Level-3 + heading + + \item {\tt \blash subsubsubsection\char`\{...\char`\}} Level-4 + heading \hfill [\NRC] + + \item {\tt \blash paragraph\char`\{...\char`\}} Level-5 heading +\end{enumerate} + + +%% Section 4.4: +\subsection{Text} + +Same as the default \LaTeX{} commands: + +\begin{description} \itemsep=0pt + \item [{\tt \blash begin\char`\{quote\char`\}\ ... \blash + end\char`\{quote\char`\}}] + + \item [{\tt \blash begin\char`\{enumerate\char`\}\ ... \blash + end\char`\{enumerate\char`\}}] + + \item [{\tt \blash begin\char`\{itemize\char`\}\ ... \blash + end\char`\{itemize\char`\}}] + + \item [{\tt \blash begin\char`\{description\char`\}\ ... \blash + end\char`\{description\char`\}}] + + \item [{\tt \blash footnote\char`\{...\char`\}}] +\end{description} + +\noindent Where lists must be flushed to the left margin, there are +two \NRC-specific environments to use: + +\begin{description} \itemsep=0pt + \item [{\tt \blash begin\char`\{flenumerate\char`\}\ ... \blash + end\char`\{flenumerate\char`\}}]\hfill [\NRC] \mbox{} + + Generates a numbered list (first level only) with labels + flushed to the left margin. No nesting possible. + + \item [{\tt \blash begin\char`\{flitemize\char`\}\ ... \blash + end\char`\{flitemize\char`\}}]\hfill [\NRC] \mbox{} + + Generates a bulletted list (first level only) with labels + flushed to the left margin. No nesting possible. +\end{description} + + +%% Section 4.4.1: +\subsubsection{Column switching in \texttt{nrc2}} + +On occasion, material for 2-column journals is best set full-width, +interrupting the two text columns. For equations, the following +customized code will achieve this effect: + +\begin{verbatim} + \begin{FullWidth}[0.5] + \LeftColumnBar + + \RightColumnBar + \end{FullWidth} +\end{verbatim} + +The following description provides details of each step: + +\begin{description} \itemsep=0pt + \item [{\tt \blash begin\char`\{FullWidth\char`\}\ ... \blash + end\char`\{FullWidth\char`\}}] + + This environment encloses the material which is to span the + two columns. The text for the two columns immediately above + this environment will be balanced. Text immediately below + the environment will resume the 2-column layout. + + The optional \texttt{[0.5]} argument (`one half' in this + example) is an adjustment factor, affecting the split between + left and right columns. Default is `1.0', the units are + nominal line depths in the default font size; increasing the + factor tends to increase the number of lines in the left + column. + + \item [{\tt \blash LeftColumnBar}] \mbox{} + + This draws a rule below the left column of the 2-column text + which is above the full-width material. + + \item [{\tt \blash RightColumnBar}] \mbox{} + + This draws a rule above the right column of 2-column text + which is below the full-width material. + + \item [{\tt \blash BalanceColumns[0.5]}] \mbox{} + + This command is used at the end of a file, in order to + balance the final page. + + The optional argument serves the same purpose and is used + in the same way as that for \verb|\begin{FullWidth}|. +\end{description} + +Where both equations and text must span two columns, the text portions +must \textit{additionally} be enclosed in the following environment: + +\begin{verbatim} + ... + \begin{WideText} + + \end{WideText} + ... +\end{verbatim} +% +The text will then be flush left, and indented 3em from the right +margin, as per \NRC{} requirements, while the equation numbers will be +flushed to the right (where that is the style). The two combined will +look like this: + +\begin{verbatim} + \begin{FullWidth}[0] + \LeftColumnBar + \begin{equation} + + \end{equation} + + \begin{WideText} + + \end{WideText} + + \begin{equation} + + \end{equation} + \RightColumnBar + \end{FullWidth} +\end{verbatim} + + +%% Section 4.5: +\subsection{Mathematics} + +In addition to default \LaTeX{} commands, the \texttt{amsmath} package +provides a number of useful enhancements. Consult both the revised +chap.~8 of \textsl{The \LaTeX{} Companion} and the AMS\LaTeX{} +documentation for details (see section~\ref{documentation}). See also +\verb|bm.sty| for enhanced font handling inside math mode +(section~\ref{bm}). + +\begin{description} \itemsep=0pt + \item [{\tt \blash begin\char`\{equation\char`\}\ ... \blash + end\char`\{equation\char`\}}] \mbox{} + + \item [{\tt \blash begin\char`\{array\char`\}\ ... \blash + end\char`\{array\char`\}}] \mbox{} + + \item [{\tt \blash begin\char`\{subequation\char`\}\ ... \blash + end\char`\{subequation\char`\}}] \mbox{} + + This is an \verb|amsmath| environment {\bf within which} + other environments are used, to achieve lettered sub-equation + numbers: e.g., 1.2a, 1.2b, etc. There is a file + \texttt{subeqn.tex} on most \TeX{} installations with + additional details. +\end{description} + +\noindent In addition to the usual environments, two \NRC\ macros +allow further customisation of the form of the equation number: + +\begin{description} \itemsep=0pt + \item [{\tt \blash + numberby\char`\{...\char`\}\char`\{...\char`\}}] \hfill [an + \NRC\ macro]\mbox{} + + For articles where equation numbers must include section + numbers (e.g., equation 3.2 is the second equation in + section~3), input the following in the preamble area, after + all \verb|\usepackage| commands:\footnote{This avoids having + to load the {\tt amsmath} package in order to access the {\tt + \blash numberwithin} command, which does the same thing.} + +\begin{verbatim} + \numberby{equation}{section} +\end{verbatim} + + The first argument contains what element is being numbered; + the second indicates that section numbers should be included + in that numbering. + + \item [{\tt \blash eqnoformat}] \hfill [an \NRC\ macro]\mbox{} + + The \verb|nrc2| class default format is for square brackets + around equation numbers. Other options (i.e., parenthe\-ses) + can be achieved via the following definition (placed in the + preamble, after all packages have been loaded): + +\begin{verbatim} + \renewcommand{\eqnoformat}[1]{(#1)} +\end{verbatim} +\end{description} + + +%% Section 4.6: +\subsection{Tables, Figures, Captions} + +The following float parameters are useful to include in the preamble +area: + +\begin{description} \itemsep=0pt + \item [nrc1] +\begin{verbatim} + \renewcommand{\topfraction}{.95} + \renewcommand{\textfraction}{.05} + \renewcommand{\floatpagefraction}{.95} +\end{verbatim} + + \item [nrc2] +\begin{verbatim} + \renewcommand{\topfraction}{.95} + \renewcommand{\floatpagefraction}{.95} + \renewcommand{\dbltopfraction}{.95} + \renewcommand{\textfraction}{.05} + \renewcommand{\dblfloatpagefraction}{.95} +\end{verbatim} +\end{description} + + +%% Section 4.6.1: +\subsubsection{Tables} + +\begin{description} \itemsep=0pt + \item [{\tt \blash begin\char`\{table\char`\}\ ... \blash + end\char`\{table\char`\}}] \mbox{} + + For regular tables, up to same width as text (page-wide or + column-wide). + + \item [{\tt \blash begin\char`\{table*\char`\}\ ... \blash + end\char`\{table*\char`\}}] \mbox{} + + For tables spanning two columns. + + \item [{\tt \blash begin\char`\{sidewaystable\char`\}\ ... \blash + end\char`\{sidewaystable\char`\}}] \mbox{} + + For rotating a table sideways. To ensure rotation is in + correct direction, remember to add the \verb|figuresright| + option to the \verb|rotating| package in the Preamble. + + \item [{\tt \blash begin\char`\{sidewaystable*\char`\}\ ... \blash + end\char`\{sidewaystable*\char`\}}] \mbox{} + + For rotating a table sideways across a 2-column page. As for + above, make sure the \verb|figuresright| option has been + added to the \verb|rotating| package, loaded in the Preamble. + + \item [{\tt \blash begin\char`\{tabular\char`\}\ ... \blash + end\char`\{tabular\char`\}}] \mbox{} + + {\bf Note:} use \verb|\tabcolsep| to slightly reduce/increase + intercolumn space. + + + \item [{\tt \blash hline*}]\hfill [an \NRC\ macro] \mbox{} + + For the thicker lines at top/bottom of tables. Regular 1pt + rules accessed via default \verb|\hline| command. +\end{description} + + +%% Section 4.6.2: +\subsubsection{Figures} + +\begin{description} \itemsep=0pt + \item [{\tt \blash begin\char`\{figure\char`\}\ ... \blash + end\char`\{figure\char`\}}] \mbox{} + + For regular figures, up to same width as text (page-wide or + column-wide). + + \item [{\tt \blash begin\char`\{figure*\char`\}\ ... \blash + end\char`\{figure*\char`\}}] \mbox{} + + For figures spanning two columns. +\end{description} + + +%% Section 4.6.3: +\subsubsection{Captions} + +\begin{description} \itemsep=0pt + \item [{\tt \blash topcaption\char`\{...\char`\}}] \hfill [an + \NRC\ macro]\mbox{} + + \NRC\ style has all captions at the top of their table or + figure. Syntax is the same as for \LaTeX{} default + \verb|\caption|. + + Captions will be automatically sized to the width of their + table, provided the file is processed at least twice. Should + a caption require a different width, the following code, used + inside the float environment, will work: + +\begin{verbatim} + \setlength{\captionwidth}{ ... } + \topcaption{ ... } +\end{verbatim} + + \item [{\tt \blash sepcaption\char`\{...\char`\}}] \hfill [an \NRC\ + macro]\mbox{} + + For captions separated from their full-column or full-page + tables and figures. Caption will appear at top of next column + or next page. Usage is \textbf{different} from regular + caption commands in that it must appear in its own separate + \texttt{table} environment: +% +\begin{verbatim} + \begin{table} + \sepcaption{.....} + \end{table} + + \begin{table} + + \end{table} +\end{verbatim} +\end{description} + + +%% Section 4.6.4: +\subsubsection{Centering} + +To centre any of these elements inside a float, the \verb|\centering| +command is preferred to the \verb|{center}| environment, which adds +its own vertical space and hence interferes with \NRC{} spacing +requirements. + + +%% Section 4.7: +\subsection{Cross-Referencing} + +As with all cross-referencing codes, process file 2 or even 3 times, +to ensure that all citations and labels have been resolved, until the +following message no longer appears:\footnote{Note, however, that if +cross-referencing codes are incomplete, \textbf{[?]} will remain. In +such cases, the warning message reads: \texttt{LaTeX Warning: There +were undefined references}.} + +\begin{verbatim} + LaTeX Warning: Label(s) may have changed. + Rerun to get cross-references right. +\end{verbatim} + +\noindent Components of an article affected by cross-referencing --- +and thus requiring several processing runs, include the following: + +\begin{itemize} \itemsep=0pt + \item cross-refs to tables and figures, and to equations, etc. \\ + (via \verb|\ref|, \verb|\pageref|, and \verb|\label|) + + \item automatic sizing of caption widths for floats \\ + (via \verb|\topcaption|) + + \item bibliographies \\ + (via \verb|\cite| et al., and \verb|\bibitem|) +\end{itemize} + +To ensure that cross-referencing via the \verb|\label| and \verb|\ref| +commands is correctly associated with the matching tables and figures, +it is recommended that the \verb|\label| command appear +\textbf{inside} the closing parentheses of caption commands. + + +%% Section 4.8: +\subsection{Bibliography} + +The default macros \verb|\cite| and \verb|\bibitem| are usually +adequate for citations and bibliography entries. Additional +flexibility can be had by using the \verb|cite| package; for more +complicated requirements, authors may choose to use the \verb|natbib| +package. Authors using the latter must remember to submit their +\verb|.bib| file, and are reminded to use the referencing style and +order of elements appropriate to the journal to which they are +submitting.\footnote{As yet, there is no \texttt{nrc.bst} file for the +NRC.} + +The main \verb|cite| commands are: + +\begin{description} \itemsep=0pt + \item [{\tt \blash cite\char`\{...\char`\}}] \mbox{} + + To produce cross-referencing digit or digits inside square + brackets. + + \item [{\tt \blash citen\char`\{...\char`\}}] \mbox{} + + To produce cross-referencing digit with {\bf no} brackets. +\end{description} + +\noindent Further options are described in the \verb|cite| +documentation. However, one in particular will be noted here, as some +\NRC{} journals require in-line citations to appear within +parentheses, rather than square brackets. If this is the case, the +following code should be added to the preamble (after all packages, +including \verb|cite|, have been loaded): + +\begin{verbatim} + \renewcommand{\citeleft}{(} + \renewcommand{\citeright}{)} +\end{verbatim} + +The references/bibliography section at the end of the paper uses the +default \LaTeX{} commands: + +\begin{verbatim} + \begin{thebibliography}{99} + \bibitem[...]{...} + + \bibitem[...]{...} + + \end{thebibliography} +\end{verbatim} + + +%% Section 4.9: +\subsection{Appendices} + +Where only the word `Appendix' is needed, use the command +\verb|\section*{Appendix}| (note that the asterisk suppresses any +section numbering, either by digit or letter). If equations within the +Appendix are to restart at `1', insert + +\begin{verbatim} + \setcounter{equation}{0} +\end{verbatim} + +If more than the word `Appendix' is to appear, then the +\verb|\section| command must be augmented by either \verb|\appendix| +or \verb|\appendix*|. + +The \verb|\appendix| command (unmodified) behaves as in the standard +\LaTeX{} classes; so, for `A. Title of First Appendix', the following +code is used: +% +\begin{verbatim} + \appendix + \section{Title of First Appendix} +\end{verbatim} + +For `Appendix A:' + a heading (and then `Appendix B:' + its heading, +etc.), the following code will do the job (notice that the word +`Appendix' is \textbf{not} input): + +\begin{verbatim} + \appendix* + \section{A subheading} + ... + \section{Next subheading} +\end{verbatim} + +Both \verb|\appendix| and \verb|\appendix*| preserve \verb|\numberby| +commands, as one might expect: equations in appendix~A are numbered +`A.1', `A.2', etc. To ensure numbering is correctly applied throughout +all appendices, insert \verb|\numberby| {\bf before} the +\verb|\section| command. + + +%% Section 5: +\section{Resources} + +The following documentation, newsgroups, and web pages are useful +source to consult for help, news, and updates. Keep in mind, however, +that conflicts may arise when + + +%% Section 5.1 +\subsection{Books and articles\label{documentation}} + +\begin{description} \itemsep=0pt \raggedright \frenchspacing + \item [{\sl The \LaTeX{} Companion:}] by Michel Goossens, Frank + Mittelbach, and Alexander Samarin (Addison-Wesley, 1994). + + Contains many details to assist users. Caveats: + + Chapter~8 is no longer valid --- a revised version is + available in both {\tt .ps} and {\tt .pdf} formats from + {\small CTAN}.\footnote{CTAN = Comprehensive \TeX{} Archive + Network; a list of site addresses can be found on the {\small + TUG} home page {\tt www.tug.org}. Follow the links to {\tt + /tex-archive/info/companion-rev}.} + + As well, the sections on graphics and colour have been + superseded by material in {\sl The \LaTeX{} Graphics + Companion\/}. + + \item [{\sl The \LaTeX{} Graphics Companion:}]{\sl Illustrating + Documents\break with \TeX{} and PostScript\/}, by Michel + Goossens, Sebastian Rahtz, and Frank Mittelbach + (Addison-Wesley, 1997). + + \item [{\sl Math into \LaTeX:}] {\sl An Introduction to \LaTeX{} + and AMS\LaTeX{}}, by George Gr\"atzer (Birkh\"auser, Boston + and Springer Verlag, New York, 1996). + + \item [{\sl First Steps in \LaTeX:}] by George Gr\"atzer + (Birkh\"auser, Boston, 1999). + + \item [{\sl The \TeX book:}] by Donald E.~Knuth (Addison-Wesley, + 1986). + + \item [{\sl \LaTeX:}] {\sl A Document Preparation System --- + User's Guide and Reference Manual\/}, by Leslie + Lamport (Addison-Wesley, 1994, 2nd ed). + + \item [{\sl A Guide to \LaTeXe:}] by Helmut Kopka and Patrick + W.~Daly (Addison-Wesley, 1998, 3rd ed). + + \item [{\rm Michael Downes:}] ``Breaking equations,'' {\sl TUGboat} + 18,3 (Sept 1997): 182--194. + + \item [{\rm Keith Reckdahl:}] ``Using EPS graphics in \LaTeXe\ + documents,'' {\sl TUGboat} 17,1 (March 1996): 43--53. + + \item [{\rm Keith Reckdahl:}] ``Using EPS graphics in \LaTeXe\ documents, + Part 2: Floating figures, boxed figures, captions, and math + in figures,'' {\sl TUGboat} 17,3 (Sept.\ 1996): 288--310. + + The latest version of the Reckdahl material can be found on + {\small CTAN} in \texttt{info/epslatex} in both \texttt{.ps} + and \texttt{.pdf} formats. +\end{description} + + +%% Section 5.2 +\subsection{Electronic resources} + +\begin{description} \itemsep=0pt + \item [\href{http://www.tug.org/}{www.tug.org}:] the most complete + stepping-stone to the world-wide \TeX{} community, including + the {\small CTAN} archives, user groups, news, and so on. + + \item [comp.text.tex] a general all-purpose newgroup for \TeX{} + users. Consult your local technical support group to see + if newsgroup access if available via your browser. + + \item [FAQ:] put together by the UK \TeX{} Users Group; available + via the {\small TUG} web page. + + \item [Listserv lists:] there are a great number of specialised + lists. Consult the {\small TUG} web pages for details. + + \item [http://groups.google.com/] holds an archive of usenet + discussions, and may be used to review current topics of + concern, or to search for answers to specific questions. + Unfortunately, the service does {\bf not} offer facilities + for posting to usenet, at present. +\end{description} + +\newpage + + +%% Section 6: +\section{In-house Coding for Articles\label{inhouse}} + +A template file with all the main preamble lines of code already +input, is available (see Appendix~B). At the top of the new file, +insert the contents of: +% +\begin{verbatim} + nrc-opening.tex +\end{verbatim} +% +and begin to {\bf un}comment those lines which are pertinent for the +file. There are brief notes in the template, indicating the purpose of +each macro line, along with cross-references to pages in these +guidelines. Delete or leave commented those lines which are not +relevant to the file. + +{\bf Note:} Only invoke those packages and/or macros which are present +in the file; for example, it is misleading to load a graphics package +if there are no figures in the file. + + + +%% Section 6.1 +\subsection{Changing class option choices} + +Included in the main class options are some which are intended for +authors only; remove any of the following options before processing +author files in-house: + +\begin{verbatim} + author genTeX type1rest usecmfonts +\end{verbatim} + +\noindent On the other hand, there are a number of class options +related to various stages of in-house production and thus intended +only for \NRC{} editorial staff. Below is a list of these options, +followed by a brief description of their purpose: + +\begin{verbatim} + \documentclass[]{} + breakaddress nrc1 + for nrc2 only: twocolid OR nrc2 + for nrc2 only: twocolid* + preprint + proof + pagnf + trimmarks + finalverso +\end{verbatim} + +\begin{description} \itemsep=0pt + \item [{\tt breakaddress}] +% + This option affects the author IDbox at the bottom of the + titlepage. It inserts a linebreak between the author name and + address; the default setting has them print on the same line. + + \item [{\tt twocolid}] +% + For \texttt{nrc2} only. This option affects author + information (the IDbox at page bottom): the text spans both + columns.\footnote{The default is to set all IDbox material + into the bottom of the left column.} + + \item [{\tt twocolid*}] +% + For \texttt{nrc2} only. This variation for the IDbox also + spans both columns, but the material inside is itself set up + in two columns. + + \item [{\tt preprint}] +% + This affects headers and footers, omitting such items as + dates, page numbers, and so on. For any additional text in + running heads (e.g., `Rapid Communication'), use + \verb|\shortauthor|. + + \item [{\tt proof}] +% + Prints a centred footer on every page with the following + text: `Proof/\'Epreuve'.\label{proof-pagnf} + + {\bf Note:} Comment out when {\small DOI} line must appear at + bottom centre of opening page. See section~\ref{filenumber}. + + + \item [{\tt pagnf}] +% + Prints a centred footer on every page with the following + text: `Pagination not final/Pagination non + finale'. + + {\bf Note:} Comment out when {\small DOI} line must appear at + bottom centre of opening page. See section~\ref{filenumber}. + + + \item [{\tt trimmarks}] +% + Prints cropmarks at all four corners. Note that trimmarks for + \texttt{nrc2} are off the regular $8.5 \times 11$-inch paper, + but will be visible if oversized paper is used. + + + \item [{\tt finalverso}] +% + Specifies that the paper should end on a recto page (creating + a blank, unnumbered page if the text doesn't for itself; the + blank page does {\bf not} appear in the paper's page count. + +\end{description} + + +%% Section 6.2 +\subsection{Additional packages} + +A number of additional packages are included in the template file {\tt +nrc-opening.tex}. Uncomment those packages which will be needed for +each specific article. + + +\begin{description} \itemsep=0pt + \item [{\tt \blash usepackage\char`\{color\char`\}}] + + The \verb|color| package is used for in-house production of + reversed out text (white on black). Ensure that no driver + option is specified here, as it would over-ride the in-house + printer set-up. See section \ref{specialtitles} for details. + + \item [{\tt \blash usepackage\char`\{dcolumn\char`\}}] + + At present, this remains commented out as the \NRC's need for + left-justified decimal alignment is not possible via + \texttt{dcolumn}. Left-justified alignment at present is + achieved by using the \verb|\llap|, \verb|\rlap|, and + \verb|\phantom| commands. + + \item [{\tt \blash usepackage\char`\{url\char`\}}] + + Inserts line breaks into e-mail and website addresses. The + package \textbf{and} its additional line of code must be + uncommented. + + \item [{\tt \blash usepackage\char`\{array\char`\}}] + + Allows for raggedright columns in tables. The package + \textbf{and} its additional line of code must be uncommented. + + \item [{\tt \blash usepackage\char`\{cases\char`\}}] + + Makes it possible for a left curly brace to span several + lines of equations. The package \textbf{and} its additional + line of code must be uncommented. + + \item [personal macros] + + Over time, it may become apparent that some small + modifications or shorthands are used in almost all + papers. Until such changes are incorporated into the document + classes, these should not be inserted into each article file + but rather stored in a separate file, loaded via the + \verb|\usepackage| command and inserted after all other + packages. +\end{description} + +\newpage + + +%% Section 6.3 +\subsection{Package to remove} + +If the user has specified +% +\begin{verbatim} + \usepackage[T1]{fontenc} +\end{verbatim} +% +so as to enable French-language hyphenation to work when using {\small +CM} or restricted Type~1 fonts, the package invocation should be +deleted (the \NRC{} classes supply their own \verb|fontenc| +invocation). + + +%% Section 6.4 +\subsection{Additional macros} + +Following the loading of all packages and their options, files may +contain additional macros from the author (see +page~\pageref{authmacros} for instructions provided to authors). These +should be clearly marked off with, for example, a row of +\verb|%%|~signs both above and below. Keep in mind the potential for +author definitions to interfere or over-ride journal macros and +specifications; for example, authors may have commands to specify page +dimensions, or fonts for sections, or numbering schemes. Where these +do not collide with journal requirements, they can probably be safely +retained. However, where there is interference, journal definitions +take precedence. Ideally, authors will increasingly switch to using +the \NRC's document classes and reduce the chances of such problems. + + +%% Section 6.5 +\subsection{Other additions in the preamble area} + +Some if not all of the following macros are used by the \NRC's +in-house production team, and not by the author. They are input in the +file after all packages have been loaded, and before the +\verb|\begin{document}| statement: + +\begin{verbatim} + \setcounter{page}{} + \journal{} + \journalcode{} + \volyear{}[]{} + \filenumber{} + + \received{} + \revreceived{} + \accepted{} + \revaccepted{} + \IDdate or \IDdates{} + \webpub{} + \commdate{} + + \assoced{} + \corred{} +\end{verbatim} + +\begin{description} \itemsep=0pt + \item [{\tt \blash + setcounter\char`\{page\char`\}\char`\{...\char`\}}] \mbox{} + + Insert starting page number for article. The information will + be printed on the titlepage (bottom left) and in the running + head; the complete page range will be calculated and inserted + automatically when the file is run a second time. + +\newpage + + + \item [{\tt \blash journal\char`\{...\char`\}}] \mbox{} + + Specific journal abbreviations must be entered via this macro + (e.g., \verb|Can. J. Civ. Eng.|). + The \verb|\journal| command records the web address that + will be used for this paper when it is published on the web; + note that the \verb|\journalcode| command may be used as an + alternative to \verb|\journal|. + + See Appendix~A for complete list of journal abbreviations. + + + \item [{\tt \blash journalcode\char`\{...\char`\}}] \mbox{} + + The argument is the ``journal acronym'' (see table in + Appendix~A for a list). This acronym identifies the journal, + and the \verb|\journalcode| command uses it to set the + journal abbreviation and the web site addresses; note that + the \verb|\journal| command may be used as an alternative to + \verb|\journalcode|. + + + \item [{\tt \blash + volyear\char`\{...\char`\}[...]\char`\{...\char`\}}] \mbox{} + + First argument is for the volume number. The second + (optional) argument specifies the copyright year; if the + argument is not present, the copyright year is assumed to be + the same as the production year. The third argument + specifies the publication year, which is used in the + titlepage footer and in the left running head. + + + \item [{\tt \blash filenumber\char`\{...\char`\}}] \mbox{} + + Insert the \NRC's file number here.\label{filenumber} The + number will be appended to the canned text \verb|10-1139/|, + which appears bottom centre of the + opening page. If \verb|\filenumber| is missing, the following + will be printed: {\it Zxx-xxx\/}. + + {\bf Note:} The {\small DOI} line prints in the same location + as text for the class options \verb|proof| and + \verb|pagnf|. Comment these class options out once it becomes + necessary to have the {\small DOI} line print at bottom + centre of the opening page. See section~\ref{proof-pagnf}. + + + \item [{\tt \blash filenumber*\char`\{...\char`\}}] \mbox{} + + Add an asterisk to the \verb|\filenumber| macro when it is + necessary for the filenumber to be prefixed to the page + numbers, in addition to appearing in the DOI line. + + All page numbers in the headers, and on the opening page at + the bottom left will have the filenumber prefixed to them. + + {\bf Note:} The filenumber will {\bf not} be prefixed to any + page cross-references (via the \verb|\pageref| macro). + + + \item [{\tt \blash received\char`\{...\char`\}}] \mbox{} + + Insert date as per journal style --- e.g., June 6, 2001 --- + but without a final period (it is automatically inserted). + The word `Received' (Fr.\ `Re\c cu le') will be automatically + generated; however, the date must be input in French (e.g., 6 + juin 2001). This text appears in the author IDbox area. + +\newpage + + \item [{\tt \blash revreceived\char`\{...\char`\}}] \mbox{} + + Same instructions as for \texttt{\blash received}. The text + `Revision received' (Fr.\ `R\'evision re\c cue le') will be + automatically generated. This text appears in the author + IDbox area. + + + \item [{\tt \blash accepted\char`\{...\char`\}}] \mbox{} + + Same instructions as for \texttt{\blash received}. The word + `Accepted' (Fr.\ `Accept\'e le') will be automatically + generated. This text appears in the author IDbox area. + + + \item [{\tt \blash revaccepted\char`\{...\char`\}}] \mbox{} + + Same instructions as for \texttt{\blash received}. The text + `Revision accepted' (Fr.\ `R\'evision accept\'ee le') will be + automatically generated. This text appears in the author + IDbox area. + + + \item [{\tt \blash IDdates\char`\{...\char`\}}] \mbox{} + + Unlike \verb|\received| and \verb|\accepted|, no canned text or + final punctuation is included, allowing the user to insert + customised text and/or date information, which appears in the + author IDbox area. An alias, \verb|\IDdate|, is also + available. + + + \item [{\tt \blash webpub\char`\{...\char`\}}] \mbox{} + + Insert date of publication at the \NRC{} website as per + journal style --- e.g., June 6, 2001 --- but without a final + period (it is automatically inserted). The text will appear + in the author IDbox area. + + For English-language articles, the text `Published on the + {\small NRC} Research Press Web site at \verb|webaddress| on + \verb|date|' will be automatically generated. The website + address is generated by using either the \verb|\journal| or + \verb|\journalcode| macros. + + For French-language articles, the text `Publi\'{e} sur le + site Web des Presses scientifiques du {\small CNRC}, \`a + \verb|webaddress|, le \verb|date|' will be automatically + generated. Note that the date must be input in French (e.g., + 6 juin 2001). + + + \item [{\tt \blash commdate\char`\{...\char`\}}] \mbox{} + + Insert date as per journal style --- e.g., June 6, 2001 --- + but without a final period (it is automatically inserted). + The text `Written discussion of this article is welcomed and + will be received by the Editor until' (Fr.\ `Les commentaires + sur le contenu de cet article doivent \^{e}tre envoy\'{e}s au + directeur scientifique de la revue avant le') will be + automatically generated; however, the date must be input in + French (e.g., 6 juin 2001). This text appears in the author + IDbox area. + + + \item [{\tt \blash assoced\char`\{...\char`\}}] \mbox{} + + Insert name of associate editor, without a final period. The + text `Paper handled by Associate Editor' (Fr.\ `Production de + l'article coordonn\'{e}e par le directeur scientifique + associ\'{e}') will be automatically generated. This text + appears in the author IDbox area. + +\newpage + + + \item [{\tt \blash corred\char`\{...\char`\}}] \mbox{} + + Insert name of associate editor, without a final period. The + text `Corresponding Editor:' (Fr.\ `Directeur scientifique + correspondant\,:') will be automatically generated. This text + appears in the author IDbox~area. +\end{description} + + +%% Section 6.6 +\subsection{Special titleblocks\label{specialtitles}} + +Some journal material requires a special heading: a solid black stripe +with reversed-out white lettering. The white-on-black effect requires +the presence of a special package in the preamble area, immediately +below the graphics package, in addition to the special title coding: + +\begin{verbatim} + \usepackage{color} +\end{verbatim} + +\noindent Since both the \texttt{graphicx} package and \texttt{color} +share the same option, it is possible to merge them into one line: + +\begin{verbatim} + \usepackage{graphicx,color} +\end{verbatim} + +\noindent Having added the \texttt{color} package, the actual special +title command will now work. There are two versions of the command: + +\begin{description} \itemsep=0pt + \item [{\tt \blash specialtitle}] \mbox{} + + This allows the regular titleblock (\verb|\title|, etc.) to + be included with the special title; for example, a review + article with its own title. +% +\begin{verbatim} +\begin{document} +\specialtitle{REVIEW/SYNTH\`ESE} +\title{Regular article title} +\author{Someone's name here} +\address{Someplace nice and warm} + \correspond +\shortauthor{Review/Synth\`ese} +\maketitle +\end{verbatim} + + \item [{\tt \blash specialtitle*}]\mbox{} + + The regular article titleblock cannot be used with this + variant; for example, an editorial or other non-article + material. +% +\begin{verbatim} +\begin{document} +\specialtitle*{EDITORIAL/\'EDITORIAL} +\shortauthor{Editorial/\'Editorial} +\maketitle +\end{verbatim} + + For non-articles, the headers and footers are changed by + using the \verb|\pagestyle{nrcplain}| command. The page + numbers will appear at bottom centre, the \NRC{} Canada + copyright footer is suppressed, and the running heads are + suppressed entirely. For further adjustments to pagination, + see `Miscellaneous adjustments'. +\end{description} + + +%% Section 6.7 +\subsection{Translations of abstracts/resum\'es} + +The following lines are inserted at the end of each abstract or +resum\'e, before the \verb|\end{...}| statement: + +\begin{description} \itemsep=0pt + \item [{\tt \blash translation}] generates the text: `[Journal + translation]'. + + \item [{\tt \blash traduit}] generates the text: `[Traduit par la + r\'edaction]'. + + \item [{\tt \blash Traduit}] generates the text: `[Traduit par la + R\'edaction]'. +\end{description} + +\noindent Note that author files will only have one: an abstract or a +resum\'e. It is useful to insert a suitable \verb|\vspace| to +represent the approximate space the translation would require, so that +page breaks will not be unduly affected by the additional text. + + +%% Section 6.8 +\subsection{Miscellaneous adjustments} + +\begin{enumerate} \itemsep=0pt + \item Journals requiring more space between lines will need the + following command inserted into the preamble area: +% +\begin{verbatim} + \easebaselines +\end{verbatim} + + This command will also adjust the inter-row spacing within + tables (value of \verb|\arraystretch| increases to 1.05). + + + \item For {\bf roman numerals}, with only page numbers in the + footers, insert the following lines at the end of the + preamble, just above the \verb|\begin{document}| line (notice + that, in this example, pagination will begin with roman iii): +% +\begin{verbatim} + \pagestyle{nrcplain} + \pagenumbering{roman} + \setcounter{page}{3} +\end{verbatim} + + \item To add parentheses (or any other design element) to (roman) + page numbers, insert the following just before the + \verb|\setcounter{page}{...}| command: +% +\begin{verbatim} + \renewcommand\thepage{(\roman{page})} +\end{verbatim} + + \item For full-width text spanning two columns, the default left + and right margins can be altered by using the following + optional argument to the \verb|{WideText}| environment + (recall that the default values are 0em on the left, 3em on + the right): + +\begin{verbatim} +\begin{WideText}[][] + +\end{WideText} +\end{verbatim} +\end{enumerate} + + +%% Section 6.9 +\subsection{Two-column bilingual texts} + +Special coding at both the top of the file and around the bilingual +paragraphs is required. + + +%% Section 6.9.1 +\subsubsection{In the preamble\label{bilingpream}} + +First, load the appropriate package and options. These are added after +the \verb|\documentclass| line in the preamble. + +\newpage + +\begin{enumerate} \itemsep=0pt + \item if main (left column) language is English: + + \verb|\usepackage[french,english]{babel}| + + As English is the default, there is no need to specify it as + an option to the document class. + + \item if main (left column) language is French, there is an + additional option to add to the document class line: + + \verb|\documentclass[french]{nrc1}| + + \verb|\usepackage[english,french]{babel}| + + See sections~\ref{frenchclassoption} and \ref{babelinfo}, + which also discuss the \textsf{babel} package. +\end{enumerate} + + +%% Section 6.9.2 +\subsubsection{In the bilingual text} + +The next step is to code the English and French texts so that the tops +of matching paragraphs align horizontally. One set of codes surrounds +the entire bilingual set of paragraphs; another set of codes is put +around each matched set of English-French paragraphs. + +\begin{verbatim} +1. \begin{par-text}[] +2. \begin{par-para} +3. ... ... +4. \othercol +5. ... ... +6. \end{par-para} +7. +8. \begin{par-para} +9. ... ... +10. \othercol +11. ... ... +12. \end{par-para} +13. \end{par-text} +\end{verbatim} + +\begin{description} \itemsep=0pt + \item [lines 1, 13:] The entire 2-column section of matching + paragraphs is set inside a \verb|par-text| environment. This + separates the parallel text portion of a file from other + elements that may not require such formatting: headings or + other text, graphics inclusions, etc. The \verb|par-text| + command has one required option (language) and two width + options (to change from default values). + + \item [line 1: \tt{[]}] When the left-column language + is\break English, \verb|[french]| is the right-column + `option'. + + When left-column language is French, the right-column + language option is \verb|[english]|. {\bf Also required} is + the preamble code specified in section~\ref{bilingpream}, + item~2. + + \item [line 1:] The default column widths, which do {\bf not} need + to be specified, are: + + \hspace{1pc}\begin{tabular}{lccc} + & left col & inter-col & right col \\ [2pt] + \tt nrc1 & 15.5pc & 1.5pc & 17pc \\ + \tt nrc2 & 20.75pc & 1.5pc & 20.75pc \\ + \end{tabular} + + To change left-column width and inter-column space (the right + column width is calculated, based on these other two + dimensions): + +\begin{verbatim} +\begin{par-text}[][][] +\end{verbatim} + + where \verb|| is the new left column width, and + \verb|| is the new inter-column space. If only the + inter-column space, \verb||, is to change, + \verb|| must still be inserted, in order for the + program to find the 2nd set of square brackets. + + \item [lines 2 and 6:] matching English/French paragraphs are set + inside a \verb|par-para| environment + + \item [lines 3 and 5:] the matched sets of paragraphs (which can of + course be longer than one line!) + + \item [lines 4 and 10:] to signal the end of the left-column + paragraph and the start of its matching right column + paragraph, use \verb|\othercol| + + \item [line 7:] to make it easier to read the source file, separate + each set of \verb|{par-para}| with a blank line or a {\tt \%} + sign +\end{description} + +\noindent {\bf Note:} The default vertical space between lines is set +at 1pc ($\approx$ one blank line). To change this at specific points, +explicit \verb|\vspace{...}| commands can be inserted between sets of +\verb|{par-para}|. To change this for the entire file, insert +\verb|\parallelparsep{}| before \verb|{par-text}|. + + +%% Section 7: +\section{Final notes} + +\begin{enumerate} \itemsep=0pt + \item There is no dotless-j available in Adobe PostScript fonts. + The only dotless-j appears in math mode --- $\jmath$ --- + which is accessed by \verb|$\jmath$|. + + \item Only English and French hyphenation are currently set up; + English is the default, French is invoked by \textsf{babel}, + and the class selects French or English hyphenation as + necessary, as it goes along (provided the appropriate + hyphenation patterns have been installed). +\end{enumerate} + +\clearpage + + +\section*{Appendix A} + +\subsection*{Journal reference grid} + +{\footnotesize +\begin{tabular}{@{}lllll@{}} +\hline \hline +Journal name + & Journal abbreviation + & Journal + & English website + & French website \T \\ + & & acronym & & \B \\ +\hline +Biochemistry and Cell Biology\T + & Biochem. Cell Biol. + & bcb + & http://bcb.nrc.ca + & http://bbc.cnrc.ca \\ [2pt] +% +Canadian Geotechnical Journal + & Can. Geotech. J. + & cgj + & http://cgj.nrc.ca + & http://rcg.cnrc.ca \\ [2pt] +% +Canadian Journal of Botany + & Can. J. Bot. + & cjb + & http://canjbot.nrc.ca + & http://revcanbot.cnrc.ca \\ [2pt] +% +Canadian Journal of Chemistry + & Can. J. Chem. + & cjc + & http://canjchem.nrc.ca + & http://revcanchim.cnrc.ca \\ [2pt] +% +Canadian Journal of Civil Engineering + & Can. J. Civ. Eng. + & cjce + & http://cjce.nrc.ca + & http://rcgc.cnrc.ca \\ [2pt] +% +Canadian Journal of Earth Sciences + & Can. J. Earth Sci. + & cjes + & http://cjes.nrc.ca + & http://rcst.cnrc.ca \\ [2pt] +% +Canadian Journal of Fisheries + & Can. J. Fish. Aquat. Sci. + & cjfas + & http://cjfas.nrc.ca + & http://jcsha.cnrc.ca \\ +\quad and Aquatic Sciences \\ [2pt] +% +Canadian Journal of Forest Research + & Can. J. For. Res. + & cjfr + & http://cjfr.nrc.ca + & http://rcrf.cnrc.ca \\ [2pt] +% +Canadian Journal of Microbiology + & Can. J. Microbiol. + & cjm + & http://cjm.nrc.ca + & http://rcm.cnrc.ca \\ [2pt] +% +Canadian Journal of Physics + & Can. J. Phys. + & cjp + & http://cjp.nrc.ca + & http://rcp.cnrc.ca \\ [2pt] +% +Canadian Journal of Physiology + & Can. J. Physiol. + & cjpp + & http://cjpp.nrc.ca + & http://rcpp.cnrc.ca \\ +\quad and Pharmacology \\ [2pt] +% +Canadian Journal of Zoology + & Can. J. Zool. + & cjz + & http://cjz.nrc.ca + & http://rcz.cnrc.ca \\ [2pt] +% +Environmental Reviews + & Environ. Rev. + & er + & http://er.nrc.ca + & http://de.cnrc.ca \\ [2pt] +% +Genome + & Genome + & gen + & http://genome.nrc.ca + & http://genome.cnrc.ca \\ [2pt] +% +Journal of Environmental + & J. Environ. Eng. Sci. + & jees + & http://jees.nrc.ca + & http://rgse.cnrc.ca \\ +\quad Engineering and Science \B \\ +\hline \hline +\end{tabular} +} + +\clearpage + +\onecolumn + +\section*{Appendix B} + +\subsection*{Canned Preamble: \texttt{nrc-opening.tex}} + +\begin{verbatim} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% Typeset by , Research Press, NRC +%% Date: +%% NRC, +%% +%%%%%%%%%%%%%% +%% +%% 1. See original preamble material (at bottom of file) for +%% details on source of current .tex file: conversion +%% from word-processing program or author-generated TeX +%% code. +%% +%% 2. This template includes most options and packages used by +%% all the NRC journals. UNcomment those packages and options +%% which are REQUIRED. +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%% 1. Class file (nrc1 or nrc2) + options (see userguide, pp.1-2; p.9): +\documentclass[%% french, %% use with \usepackage[french]{babel} + %% leqno, %% only for nrc1 (default is right eqno) + %% reqno, %% only for nrc2 (default is left eqno) + %% nonumbib, %% biblio entries without nos. +% + %% breakaddress, %% linebreak btwn author(s) + address(es) + %% twocolid, %% IDbox spans 2 cols + %% twocolid*, %% 2-col IDbox + %% preprint, %% removes identifying nos. from headers/footers + %% proof, %% `Proof/Epreuve' in footer + %% pagnf, %% `Pagination not final/Pagination non finale' + %% trimmarks, %% add trimmarks + %% finalverso, %% final blank verso NOT included in pagerange +]{nrc2} %% choose one: nrc1 or nrc2 + +%% NOTE: authors may use the following options, which should be +%% DELETED once the file comes in-house: +%% +%% usecmfonts type1rest genTeX + + +%% 2. Frequently used packages -- see pp.2-3 of userguide: +%% a. graphics-related: +%% \usepackage{graphicx} %% color not usually needed +%% \usepackage[figuresright]{rotating} %% for landscape tables + +%% b. math-related: +%% \usepackage{amsmath} %% math macros in wide use +%% \usepackage{amssymb} %% additional math symbols +%% \usepackage{dcolumn} %% decimal alignment for tables +%% \usepackage{bm} %% `bold math' via \bm command + +%% c. for website addresses: +%% \usepackage{url} %% inserts linebreaks automatically +%% \NRCurl{url} + +%% d. biblio-related: +%% \usepackage{cite} %% enhances options for \cite commands + +%% e. for English-language papers: +%% \usepackage[french,english]{babel} + +%% f. for French-language papers: +%% \usepackage[english,french]{babel} %% remember to add french as a + %% CLASS option, above +%% g. for ragged-right tables: +%% \usepackage{array} +%% \newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp} +%% \let\PBS=\PreserveBackslash + +%% h. for left curly brace to span several lines of equations: +%% \usepackage{cases} +%% \expandafter\let\csname numc@left\expandafter\endcsname\csname +%% z@\endcsname + + +%% 3. Resetting float parameters: +%% a. in nrc1: +%% \renewcommand{\topfraction}{.95} +%% \renewcommand{\textfraction}{.05} +%% \renewcommand{\floatpagefraction}{.95} + +%% b. in nrc2: +%% \renewcommand{\topfraction}{.95} +%% \renewcommand{\floatpagefraction}{.95} +%% \renewcommand{\dbltopfraction}{.95} +%% \renewcommand{\textfraction}{.05} +%% \renewcommand{\dblfloatpagefraction}{.95} + + +%% 4. Resetting journal-specific parameters: +%% a. eqn nos. with section nos.: +%% \numberby {equation}{section} +%% \setcounter{equation}{0} + +%% b. in-line citations to use ( ) instead of default [ ]: +%% \renewcommand{\citeleft}{(} +%% \renewcommand{\citeright}{)} + +%% c. for JEES (to expand inter-line spacing; see p.12 of guide): +%% \easebaselines + + +%% 5. Miscellaneous macros to always have available: +%% a. shorthands: +\let\p=\phantom +\let\mc=\multicolumn + +%% b. struts for vertical spacing above/below rules in tables: +%%%%%%%%%%%%%%%%%% beginning of Claudio Beccari's code: +%% Spacing commands for {tabular} (from TTN 2,3:10 -- Claudio +%% Beccari): +%% Usage: a. use \T to put space below a line +%% (e.g., at top of a `cell' of text) +%% b. use \B to put space above a line +%% (e.g., at bottom of a `cell' of text) +\newcommand\T{\rule{0pt}{2.6ex}} % = `top' strut +\newcommand\B{\rule[-1.2ex]{0pt}{0pt}} % = `bottom' strut +%%%%%%%%%%%%%%%%%% end of Claudio's code + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end of class and package +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% options, additional macros + + +%% Journal-specific information for opening page -- pp.9-11 of guide: +%% a. numbers: +\setcounter{page}{1} %% replace 1 with starting page no. +\volyear{XX}{2001} %% volume, year of journal +\journal{} %% jrnl. abbrev. (see App.A of guide) +\journalcode{} %% jrnl. acro (see App.A of guide) +\filenumber{} %% NRC file number +%% \filenumber*{} %% prefixes \filenumber to all page nos. + %% NOTE: COMMENT OUT class options + %% pagnf + %% proof + %% once no longer needed + + +%% b. dates: +\received{} %% insert date, no period +\revreceived{} %% +\accepted{} %% +\revaccepted{} %% +%% \IDdates{} %% . Use for `Revised ...' etc. +%% \webpub{} %% insert date +%% \commdate{} %% + + +%% c. miscellaneous: +%% \assoced{} %% insert name of Associate ed. +%% \corred{} %% insert name of Corresponding ed. +%% \dedication{} %% insert text as neede +%% \abbreviations{} %% insert as needed + + +\begin{document} + +%% Reversed titlebar -- see p.11 of userguide: +%% \specialtitle{} %% for black stripe + text + regular title +%% \specialtitle*{} %% black stripe + text only + + + + +%% Title, Author(s), Address(es) -- see p.4 of userguide for +%% various options to save time and keyboarding, esp. where +%% authors share same address(s). + +\title{} + +%% Author 1: +\author[J.L. Humar]{John Larry Humar} %% opt. arg. ONLY if IDbox + %% name is diff. from + %% titleblock name +\address{} %% address of 1st author + + +%% Author 2: +\author{M.A. Rahgozar} +\address{} + +%% Author 3: +\author{Fred Murray} +\address{} + + +\shortauthor{Humar, Rahgozar, and Murray} %% for headers + +%%%%%%%% +%% This line goes here in nrc1. +%% \maketitle +%%%%%%%% + + +%% Abstract/Resume area -- see pp.5,12 of userguide: +\begin{abstract} + Abstract text +%% \keywords{} +%% \translation +\end{abstract} + +\begin{resume} + Texte du resume +%% \motscles{} +%% \Traduit %% or \traduit +\end{resume} + +%%%%%%%% +%% This line goes here in nrc2. +%% \maketitle +%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%% END OF TEMPLATE %%%%%%%%%%%%%%%%%%%%%% + +%% Ch. -- 11 NOV 02 + +\end{verbatim} + +\end{document} + + +%% END OF FILE -- cgit v1.2.3