summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/s-ptj-01.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/s-ptj-01.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/s-ptj-01.tex166
1 files changed, 77 insertions, 89 deletions
diff --git a/Master/texmf-dist/tex/context/base/s-ptj-01.tex b/Master/texmf-dist/tex/context/base/s-ptj-01.tex
index 188af73bd7e..9990bf00615 100644
--- a/Master/texmf-dist/tex/context/base/s-ptj-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-ptj-01.tex
@@ -1,29 +1,29 @@
%D \module
%D [ file=s-ptj-01,
-%D version=2006.11.28,
+%D version=2009.12.18,
%D title=\CONTEXT\ Style File,
%D subtitle=PracTeX Journal Style,
%D author=Aditya Mahajan,
%D email=adityam at umich dot edu,
%D date=\currentdate,
-%D copyright=2006 Aditya Mahajan]
+%D copyright=2009 Aditya Mahajan]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
%M % These macros are needed to compile the documentation.
-%M \def\PracTeX{Prac\kern-0.07em\TeX}
-%M \def\PRACTEX{\PracTeX}
-%M \def\TPJ {The \PRACTEX\ Journal}
-%M \useurl[TPJ][http://www.tug.org/pracjourn/][][\TPJ]
-%M \useurl[texgyre][http://www.gust.org.pl/projects/e-foundry/tex-gyre/]
+%M \def\PracTeX {Prac\kern-0.07em\TeX}
+%M \def\PRACTEX {\PracTeX}
+%M \def\pracjourn {The \PRACTEX\ Journal}
+%M \useurl[pracjourn][http://www.tug.org/pracjourn/][][\pracjourn]
+%M \useurl[texgyre] [http://www.gust.org.pl/projects/e-foundry/tex-gyre/]
\writestatus {loading} {Context Module for the PracTeX Journal}
-%D This module is for producing acticles for \from[TPJ]. It merely copies the
+%D This module is for producing acticles for \from[pracjourn]. It merely copies the
%D layout of the the \LATEX\ class \filename{pracjourn.cls} available from
-%D \TPJ\ website (\url[TPJ]). This module has a filename synonym
+%D \pracjourn\ website (\url[pracjourn]). This module has a filename synonym
%D \filename{pracjourn}. So to use this module, you can write:
%D \starttyping
%D \usemodule[pracjourn]
@@ -42,8 +42,8 @@
\unprotect
-%D First let's setup the paper size and layout for \TPJ. I am actually not
-%D sure about the \quote{official} layout requirement for \TPJ\ and have
+%D First let's setup the paper size and layout for \pracjourn. I am actually not
+%D sure about the \quote{official} layout requirement for \pracjourn\ and have
%D reverse engineered the layout from the typeset \LATEX\ examples. If you
%D feel that anything is wrong here, please let me know.
@@ -68,32 +68,16 @@
footerdistance=.25in,
]
-%D Next we do the font setup. \TPJ\ uses mathpazo for roman and math faces and
+%D Next we do the font setup. \pracjourn\ uses mathpazo for roman and math faces and
%D uses latin modern for sans serif and monotype. For the main face, 12pt is
%D used with a 15.5pt baseline skip. Font protrusion is enabled, but font
-%D expansion is not. We follow these conventions, but use Pagella fonts from
-%D \TEX{gyre} project, and scale latin modern fonts by 1.1 for better
-%D matching. Right now, the \TEX{gyre} fonts are not distributed with
-%D \CONTEXT. They can be downloaded from \url[texgyre]. Most of the numbers
-%D (page numbers, figure numbers, section numbers) are set in oldstyle.
+%D expansion is not. We follow these conventions. \CONTEXT\ uses Pagella fonts
+%D from \TEX{gyre} project, so we use them instead.
\usetypescript [serif,sans,mono] [hanging] [pure]
\setupalign [hanging]
-
-\usetypescriptfile
- [type-gyr]
-
-\definetypeface
- [mainface] [rm] [serif] [palatino] [default] [encoding=texnansi]
-\definetypeface
- [mainface] [ss] [sans] [modern] [default] [encoding=texnansi, rscale=1.1]
-\definetypeface
- [mainface] [tt] [mono] [modern] [default] [encoding=texnansi, rscale=1.1]
-\definetypeface
- [mainface] [mm] [math] [palatino] [default] [encoding=texnansi]
-
-\setupbodyfont
- [mainface,12pt]
+\usetypescript [palatino][encoding=texnansi]
+\setupbodyfont [palatino,12pt]
\definefont [titlefont] [Regular at 20pt]
\definefont [authorfont] [Regular at 14pt]
@@ -164,11 +148,10 @@
after={\blank[big]}]
%D Next we define internal frames to take care of the layout of the extra
-%D material in the title. These start with \type|do...| to prevent clash with
-%D user macros. (I do not like writing @ in macro names).
+%D material in the title.
\defineframed
- [doinfotitle]
+ [pracjourninfotitle]
[ frame=off,
strut=yes,
width=0.1\textwidth,
@@ -178,7 +161,7 @@
]
\defineframed
- [doinfodetails]
+ [pracjourninfodetails]
[ frame=off,
strut=yes,
width=0.85\textwidth,
@@ -187,27 +170,27 @@
location=hanging,
]
-\newif\iftitleskipdone
+\newif\ifpracjourntitleskipdone
-\def\doadditionalinfo#1#2
- {\titleskipdonetrue
+\def\pracjourninfo#1#2%
+ {\pracjourntitleskipdonetrue
\hbox to \textwidth
\bgroup
- \hfill \doinfotitle{#1}
- \hfill \doinfodetails{#2}
+ \hfill \pracjourninfotitle{#1}
+ \hfill \pracjourninfodetails{#2}
\egroup\endgraf}
%D Now we take care of the actual layout of the title. Most of this is
%D heuristic, as I was trying to get the same visual effect as the
%D \filename{pracjourn.cls} class. If something does not match, please let me
-%D know. The additional information is typeset as
+%D know. The information is typeset as
%D \starttyping
%D \hfill <box of .1\textwidth> \hfill <box of .85\textwidth>
%D \stoptyping
%D at 11pt size. We also add the title and author information in the \PDF\
%D metadata.
-\startrawsetups [title]
+\startsetups [title]
% Place the tile and the author
\title{\getvariable{pracjourn}{title}}
\blank[medium]
@@ -217,36 +200,42 @@
% Place the additional information
\bgroup\switchtobodyfont[11pt]
\setupindenting[no]
- \doifdefined{\v!file:::email}
- {\doadditionalinfo{Email}{\tttf\from[email]\relax}}
- \doifdefined{\v!file:::website}
- {\doadditionalinfo{Website}{\from[website]\relax}}
+ \doifurldefinedelse{email}
+ {\pracjourninfo{Email}{\tttf\from[email]\relax}}
+ \empty
+ \doifurldefinedelse{website}
+ {\pracjourninfo{Website}{\from[website]\relax}}
+ \empty
\doifsomething{\getvariable{pracjourn}{address}}
- {\doadditionalinfo{Address}{\getvariable{pracjourn}{address}}}
- \iftitleskipdone \blank[big] \fi
- \doadditionalinfo{Abstract}%
- {\setupindenting[yes]%
- \setupinterlinespace%
+ {\pracjourninfo{Address}{\getvariable{pracjourn}{address}}}
+ \ifpracjourntitleskipdone \blank[big] \fi
+ \pracjourninfo{Abstract}
+ {\setupindenting[yes]
+ \setupinterlinespace
\getbuffer[abstract]
\endgraf}
\egroup
\blank[big]
+ \setups{pracjourndate}
+ % Add information to pdfmetadata
+ \setupinteraction
+ [title={\getvariable{pracjourn}{title}},
+ author={\getvariable{pracjourn}{author}},
+ subtitle={The PracTeX Journal Article}]
+\stopsetups
+
% If revision number is present, write it to \filename{_rev.tex}
% FIXME: Do we need to ensure that the dates and month are two digits?
+\startrawsetups [pracjourndate]
\doifsomething{\getvariable{pracjourn}{revision}}
{\expanded{\setvariables[pracjourn:date][y=,m=,d=,\getvariable{pracjourn}{revision}]}
\immediate\openout \scratchwrite _rev.tex
\immediate\write \scratchwrite
{\getvariable{pracjourn:date}{y}/\getvariable{pracjourn:date}{m}/\getvariable{pracjourn:date}{d}}
\immediate\closeout\scratchwrite}
-% Add information to pdfmetadata
- \setupinteraction
- [title={\getvariable{pracjourn}{title}},
- author={\getvariable{pracjourn}{author}},
- subtitle={The PracTeX Journal Article}]
\stoprawsetups
-%D Next we setup the header and footer for the first page. \TPJ\ formats the
+%D Next we setup the header and footer for the first page. \pracjourn\ formats the
%D header as
%D \startlines
%D The PracTeX Journal, year, No. number
@@ -255,32 +244,38 @@
%D If a copyright notice is present, it is printed right aligned on the bottom
%D of first page. Otherwise the footer on the first page is empty.
-\startlocalsetups [titleheader]
+\startsetups [pracjourntitleheader]
\framed[frame=off,width=\textwidth,align=normal,location=low]
{\small\setupinterlinespace
- \doifelsenothing{\TPJissue}{For submission to \TPJ}{\TPJissue}\endgraf
+ \doifelsenothing{\pracjournissue}
+ {For submission to \pracjourn}
+ {\pracjournissue}
+ \endgraf
\doifelsenothing{\getvariable{pracjourn}{revision}}
- {Draft of \currentdate[year,/,mm,/,dd]}
- {Article revision\space
- \expanded{\date[\getvariable{pracjourn}{revision}][year,/,mm,/,dd]}}
- \endgraf}
-\stoplocalsetups
+ {Draft of \currentdate[year,/,mm,/,dd]}
+ {Article revision\space
+ \expanded{\date[\getvariable{pracjourn}{revision}][year,/,mm,/,dd]}}
+ \endgraf}
+\stopsetups
-\startlocalsetups [titlefooter]
+\startsetups [pracjourntitlefooter]
\framed[frame=off,width=\textwidth,align=flushright,location=low]
- {\small\setupinterlinespace
- \getvariable{pracjourn}{copyright}\endgraf}
-\stoplocalsetups
+ {\small\setupinterlinespace \getvariable{pracjourn}{copyright}\endgraf}
+\stopsetups
-\definetext [titleheader] [header] [\setups{titleheader}][]
-\definetext [titlefooter] [footer] [\setups{titlefooter}]
-\setuphead [title] [header=titleheader,footer=titlefooter]
+\definetext [pracjourntitleheader] [header] [\setups{pracjourntitleheader}][]
+\definetext [pracjourntitlefooter] [footer] [\setups{pracjourntitlefooter}]
+
+\setuphead
+ [title]
+ [header=pracjourntitleheader,
+ footer=pracjourntitlefooter]
%D For rest of the pages, page number is printed on the middle of the footer.
\setuppagenumbering [location={footer,middle}, style=mediaeval]
-%D Next we setup the formating for the sections. \TPJ\ wants font sizes of
+%D Next we setup the formating for the sections. \pracjourn\ wants font sizes of
%D 17pt, 14pt, and 12pt respectively for section, subsection, and
%D subsubsection. By default, \tex{tfa} is 1.2, \tex{tfb} is 1.4, so the sizes
%D come out close to what is required. The section number is typset in
@@ -329,7 +324,7 @@
\def\pracjournfootnote#1{\hbox to 1.5em{#1.}}
-%D \TPJ\ uses dash as the first level of itemize and text period as the second
+%D \pracjourn\ uses dash as the first level of itemize and text period as the second
%D level. The third level is left unspecified.
\definesymbol [1] [{\symbol[dash]}]
@@ -338,13 +333,6 @@
\setupitemize [each] [packed]
\setupitemize [1] [packed,autointro] [margin=1em]
-%D We change \type|\type| so that the argument inside \type|\type| is pretty
-%D printed using \TEX's patterns. Another command \type|\normaltype| can be
-%D used if you do not want the original \type|\type|.
-
-\setuptype [option=TEX]
-\definetype [normaltype] [option=none]
-
%D We enable colors, interaction and bookmarks.
\setupinteraction [state=start,color=darkred,style=normal]
@@ -358,13 +346,13 @@
\setupwhitespace [medium]
\setupblank [medium]
-%D We define logos for \PRACTEX\ and \TPJ. These definitions are copied from
+%D We define logos for \PRACTEX\ and \pracjourn. These definitions are copied from
%D \filename{pracjourn.cls} and can be accessed by \type|\PracTeX|,
-%D \type|\PRACTEX| and \type|\TPJ|.
+%D \type|\PRACTEX| and \type|\pracjourn|.
\def\PracTeX{Prac\kern-0.07em\TeX}
\def\PRACTEX{\PracTeX}
-\def\TPJ {The \PRACTEX\ Journal}
+\def\pracjourn {The \PRACTEX\ Journal}
%D \filename{pracjourn.cls} provides two macros \type|\ctanfile| and
%D \type|\ctanloc|. I am not sure what is the advantage of these macors. If
@@ -372,22 +360,22 @@
%D \CONTEXT. For example
%D \starttyping
%D \useURL[pracjourn][http://ctan.org/get?fn=/macros/contrib/latex/pracjourn][][\mono{CTAN:macros/contrib/latex/pracjourn}]
-%D The \LATEX\ style files for \TPJ\ is localed at \from[pracjourn]
+%D The \LATEX\ style files for \pracjourn\ is localed at \from[pracjourn]
%D \stoptyping
%D For the final version of the paper, the string \quotation{The PracTeX
%D Journal year, No x} is written on the header. This only happens when the
%D current directory contains a file \filename{_iss.tex} which contains string
-%D like \quotation{TPJ 2006 No 04, 2006-11-15}. This step is usually taken in
+%D like \quotation{pracjourn 2006 No 04, 2006-11-15}. This step is usually taken in
%D the final production of the article. If this file is absent, \quotation{For
%D submission to the PracTeX Journal} is written instead. The next macros are
%D used to parse this file.
-\let\TPJissue\empty
+\let\pracjournissue\empty
-\def\parse@iss TPJ #1 No #2, #3-#4-#5\@nil%
+\def\parse@iss pracjourn #1 No #2, #3-#4-#5\@nil%
{\!!counta#2\relax
- \edef\TPJissue{\TPJ, #1, No.\,\the\!!counta}}
+ \edef\pracjournissue{\pracjourn, #1, No.\,\the\!!counta}}
%D Read the \filename{_iss.tex} file, if present to determine the current
%D issue.