summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pracjourn
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-11-16 10:44:38 +0000
committerNorbert Preining <preining@logic.at>2007-11-16 10:44:38 +0000
commit9cb91a45f0263cb69174b80b0a26258ef06a360a (patch)
tree3882485d2ace1033be5b7b9f73e7ec3cc4a9fa21 /Master/texmf-dist/source/latex/pracjourn
parentd63db66c42ec0eacc205e6e108b265f2d968e6c4 (diff)
update pracjourn v0.4n from ctan
git-svn-id: svn://tug.org/texlive/trunk@5442 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/pracjourn')
-rw-r--r--Master/texmf-dist/source/latex/pracjourn/pracjourn.dtx164
1 files changed, 109 insertions, 55 deletions
diff --git a/Master/texmf-dist/source/latex/pracjourn/pracjourn.dtx b/Master/texmf-dist/source/latex/pracjourn/pracjourn.dtx
index 99c5224bfb3..423db39c8a9 100644
--- a/Master/texmf-dist/source/latex/pracjourn/pracjourn.dtx
+++ b/Master/texmf-dist/source/latex/pracjourn/pracjourn.dtx
@@ -21,7 +21,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{pracjourn}
%<*class>
- [2006/02/20 v0.4k PracTeX Journal Class]
+ [2007/08/25 v0.4n PracTeX Journal Class]
%</class>
%
%<*driver>
@@ -149,6 +149,8 @@
% LOGOS, tuned for Palatino:
\def\TeX{T\kern-.15em\lower.5ex\hbox{E}\kern-.07em X\spacefactor1000\relax}
+\newcommand\TODO[1]{\marginpar{\raggedright\itshape\color{red}TODO: #1}}
+
\begin{document}
\DocInput{pracjourn.dtx}
\end{document}
@@ -156,7 +158,7 @@
%
% \fi
%
-% \CheckSum{720}
+% \CheckSum{0}
%
%
% \changes{v0.0}{2004/10/03}{KB: Initial version}
@@ -281,9 +283,21 @@
%
% 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 the obvious limitation on the name of the information
-% blocks that only single words may be used to describe any additional metadata. This
-% should not cause concern in practice.
+% a \TeX\ macro.
+%
+% \DescribeMacro{\newinfo}
+% If lowercasing the heading to create the macro name is impractical
+% (due to accents, for example), then this command can be used instead:
+% \begin{quote}
+% |\newinfo\resume[\color{red}]{R\'esum\'e}|
+% \end{quote}
+%
+% The names used in the article metadata (`Email', `R\'esum\'e', etc.) can be redefined as follows:
+% \begin{quote}
+% |\renewcommand\emailname{Email}|\\
+% |\renewcommand\resumename{Resume}|
+% \end{quote}
+% These macros are defined automatically by \cmd\addinfo/\cmd\newinfo.
%
% \DescribeMacro{\addinfospace}
% If you wish to add some vertical space after the previous item in the front matter,
@@ -293,7 +307,7 @@
% \DescribeMacro{\clearinfo}
% If you don't like the ordering of the information blocks or you wish to edit
% the formatting of the current setup, the \cmd\clearinfo\ command allows you to start
-% fresh and redefine the address, email, and website information blocks however you may wish.
+% fresh and redefine the info blocks however you may wish.
%
% \subsection{Additional user commands}
% \DescribeMacro{\dash} For `smart' dashes in text. Thinly spaced from the text, it ignores surrounding spaces, and permits only succeeding line breaks.
@@ -370,7 +384,7 @@
% convenience:
% \begin{multicols}{2}\everypar{\parindent0pt\parskip0pt}
% \def\showlogo#1{\@for\@ii:=#1\do{\expandafter\cmd\@ii:\hfill\@ii\endgraf}}
-% \showlogo{\noexpand\TeX,\LaTeX,\LaTeXe,\BibTeX,\MF,\MP,
+% \noindent\showlogo{\noexpand\TeX,\LaTeX,\LaTeXe,\BibTeX,\MF,\MP,
% \ConTeXt,\pdfTeX,\pdfLaTeX,\XeTeX,\ExTeX,\PracTeX,\TPJ,\PS}
% \end{multicols}
% \endgroup
@@ -482,16 +496,21 @@
% may be deemed negligible in the future.
%
% \changes{v0.3}{2004/01/03}{AO: rewrite using \cs{IfFileExists} idiom.}
-% \changes{v0.4e}{2005/08/22}{WR: requires the textcomp package.}
+% \changes{v0.4e}{2005/08/22}{WR: requires the textcomp package}
% \changes{v0.4g}{2005/11/04}{WR: use \pkg{microtype}, if available}
+% \changes{v0.4l}{2006/08/14}{WR: use LM fonts if available, with T1 encoding}
%
% The \pkg{textcomp} package is loaded in order to provide a nice looking copyright logo, amongst other things.
%
% \begin{macrocode}
+\IfFileExists{lmodern.sty}{%
+ \RequirePackage{lmodern}
+ \usepackage[T1]{fontenc}}{}
\IfFileExists{mathpazo.sty}
{\RequirePackage[sc]{mathpazo}}
{\renewcommand\rmdefault{ppl}}
-\IfFileExists{microtype.sty}{\RequirePackage[protrusion=true,expansion=false]{microtype}}{}
+\IfFileExists{microtype.sty}{%
+ \RequirePackage[protrusion=true,expansion=false]{microtype}}{}
\RequirePackage{textcomp}
% \end{macrocode}
% \pkg{hyperref} is used for creating live hyperlinks, as well as
@@ -504,10 +523,12 @@
linkcolor=linkcolour,citecolor=linkcolour,
filecolor=linkcolour, urlcolor=linkcolour}
% \end{macrocode}
+% \TODO{update this to use the successor to the switcheml package}
% 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.
@@ -539,7 +560,7 @@
% \begin{macrocode}
\renewcommand\maketitle{\par
\iftpj@noabstract\else
- \@ifx@undefined{\tpj@info@Abstract}
+ \@ifx@undefined{\tpj@info@\string\abstract}
{\ClassError{pracjourn}
{Please specify an \string\abstract\space before \string\maketitle}
{It is a PracTeX Journal requirement to include an abstract. \MessageBreak
@@ -594,7 +615,7 @@
\tpj@optional@author@info
\iftpj@noabstract\else
\vspace{2ex}%
- \tpj@info@container{Abstract}
+ \tpj@info@container{\abstractname}{\abstract}
\fi}
% \end{macrocode}
% \end{macro}
@@ -608,7 +629,7 @@
% \begin{macro}{\subparagraph}
% 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.
+% bunch of \cmd\bfseries's omitted. \TODO{just use titlesec instead}
% \begin{macrocode}
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
@@ -639,8 +660,10 @@
% \begin{environment}{itemize}
% \begin{environment}{enumerate}
% \begin{environment}{description}
+% \TODO{just use enumitem instead}
% Decrease the amount of vertical space between items in the list environments. To do this, save the old environment macros under new names, and then change the `real' environments to call the originals plus some space-adjusting parameters.
%
+%
% Note that description lists shouldn't contain more than on paragraph.
% \begin{macrocode}
\let\tpj@itemize\itemize
@@ -689,15 +712,15 @@
% \paragraph{Footnotes}
% Here we change the footnote formatting a little bit from the default.
% \begin{macro}{\@makefntext}
-% \changes{v0.4f}{2005/10/06}{WR: Removed the footnote superscript}
-% \changes{v0.4g}{2005/11/01}{WR: Added a period after the footnote number}
% Make the footnote number at the bottom of the page not a superscript (recommended by Bringhurst, if you're curious---the superscript is there originally to get the number out of the way, but that's no longer needed when you're labelling the note with the number).
% \begin{macrocode}
-\renewcommand\@makefntext[1]{%
- \parindent 1.8em%
- \noindent
- \hb@xt@1.8em{\hbox{\strut\normalfont\small\@thefnmark.}\hss}#1}
+\def\@makefntext#1{%
+ \parindent 0em\relax
+ \makebox[1.5em][l]{\normalfont\footnotesize\@thefnmark.}#1}
% \end{macrocode}
+% \changes{v0.4f}{2005/10/06}{WR: Removed the footnote superscript.}
+% \changes{v0.4g}{2005/11/01}{WR: Added a period after the footnote number.}
+% \changes{v0.4l}{2006/08/05}{WR: Fixed number \& text size difference. Oops. Removed \cmd\strut\ to allow \textsf{bigfoot} compatibility.}
% \end{macro}
%
% \subsection{TPJ additions}
@@ -819,12 +842,34 @@
% \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}}}
+ \def\@tempa{\new@addinfo{#1}{#2}}%
+ \lowercase{\expandafter\@tempa\expandafter{\csname#2\endcsname}}}
+\newcommand\new@addinfo[3]{%
+ \tpj@define@info@block{#3}%
+ \expandafter\newcommand
+ \csname\expandafter\@gobble\string#3name\endcsname{#2}%
+ \g@addto@macro\tpj@optional@author@info{%
+ \tpj@info@container[#1]{\csname\expandafter\@gobble\string#3name\endcsname}{#3}}}
+% \end{macrocode}
+% \changes{v0.4d}{2005/07/30}{WR: Name change to user-space.}
+% \end{macro}
+%
+% \begin{macro}{\newinfo}
+% E.g., |\newinfo\resume[\resfont]{R\'esum\'e}|
+% \begin{macrocode}
+\newcommand\newinfo[1]{%
+ \@ifnextchar[{\@newinfo{#1}}{\@newinfo{#1}[]}}
+\def\@newinfo#1[#2]#3{%
+ \tpj@define@info@block{#1}%
+ \expandafter\newcommand
+ \csname\expandafter\@gobble\string#1name\endcsname{#3}%
+ \g@addto@macro\tpj@optional@author@info{%
+ \tpj@info@container[#2]{%
+ \csname\expandafter\@gobble\string#1name\endcsname}{#1}}}
% \end{macrocode}
+% \changes{v0.4n}{2007/08/13}{WR: A better \cmd\addinfo}
% \end{macro}
%
% \begin{macro}{\addinfospace}
@@ -838,20 +883,16 @@
% \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}.
+% title block of the article.
%
-% All commands are defined \cmd\long\ so that paragraphs are
-% allowed. This is much easier than
+% This is much easier (but uglier, in hindsight |:(| ) 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}}}
+\newcommand\tpj@define@info@block[1]{%
+ \newcommand#1[1]{\expandafter\def\csname tpj@info@\string#1\endcsname{##1}}}
% \end{macrocode}
+% \changes{v0.4n}{2007/08/13}{Change for better info blocks}
% \end{macro}
%
% \begin{macro}{\clearinfo}
@@ -885,7 +926,9 @@
% The abstract block itself is called directly in \cmd{\@maketitle}.
%
% \begin{macrocode}
-\tpj@define@info@block{Abstract}
+\let\abstract\relax
+\tpj@define@info@block\abstract
+\def\abstractname{Abstract}
% \end{macrocode}
%
% \begin{macro}{\noabstract}
@@ -969,7 +1012,7 @@
% document text.\footnote{\LaTeX's \cmd\@hangfrom\ (or whatever it is) could well
% have been much easier.} 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
+% retrieve the actual data from the |\tpj@info@#3| macro (see
% \cmd{\addinfo}).
%
% An optional argument is used as a hook to typeset the info data in
@@ -977,7 +1020,7 @@
%
% 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
+% |\addinfo{Abstract}{\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}|.
@@ -986,31 +1029,30 @@
% \changes{v0.4d}{2005/06/29}{WR: Warn if a title block command is used after \cmd\maketitle.}
%
% \begin{macrocode}
-\newcommand\tpj@info@container[2][]{%
+\newcommand\tpj@info@container[3][]{%
% \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}{}}
+ \gdef#3{\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
+ \expandafter\ifx\csname tpj@info@\string#3\endcsname\relax\else
+ \noindent\small
% \end{macrocode}
% On the left, right-aligned sans serif item label, e.g., `Abstract':
% \begin{macrocode}
- \begin{minipage}[t]{0.1\textwidth}
+ \begin{minipage}[t]{0.15\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}
+ \begin{minipage}[t]{0.825\textwidth}
\linespread{1.0}\selectfont
\setlength\parindent{1.5em}%
\noindent\ignorespaces
- \expandafter#1\expandafter{\csname tpj@info@#2\endcsname}
+ \expandafter#1\expandafter{\csname tpj@info@\string#3\endcsname}
\end{minipage}\par
\fi}
% \end{macrocode}
@@ -1111,6 +1153,18 @@
%
% \subsubsection{Logos}
%
+% \begin{macro}{\tpf@deflogo}
+% Wrapper for both \cmd\DeclareRobustCommand\ and \cmd\pdfstringdefDisableCommand.
+% \begin{macrocode}
+\newcommand\tpj@deflogo{\@dblarg\tpj@@deflogo}
+\newcommand\tpj@@deflogo[3][\@nil]{%
+ \expandafter\DeclareRobustCommand\csname#2\endcsname{#3}%
+ \pdfstringdefDisableCommands{%
+ \expandafter\def\csname#2\endcsname{#1}}}
+% \end{macrocode}
+% \changes{v0.4m}{2006/11/19}{WR: Implemented to improve logo/hyperref handling.}
+% \end{macro}
+%
% \changes{v0.4a}{2005/06/05}{WR: Incorporated code from \pkg{texnames}
% and \pkg{mflogo}.}
%
@@ -1121,10 +1175,10 @@
% so on, right?} of \texttt{texnames.sty}, v1.10, tuned for Palatino
% and adapted to use \cs{textsc} where appropriate:
% \begin{macrocode}
-\DeclareRobustCommand\TeX{T\kern-.15em\lower.5ex\hbox{E}\kern-.07em X\spacefactor1000\relax}
-\DeclareRobustCommand\LaTeX{L\kern-.32em\raise.37ex\hbox{\scalebox{0.76}{A}}\kern-.15em\TeX}
-\DeclareRobustCommand\LaTeXe{\LaTeX2$_{\textstyle\varepsilon}$}
-\DeclareRobustCommand\BibTeX{B{\textsc i\kern-.025em\textsc b}\kern-.08em\TeX}
+\tpj@deflogo{TeX}{T\kern-.15em\lower.5ex\hbox{E}\kern-.07em X\spacefactor1000\relax}
+\tpj@deflogo{LaTeX}{L\kern-.32em\raise.37ex\hbox{\scalebox{0.76}{A}}\kern-.15em\TeX}
+\tpj@deflogo{LaTeXe}{\LaTeX2$_{\textstyle\varepsilon}$}
+\tpj@deflogo{BibTeX}{B{\textsc i\kern-.025em\textsc b}\kern-.08em\TeX}
% \end{macrocode}
% And now \texttt{mflogo.sty}, unchanged in its entirety:
% \begin{macrocode}
@@ -1132,8 +1186,8 @@
\not@math@alphabet\logofamily\relax
\fontencoding{U}\fontfamily{logo}\selectfont}
\DeclareTextFontCommand{\textlogo}{\logofamily}
-\DeclareRobustCommand\MF{\textlogo{META}\@dischyph\textlogo{FONT}\@}
-\DeclareRobustCommand\MP{\textlogo{META}\@dischyph\textlogo{POST}\@}
+\tpj@deflogo[MetaFont]{MF}{\textlogo{META}\@dischyph\textlogo{FONT}\@}
+\tpj@deflogo[MetaPost]{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
@@ -1143,16 +1197,16 @@
% 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}
-\DeclareRobustCommand\ConTeXt{C\kern-.03em on\-\kern-.10em\TeX\kern-0.04em t}%
-\DeclareRobustCommand\pdfTeX{pdf\/\TeX}
-\DeclareRobustCommand\pdfLaTeX{pdf\/\LaTeX}
-\DeclareRobustCommand\PS{PostScript}
-\DeclareRobustCommand\PracTeX{Prac\kern-0.07em\TeX}
-\DeclareRobustCommand\TPJ{The \PracTeX\ Journal}
-\DeclareRobustCommand\XeTeX{%
+\tpj@deflogo{ConTeXt}{C\kern-.03em on\-\kern-.10em\TeX\kern-0.04em t}%
+\tpj@deflogo{pdfTeX}{pdf\/\TeX}
+\tpj@deflogo{pdfLaTeX}{pdf\/\LaTeX}
+\newcommand\PS{PostScript}
+\tpj@deflogo{PracTeX}{Prac\kern-0.07em\TeX}
+\newcommand\TPJ{The \PracTeX\ Journal}
+\tpj@deflogo{XeTeX}{%
X\lower.5ex\hbox{\kern-.07em\reflectbox{E}}%
\kern-.15em\TeX}
-\DeclareRobustCommand\ExTeX{\textrm{\relax
+\tpj@deflogo{ExTeX}{\textrm{\relax
\ensuremath{\textstyle\varepsilon_{\kern-0.15em\mathcal{X}}}\relax
\kern-.15em\TeX}}
% \end{macrocode}