% \iffalse % Copyright (C) 2004 TeX Users Group. % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA % %<*driver> \ProvidesFile{pracjourn.dtx} % %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesClass{pracjourn} %<*class> [2005/08/22 v0.4e PracTeX Journal Class] % % %<*driver> \documentclass{ltxdoc} \usepackage{hyperref,multicol} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \DocInput{pracjourn.dtx} \end{document} % % % \fi % % \CheckSum{601} % % % \changes{v0.0}{2004/10/03}{KB: Initial version} % \changes{v0.2}{2004/11/13}{KB: Palatino, no date printing} % \changes{v0.3}{2005/01/03}{AO: Add \cmd\TPJissue, \cmd\TPJrevision, \cmd\TPJcopyright} % \changes{v0.3}{2005/01/03}{AO: Rewrite using \LaTeXe{} idioms} % \changes{v0.3a}{2005/01/03}{AO: changes to \cmd\TPJissue, \cmd\TPJrevision, \cmd\TPJcopyright} % \changes{v0.3b}{2005/01/07}{AO: change \cmd\evensidemargin} % % % \newcommand\pkg[1]{\texttt{#1}} % % % \GetFileInfo{pracjourn.dtx} % % \DoNotIndex{\if} % % \title{% % The \textsf{pracjourn} class% % \thanks{% % This document corresponds to \textsf{pracjourn}~\fileversion, dated \filedate. % }% % } % \author{% % Karl Berry \\ % Arthur Ogawa\\ % Will Robertson\\ % Correspondence to: \texttt{pracjourn@tug.org}% % } % % \maketitle % % \begin{abstract} % For articles in The Prac\TeX\ Journal, \url{http://tug.org/pracjourn}. % \end{abstract} % % \makeatletter % \def\@dotsep{1000} % \setcounter{tocdepth}{2} % \setlength\columnseprule{0.4pt} % \renewcommand\tableofcontents{\relax % \begin{multicols}{2}[\section*{\contentsname}]\relax % \@starttoc{toc}\relax % \end{multicols}} % \makeatother % \tableofcontents % % \section{Introduction} % % The \pkg{pracjourn} \LaTeX{} document class is to be used for % articles written for the The Prac\TeX\ Journal, % \url{http://tug.org/pracjourn}. The source for the document class % resides at \url{http://tug.org/pracjourn/dtx}. (WR: why isn't it at % CTAN?) % % \section{Usage} % % To use this document class, proceed as per the \pkg{article} % document class, with the following emendments. % \begin{itemize} % % \item Refer to the sample document for context:\\ % \url{http:www.tug.org/PracJourn/dtx/pjsample.tex}. % % \item Issue a |\documentclass{pracjourn}| command in % the preamble of your document. No class options are necessary. % % \item This document class requires packages \pkg{mathpazo}, (or if % not found, \pkg{palatino}), \pkg{textcomp}, \pkg{color}, and \pkg{hyperref}. These % are all available in a reasonably up-to-date \TeX\ distribution. % \end{itemize} % % \subsection{Formatting} % % \begin{itemize} % % \item Page metrics should be correct for printing on either A4 or % letter size paper. The type size is 12/15.5 Palatino. % % \item Except in exceptional circumstances, please refrain from % using typefaces other than those defined by this class. % % \end{itemize} % % \subsection{Author/article metadata} % % All author and article information must be defined before the \cmd\maketitle\ % command. Preferably even before \verb|\begin{document}| would be good. % % \begin{itemize} % % \item The \cmd\author, \cmd\title, and \cmd\abstract\ commands are used to % define those pieces of metadata about the article, and are mandatory. % % \begin{itemize} % \item Note that the \cmd\abstract\ is a plain old command, % \emph{not} an environment. % % \item Should you have a reason for not having an abstract, % this may be signified by declaring \cmd\noabstract\ instead. % \end{itemize} % % \item It is optional to specify a copyright and/or license declaration, % to be typeset in the footer of the first page, with the \cmd\license\ % command.\footnote{The \cmd\TPJcopyright\ command, which used to provide this % functionality is still provided for backwards compatibility.} % % \item Additional author information may be specified, to be typeset appropriately, % with the following commands: \cmd\email, \cmd\website, and \cmd\address. % % \begin{itemize} % \item If the \pkg{switcheml} package is installed somewhere that % \TeX\ will find it, it is loaded for the purpose of obfuscating % the typeset email address. This is done to prevent harvesting by % spammers, but if the package cannot be found the email address % will by typeset as a hyperlink. % % \item Should you wish to typeset your % email address as a hyperlink (that is, theoretically harvestable % by spammers) despite having \pkg{switcheml} installed, you may % simply include the command \cmd\hyperlinkemail\ anywhere before % \cmd\maketitle. % \end{itemize} % \end{itemize} % % \subsubsection{Adding more author/article information} % % As previously % mentioned, this class provides the \cmd\email, \cmd\website, and \cmd\address\ % macros for typesetting that information in the header block. These commands are defined % in the source code of the class file with the following:\footnote{\cmd\typesetemail\ % is an internal command defined by either \cmd\hyperlinkemail\ or \cmd\obfuscateemail.} % \begin{quote} % |\addinfo{Address}|\\ % |\addinfo[\typesetemail]{Email}|\\ % |\addinfo[\url]{Website}| % \end{quote} % Additional blocks my be added on a per-article basis in the same manner. % % To be specific, the \cmd\addinfo\ command takes one mandatory argument, % which is the title of the item to be added to the list, and one optional % argument, which is used to define the formatting of the block. % % This command will then define the macro used to input the additional information % by taking the lowercase of the title of the information and turning it into % a \TeX\ macro. This creates some obvious limitations on the name of the information % blocks that can be created---if this upsets you, write me. % % If you don't like the ordering of the information blocks or you wish to edit % the formatting for some reason, the \cmd\clearinfo\ command allows you to start % fresh and redefine the address, email, and website information blocks however you may wish. % % \subsection{TPJ internal commands} % % \begin{itemize} % % \item Two commands are to be used at the direction of the Prac\TeX\ % production team: \cmd\TPJrevision\ and \cmd\TPJissue. These % commands typeset information in the header of the first page % relating to the revision number (or date) of the article and the % issue number of the journal. % % Below this information is a hyperlink to send email comments to % the relevant mailing list. If \cmd\TPJissue\ is declared, then the % article is presumed to be in its publication form; emails are directed % to the public \url{pracjourn@tug.org} mailing list. If the % \cmd\TPJissue\ has \emph{not} been specifed, then the article is % still in its revision stage and the link directs emails to the % closed Prac\TeX\ journal production mailing list, intended for % article reviewers only. % % \item This document class creates a file \verb+_rev.tex+ in the % current directory (if a \cmd\TPJrevision{} statement is present) % and reads a file \verb+_iss.tex+, if present. Please keep a % separate directory for each article you develop for TPJ. % % \end{itemize} % % \subsection{Logos} % % The following logos and abbreviations are defined for your % convenience: \cmd\TeX, \cmd\LaTeX, \cmd\LaTeXe, \cmd\BibTeX, % \cmd\MF, \cmd\MP\ (METAFONT and METAPOST, typeset in their own % font), \cmd\ConTeXt, \cmd\pdfTeX, \cmd\pdfLaTeX, \cmd\PracTeX, % \cmd\TPJ\ (`The Prac\TeX\ Journal'). % % \StopEventually{\clearpage\PrintChanges\clearpage\PrintIndex} % % \section{History} % % The first revision of this class was written by Karl Berry. % KB: Gratefully based on the \texttt{dtxtut} skeleton. % % Revised by Arthur Ogawa, 2004/01/03, to include new features, per % Lance Carnes, as follows: % % \begin{enumerate} % \item Define an \cmd\articleID{} macro which typesets the article % identification in a block somewhere on the first page of the % article, and which can be used to identify the article/revision % date for reader comments. E.g. if this appears in the article % source file: % \begin{verbatim} % \author{A.U. Thor} % \title{Pracjourn Sample} % \TPJissue{TPJ Vol 1 No 1, 2005-1-15} % \TPJrevision{2005-2-12}% % \TPJcopyright{\textcopyright\ 2005 TeX Users Group} % \end{verbatim} % it will become a block of text typeset on the first page of the % article. See % e.g. \url{http://www.ams.org/bull/2004-41-04/S0273-0979-04-01032-8/S0273-0979-04-01032-8.pdf} % % \item Write the information from the argument of the % \cmd\articleID{} macro into a file called \verb+_id.tex+. Put % this file in the same directory as the source file, and overwrite % any previous files of the same name. % % \item Define a \cmd\TPJcopyright{} macro which will print a % copyright notice at the bottom of the first page. % E.g. \cmd\TPJcopyright\verb+{2005 TeX Users Group}+ will produce % ``\copyright2005 TeX Users Group'' in the page footer of the title % page. % % \item The page measures should work with both Letter and A4 paper % sizes. % \end{enumerate} % % Revised again by Will Robertson, mid-2005, to implement a couple of % extra things. % \begin{itemize} % % \item The \cmd\maketitle\ has been redesigned with additional % author information. \cmd\email, \cmd\address, % \cmd\website, and \cmd\abstract\ are now also supported. Further % information may be added in the same style. % % \item Appropriate some various style files to remove dependancies on % \pkg{mflogo} and \pkg{texnames}. In addition, the various % \cmd\TeX\ logos were tuned to look better in the Palatino % typeface. % % \item The hyperref package is loaded and set up to colour various % hyperlinks. % % \item Document divisions have been un-boldened, just for a change. % % \end{itemize} % % \section{Implementation} % % \subsection{Base class and default options} % % Use \LaTeX's \pkg{article} class, but at a bigger default type size. % % KB: 12pt seems a little too big, 11pt seems a little too small. % Implementing 11.5pt is not obvious. % % \changes{v0.3}{2004/01/03}{AO: Override the default option list of % \pkg{article.cls}} % % If the document instance calls for options that conflict with the % following choices, then the document wins. However our default % option list is not the same as those of \pkg{article.cls}. % \begin{macrocode} \let\ExecuteOptions@ltx\ExecuteOptions \def\ExecuteOptions#1{% \ExecuteOptions@ltx{letterpaper,12pt,oneside,onecolumn,final}% }% \LoadClassWithOptions{article} \let\ExecuteOptions\ExecuteOptions@ltx % \end{macrocode} % % \subsection{Metrics} % % Default leading (from \texttt{classes.dtx}) for 11pt is 13.6pt % leading, for 12pt is 14.5pt. We want more---this factor gives us % 12pt type on 15.5pt leading. % \begin{macrocode} \linespread{1.069} % \end{macrocode} % % Change the text width to something that works for both A4 and % Letter paper, as well as possible. % % xx The vertical dimensions need to be changed as well, perhaps % for a 9in text height, taking account of the headline and % footline. % \begin{macrocode} \setlength\textwidth{432pt} \setlength\oddsidemargin{18pt}% xx depend on letter/a4 \setlength\evensidemargin{18pt} % \end{macrocode} % % \subsection{Package loading} % % Palatino, including math (sc option for true small caps, not in TL % 2003). Try for \pkg{mathpazo}; if not available use \pkg{palatino}. % % \changes{v0.3}{2004/01/03}{AO: rewrite using \cs{IfFileExists} idiom.} % \changes{v0.4e}{2005/08/22}{WR: requires the textcomp package.} % % The \pkg{textcomp} package is loaded in order to provide a nice looking copyright logo, amongst other things. % % \begin{macrocode} \IfFileExists{mathpazo.sty} {\RequirePackage{mathpazo}} {\RequirePackage{palatino}} \RequirePackage{textcomp} % \end{macrocode} % \pkg{hyperref} is used for creating live hyperlinks, as well as % providing \cmd\url\ for typesetting URLs easily. All hyperlinks % are coloured in a dark shade of blue. % \begin{macrocode} \RequirePackage{color,hyperref} \definecolor{refcolor}{rgb}{0,0.2,0.6} \hypersetup{bookmarks,colorlinks,breaklinks, linkcolor=refcolor,citecolor=refcolor, filecolor=refcolor,urlcolor=refcolor} % \end{macrocode} % If the \pkg{switcheml} package is installed in the author's % system, use it to obfuscate their email address by default. Otherwise, just % use a hyperlink. The commands to do this are defined in a later section. % % An author may specify \cmd\hyperlinkemail\ explicitly % should they not care to obfuscate their email address even with the \pkg{switcheml} % package installed. % \begin{macrocode} \IfFileExists{switcheml.sty} {\RequirePackage{switcheml} \AtBeginDocument{\@ifx@undefined{\typesetemail}{\obfuscateemail}{}}} {\AtBeginDocument{\@ifx@undefined{\typesetemail}{\hyperlinkemail}{}}} % \end{macrocode} % % % \subsection{Amendments from \pkg{article}} % % \begin{macro}{\maketitle} % Printing the date of the last \TeX\ run in the title block does % not seem warranted---if someone reprocesses the document with no % changes, we wouldn't want the date to change. % % xx use rcs.sty or something? % % xx include bibtex id? % % \changes{v0.3}{2004/01/03}{AO: reproduce entire definition from % \texttt{article.cls}, with modifications.} % \changes{v0.3}{2004/01/03}{AO: \cmd\thispagestyle{titlepage}. Do % not empty out \cmd\@author, \cmd\@title, etc.} % \changes{v0.4b}{2005/06/26}{WR: removed some twocolumn conditional code.} % \changes{v0.4b}{2005/06/26}{WR: added check for an abstract} % \begin{macrocode} \renewcommand\maketitle{\par \iftpj@noabstract\else \@ifx@undefined{\tpj@info@Abstract} {\ClassError{pracjourn} {Please specify an \string\abstract\space before \string\maketitle} {It is a PracTeX Journal requirement to include an abstract. \MessageBreak \MessageBreak If you have exceptional reasons for not having one in this \MessageBreak article, write \string\noabstract\space somewhere before \string\maketitle.}}{} \fi \begingroup \renewcommand\thefootnote{\@fnsymbol\c@footnote}% \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% \long\def\@makefntext##1{\parindent 1em\noindent \hb@xt@1.8em{% \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% \newpage \global\@topnum\z@ % Prevents figures from going at top of page. \@maketitle \thispagestyle{titlepage}\@thanks \endgroup \setcounter{footnote}{0}% \global\let\thanks\relax \global\let\maketitle\relax \global\let\@maketitle\relax % \global\let\@thanks\@empty % \global\let\@author\@empty % \global\let\@date\@empty % \global\let\@title\@empty \global\let\title\relax \global\let\author\relax \global\let\date\relax \global\let\and\relax }% % \end{macrocode} % \end{macro} % % % % \begin{macro}{\@maketitle} % % \changes{v0.4a}{2005/06/13}{WR: various changes to accommodate extras.} % \begin{macrocode} \def\@maketitle{% \newpage \null \write@ID@aux\read@issue \vspace{1.5em} \begin{flushleft} \let\footnote\thanks \begingroup\LARGE \@title \par\endgroup \vspace{2ex}% \begingroup\large \@author \par\endgroup \end{flushleft} % \end{macrocode} % This is where the extra author information is typeset. As various % pieces of information are defined, they fill up the \cmd{\tpj@optional@author@info} % macro, which is subsequently used here as per the definition of the author. % \begin{macrocode} \tpj@optional@author@info \iftpj@noabstract\else \vspace{2ex}% \tpj@info@container{Abstract} \fi} % \end{macrocode} % \end{macro} % % % \subsubsection{Formatting changes} % % Remove bold from the all the section headings, just for something a % little different. This is verbatim from \texttt{article.cls} with a % bunch of \cmd\bfseries's omitted. % % \begin{macrocode} \renewcommand\section{\@startsection {section}{1}{\z@}% {-3.5ex \@plus -1ex \@minus -.2ex}% {2.3ex \@plus.2ex}% {\normalfont\Large}} \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% {-3.25ex\@plus -1ex \@minus -.2ex}% {1.5ex \@plus .2ex}% {\normalfont\large}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {-3.25ex\@plus -1ex \@minus -.2ex}% {1.5ex \@plus .2ex}% {\normalfont\normalsize}} \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {3.25ex \@plus1ex \@minus.2ex}% {-1em}% {\normalfont\normalsize\itshape}} \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% {3.25ex \@plus1ex \@minus .2ex}% {-1em}% {\normalfont\normalsize\itshape}} % \end{macrocode} % % % \subsection{TPJ additions} % % \subsubsection{Boolean logic} % % \begin{macro}{\@ifx@empty} % \begin{macro}{\@ifx@undefined} % \begin{macro}{\@ifeof} % The following three procedures implement part of the boolean logic % facility, an expansion-only calculating engine. % \begin{macrocode} \def\@ifx@empty#1{% Implicit #2#3 \ifx#1\@empty \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}% \def\@ifx@undefined#1{% Implicit #2#3 \ifx#1\@undefined \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}% \def\@ifeof#1{% Implicit #2#3 \ifeof#1 \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}% \def\boolean@true#1{\let#1\@firstoftwo}% \def\boolean@false#1{\let#1\@secondoftwo}% % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % % \subsubsection{Titlepage pagestyle} % % \begin{macro}{\ps@titlepage} % The \cmd{\ps@titlepage} procedure effects a page style % called \texttt{titlepage}, which applies only to the title page. % The \cmd{\titlepage@head} procedure sets type in the page header, % \cmd{\titlepage@foot} in the page footer. % % \changes{v0.3}{2004/01/03}{AO: add page header and footer to title page} % \begin{macrocode} \def\ps@titlepage{% \def\@oddhead{\titlepage@head\hfil}% \let\@evenhead\@oddhead \def\@oddfoot{\hfil\titlepage@foot}% \let\@evenfoot\@oddfoot}% % \end{macrocode} % \end{macro} % % \begin{macro}{\titlepage@head} % % This is the text block before the article title. Changes depending % on the production stage, and includes an email link to send % comments on the article. In the review phase, this links to % \url{pracjourn-prod@tug.org}, the closed Prac\TeX\ production % mailing list. Once published, the link points at % \url{pracjourn@tug.org} for public discussion. % % \changes{v0.4b}{2005/06/26}{WR: More conditional text.} % \changes{v0.4b}{2005/06/26}{WR: Added hyperref link to email article % comments for both reviewers and readers.} % \changes{v0.4c}{2005/06/27}{WR: Tweaked conditionals; revision date is important even after publication!} % \changes{v0.4c}{2005/06/27}{WR: Added error check for \cmd\TPJrevision\ defined without \cmd\TPJissue.} % \changes{v0.4d}{2005/07/17}{WR: Make the header \cmd\small.} % \changes{v0.4e}{2005/07/17}{WR: Removed email comments links.} % \begin{macrocode} \def\titlepage@head{\small \vtop{% \baselineskip1.2em \halign{% ##\unskip\hfil\cr \relax\@ifx@empty\@TPJissue{For submission to \TPJ} {\TPJ\cr\@TPJissue}\cr \relax\@ifx@empty\@TPJissue {\@ifx@empty\@TPJrevision {Draft of \today} {Article revision \@TPJrevision % \cr % \tpj@compose@mailto % {pracjourn-prod@tug.org} % {Review comments on \@author's article, rev. \@TPJrevision} % {Send review comments to the \PracTeX\ production mailing list} }\cr }% {\@ifx@empty\@TPJrevision {\ClassError{pracjourn} {\string\TPJrevision\space must be defined if \string\TPJissue\space is also} {It is a requirement for PracTeX Journal articles to contain\MessageBreak revision information for version tracking. Please input this\MessageBreak information, or omit \protect\TPJissue.}} {Article revision \@TPJrevision} \cr % \tpj@compose@mailto{pracjourn@tug.org} % {Comments on \@author's article} % {Comment on this article} \cr}}}}% % \end{macrocode} % \end{macro} % % Email subjects should look like "comment on 2005-2-robertson Rev. 2005-03-25" % for consistency with the online links that serve the same purpose. For now, too bad. % % \begin{macro}{\titlepage@foot} % To typeset the optional copyright declaration by the author. % % \changes{v0.4d}{2005/07/17}{Removed \cmd\copyright\ from the copyright % notice and put the whole thing in a lowered \cmd\vbox\ to allow multi-line declarations.} % \begin{macrocode} \def\titlepage@foot{% \@ifx@empty\@TPJcopyright{}{% \lower\baselineskip\hbox{\vbox{% \raggedleft\small\@TPJcopyright}}}}% % \end{macrocode} % \end{macro} % % % \subsubsection{Additional author/article information} % % \begin{macro}{\addinfo} % % This command defines a new block of information to be typeset % in the title block of the document. For every new item, a new % \cmd{\tpj@info@container} is appended to \cmd{\tpj@optional@author@info}, which % is called in \cmd{\@maketitle}. % % \changes{v0.4d}{2005/07/30}{WR: Name change to user-space.} % \begin{macrocode} \newcommand\addinfo[2][]{% \tpj@define@info@block[#1]{#2}% \g@addto@macro\tpj@optional@author@info{\tpj@info@container[#1]{#2}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\tpj@define@info@block} % \changes{v0.4a}{2005/06/13}{WR: Implemented for new \cmd{\@maketitle}.} % This macro actually does the work of \cmd\addinfo. % It takes the name of a piece of info to be typeset in the % title block of the article. The name of the info is lowercased to % create a control sequence for the user to input this data. E.g., % \cs{addinfo{Abstract}} will create a control sequence % \cmd\abstract\ which saves its argument inside \cmd{\tpj@info@Abstract}. % % All commands are defined \cmd\long\ so that paragraphs are % allowed. This is much easier than % |\begin{abstract}...\end{abstract}| contortions % (cf. \texttt{ltugboat.cls}). % \begin{macrocode} \newcommand\tpj@define@info@block[2][]{% \lowercase{\expandafter\long\expandafter\def\csname#2\endcsname}% ##1{\expandafter\def\csname tpj@info@#2\endcsname{##1}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\clearinfo} % If the \cmd{\tpj@optional@author@info} macro needs to be cleared for some reason,\footnotemark % the \cmd\clearinfo\ command will come quite in handy. This command is also used to % initialise the macro in question. % \footnotetext{The only reason I can think of to do this is to re-arrange the order of % the items in the title block of the article.} % \changes{v0.4d}{2005/07/30}{WR: Implemented to allow for re-definition of standard information blocks.} % \begin{macrocode} \newcommand\clearinfo{\let\tpj@optional@author@info\@empty} \clearinfo % \end{macrocode} % \end{macro} % % \paragraph{Optional fields} % % These are the default information blocks. % \cmd\typesetemail\ is defined by one of either \cmd\hyperlinkemail\ or \cmd\obfuscateemail. % % \begin{macrocode} \addinfo{Address} \addinfo[\typesetemail]{Email} \addinfo[\url]{Website} % \end{macrocode} % % \paragraph{Abstract} We bypass \cmd\addinfo\ % so that the abstract info block is not added % to the \cmd{\tpj@optional@author@info} macro. % % The abstract block itself is called directly in \cmd{\@maketitle}. % % \begin{macrocode} \tpj@define@info@block{Abstract} % \end{macrocode} % % \begin{macro}{\noabstract} % However, the abstract may indeed be suppressed if that is the author's wish. % \changes{v0.4d}{2005/07/25}{WR: Implemented to turn off the abstract.} % \begin{macrocode} \newif\iftpj@noabstract \newcommand\noabstract{\tpj@noabstracttrue} % \end{macrocode} % \end{macro} % % \begin{macro}{\endabstract} % If an abstract environment is used, give an error. Maybe I should % just support the environment, instead. % \begin{macrocode} \def\endabstract{% \ClassError{pracjourn} {Please input the abstract with \string\abstract{...}, before \string\maketitle} {Instead of the \string\begin{abstract}...\string\end{abstract} \MessageBreak environment, use \string\abstract{...}. Paragraphs are allowed!\MessageBreak \MessageBreak Because the abstract is typeset with the title block, \MessageBreak it must be input before the \string\maketitle\space command.}} % \end{macrocode} % \end{macro} % % \begin{macro}{\TPJissue} % \begin{macro}{\TPJrevision} % \begin{macro}{\TPJcopyright} % % \changes{v0.3}{2004/01/03}{AO: add commands specifying issue, % revision, copyright.} % % The three user-level commands % \cmd\TPJissue, \cmd\TPJrevision, and \cmd\TPJcopyright{} specify % the issue, the revision, and the copyright information of the % document. % % Since these commands are like \cmd\author{} and \cmd\title, one % might wish to disable them upon executing the \cmd\titlepage{} % procedure. But we do not. % % If the document has a \cmd\TPJrevision{} statement, the title page % header contains ``Rev. YY-MM-DD'', otherwise it bears the current % date. % % If the document lacks a \cmd\TPJcopyright{} statement, the title % page footer contains nothing. % \begin{macrocode} \newcommand{\TPJissue}[1]{\gdef\@TPJissue{#1}}% \newcommand{\TPJrevision}[1]{\gdef\@TPJrevision{#1}}% \newcommand{\TPJcopyright}[1]{\gdef\@TPJcopyright{#1}}% \let\@TPJissue\@empty \let\@TPJrevision\@empty \let\@TPJcopyright\@empty % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % % \begin{macro}{\license} % % For consistency with the other user commands of this class, \cmd\license\ % is defined as an alias of \cmd\TPJcopyright. % % \changes{v0.4d}{2005/07/30}{WR: name change from \cmd\TPJcopyright\ % for consistency with other commands.} % % \begin{macrocode} \let\license\TPJcopyright % \end{macrocode} % % \end{macro} % % \begin{macro}{\tpj@info@container} % This is the macro that typesets the optional author info for % fields defined as above. It splits it all up in minipages, in a % smaller font and with more compressed leading than the main % document text. It takes the name of the info as a mandatory % argument, which is used to typeset the info label as well as % retrieve the actual data from the |\tpj@info@#1| macro (see % \cmd{\addinfo}). % % An optional argument is used as a hook to typeset the info data in % the equivalent form |#1{#2}|. % % For example, to typeset the info defined by the author in the % \cmd\abstract\ (recall, this is set up due to a corresponding % |\addinfo{Abstract}|---see above), input % |\tpj@info@container{Abstract}|. To typeset it, say, in italics, % it would be possible to write % |\tpj@info@container[\textit]{Abstract}|. % % \changes{v0.4a}{2005/06/13}{Implemented for new \cmd\@maketitle.} % \changes{v0.4d}{2005/06/29}{Warn if a title block command is used after \cmd\maketitle.} % % \begin{macrocode} \newcommand\tpj@info@container[2][]{% % \end{macrocode} % After \cmd\maketitle, redefine the info command to return an error. % \begin{macrocode} \lowercase{\expandafter\gdef\csname#2\endcsname}% {\ClassError{pracjourn}{#2 must be defined BEFORE \string\maketitle}{}} % \end{macrocode} % Now, we typeset the info block, but only if the info has actually been specified by the author. % \begin{macrocode} \expandafter\ifx\csname tpj@info@#2\endcsname\relax\else \noindent\null\hfill\small % \end{macrocode} % On the left, right-aligned sans serif item label, e.g., `Abstract': % \begin{macrocode} \begin{minipage}[t]{0.1\textwidth} \noindent\hfill\sffamily#2% \end{minipage}\hfill % \end{macrocode} % On the right, the content, defined by, e.g., \cmd\abstract: % \begin{macrocode} \begin{minipage}[t]{0.85\textwidth} \linespread{1.0}\selectfont \setlength\parindent{1.5em}% \noindent\ignorespaces \expandafter#1\expandafter{\csname tpj@info@#2\endcsname} \end{minipage}\par \fi} % \end{macrocode} % \end{macro} % % \subsubsection{Email \& hyperlink macros} % % \begin{macro}{\typesetemail} % % We define the macro \cmd\typesetemail\ to be used for self-explanatory purposes. % The class contains methods to define it in one of two ways. % % \begin{macro}{\hyperlinkemail} % % The \cmd\hyperlinkemail\ command defines \cmd\typesetemail\ to use the \pkg{hyperref} % package's facilities to create a hyperlink email address in the output document. % % \begin{macro}{\obfuscateemail} % % The \cmd\obfuscateemail\ command defines \cmd\typesetemail\ to use the \pkg{switcheml} % package's facilities to create a machine-obfuscated email address in the output % document.\footnote{The \pkg{switcheml} package defines, among a couple of other things, a macro for % typesetting email addresses that obfuscates their representation in the PDF file, % ensuring protection against harvesting email addresses from web-public % PDF documents.} % % \begin{macrocode} \newcommand\obfuscateemail{% \def\typesetemail##1{\ttfamily\switchemail{##1}}} \newcommand\hyperlinkemail{% \def\typesetemail##1{\ttfamily\tpj@compose@mailto{##1}{Re: PracTeX Journal article}{##1}}} % \end{macrocode} % \end{macro}\end{macro}\end{macro} % % \begin{macro}{\tpj@compose@mailto} % % This macro takes three arguments to typeset a mailto email % hyperlink. The |#1| takes the email address, |#2| takes the % default subject of the email, and |#3| is the text to appear in % the output as the hyperlink. % % All spaces in the hyperlink source are converted to |%20| to % accommodate Mac~OS~X's PDF reader; this isn't necessary for Adobe % Reader. Oh well. % % \changes{v0.4b}{2005/06/26}{Implemented; creates a workable mailto % hyperlink.} % % \begin{macrocode} \newcommand\tpj@compose@mailto[3]{% \edef\@tempa{mailto:#1?subject=#2 }% \edef\@tempb{\expandafter\html@spaces\@tempa\@empty}% \href{\@tempb}{#3}} % \end{macrocode} % \end{macro} % % \begin{macro}{\html@spaces} % \changes{v0.4b}{2005/06/25}{Implemented to overcome the mailto % problems in Mac~OS~X's PDF reader.} % This macro takes a string and (hopefully) converts all spaces (or % is it all whitespace?) to `\%20', creating a string that can be % used for encoding the subject of the email comments hyperlink in % \cmd{\titlepage@head}. Using \cmd\catcode, we remove the comment % ability of the \verb|%| character, making it a normal letter. % (This code was heavily influenced by the \LaTeX\ kernel's % \cmd{\zap@space} command.) % \begin{macrocode} \catcode`\%=11 \def\html@spaces#1 #2{#1%20\ifx#2\@empty\else\expandafter\html@spaces\fi#2} \catcode`\%=14 % \end{macrocode} % \end{macro} % % % % \subsubsection{Logos} % % \changes{v0.4a}{2005/06/05}{WR: Incorporated code from \pkg{texnames} % and \pkg{mflogo}.} % % The \pkg{texnames} and \pkg{mflogo} packages have been incorporated % into the class in order to remove the dependence on external % packages and to tune the logos for Palatino. First, here are the % relevant parts\footnote{No-one still refers to AMSTeX and SLITeX and % so on, right?} of \texttt{texnames.sty}, v1.10, tuned for Palatino % and adapted to use \cs{textsc} where appropriate: % \begin{macrocode} \def\TeX{T\kern-.15em\lower.5ex\hbox{E}\kern-.07em X\spacefactor1000\relax} \def\LaTeX{L\kern-.35em\raise.3ex\hbox{\textsc a}\kern-.15em\TeX} \def\LaTeXe{\LaTeX2$_{\textstyle\varepsilon}$} \def\BibTeX{B{\textsc i\kern-.025em \textsc b}\kern-.08em\TeX} % \end{macrocode} % And now \texttt{mflogo.sty}, unchanged in its entirety: % \begin{macrocode} \DeclareRobustCommand\logofamily{% \not@math@alphabet\logofamily\relax \fontencoding{U}\fontfamily{logo}\selectfont} \DeclareTextFontCommand{\textlogo}{\logofamily} \def\MF{\textlogo{META}\@dischyph\textlogo{FONT}\@} \def\MP{\textlogo{META}\@dischyph\textlogo{POST}\@} % \end{macrocode} % Now some new definitions. Despite the fact that it makes no % difference with the main font used for this class, I define % \cs{pdfTeX} with some italic correction to set a good % precedent. Compare Computer Modern with and without: % {\usefont{OT1}{cmr}{m}{n}pdf\/\TeX} % vs.~{\usefont{OT1}{cmr}{m}{n}pdf\TeX}; I find the former more % attractive because the ascender of the `f' doesn't collide. % \begin{macrocode} \newcommand\ConTeXt{C\kern-.03em on\-\kern-.10em\TeX\kern-0.04em t}% \newcommand\pdfTeX{pdf\/\TeX} \newcommand\pdfLaTeX{pdf\/\LaTeX} \newcommand\PracTeX{Prac\kern-0.08em\TeX} \newcommand\TPJ{The \PracTeX\ Journal} % \end{macrocode} % % \subsubsection{Version tracking} % % \begin{macro}{\write@ID@aux} % \changes{v0.3}{2004/01/03}{AO: add ID file} % Establish an auxiliary file, \verb+_id.tex+, for TPJ tracking information. % % \begin{macrocode} \def\write@ID@aux{% \@ifx@empty\@TPJrevision{}{% \begingroup \let\thanks\@gobble \immediate\openout\ID@aux _rev.tex % \immediate\write\ID@aux{\@percentchar\space % This file generated by the pracjourn document class}% \immediate\write\ID@aux{\@TPJrevision}% \immediate\closeout\ID@aux \endgroup }% }% \newwrite\ID@aux % \end{macrocode} % \end{macro} % % \begin{macro}{\read@iss@aux} % \changes{v0.3}{2004/01/03}{AO: read the "issue" file} % % FIXME: Check if \cmd\@TPJissue{} has been assigned already. % \begin{macrocode} \def\read@issue{% \openin\@inputcheck _iss.tex \@ifeof\@inputcheck{}{% \read\@inputcheck to\@TPJissue \global\let\@TPJissue\@TPJissue}% \closein\@inputcheck} % \end{macrocode} % \end{macro} % % \subsubsection{Miscellaneous} % % \begin{macro}{\set@pdfpage} % \changes{v0.3}{2004/01/03}{AO: add commands setting pdftex's page % metrics from LaTeX's} % % The PDF\TeX{} parameters \cmd\pdfpagewidth{} and % \cmd\pdfpageheight determine the % CropBox/BleedBox/TrimBox/ArtBox. The procedure \cmd\setpdfpage{} % sets them to the values of the \LaTeX{} \cmd\paperwidth{} and % \cmd\paperheight. If PDF\TeX{} is not the engine, nothing is % done. % % We arrange for the procedure to be executed at Begin Document % time. % \begin{macrocode} \def\set@pdfpage{% \@ifx@undefined\pdfoutput{}{% \pdfpagewidth =\paperwidth \pdfpageheight=\paperheight \relax}} \AtBeginDocument{\set@pdfpage} % \end{macrocode} % \end{macro} % % \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 \~} % % \Finale \endinput