% \iffalse \ProvidesFile %======================================================================== {PREPRINT.DTX} %======================================================================== % %% Copyright 1993-2004 Patrick W Daly %% Max-Planck-Institut f\"ur Sonnensystemforschung (prev. Aeronomie) %% Max-Planck-Str. 2 %% D-37191 Katlenburg-Lindau %% Germany %% E-mail: daly@mps.mpg.de %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN %% archives in directory macros/latex/base/lppl.txt; either %% version 1 of the License, or any later version. %% %% This is a contributed file to the LaTeX2e system. %======================================================================== % There are 2 things that may be done with this file: % 1. LaTeX it directly to get the coding documentation % 2. Docstrip it (using batch job PREPRINT.INS) to make files % -- prepman.tex (the users manual, LaTeX2e) % -- preprint.sty (a style file for LaTeX 2.09) % -- preprint.cls (a class file for LaTeX2e) % -- preprint.drv (a driver file to print the documentation) % (not really needed, because of point 1) % % Only parts of the manual are included in the documentation. Those parts % that are NOT included are to be found between iffalse .. fi guards. % % Docstrip options: % style :- to produce the main style file preprint.sty for LaTeX 2.09 % class :- to produce a class file preprint.cls for LaTeX2e % manual :- to produce a .tex file, the users manual. % driver :- to extract a docstrip driver file that prints the % documentation of this file %------------------------------------------------------------------- % %\DeclareOption{ms}{\@drafttrue} %\DeclareOption{draft}{\@drafttrue} % \end{macrocode} % % \subsubsection*{Standard and Null Options} % We have to handle the options \texttt{twoside}, \texttt{twocolumn}, % and \texttt{titlepage} as in \texttt{article}. (Since the |\if@titlepage| % flag is set to \meta{false} in \texttt{article}, a different flag must be % used here. The other flags are not set there and may be used directly.) % Options \texttt{a4}, \texttt{a4in}, \texttt{a4wide}, % and \texttt{secnum} are provided for consistency with other styles but do % nothing. Actually, \texttt{a4} normally reads in a file \texttt{a4.sty}, % which we do not want here. % % For the \LaTeXe, we also want to turn off \texttt{a4paper}. % \begin{macrocode} %<*style> \def\ds@twocolumn{\@twocolumntrue} \def\ds@twoside{\@twosidetrue \@mparswitchtrue} \newif\if@titpg \@titpgfalse \def\ds@titlepage{\@titpgtrue} \@namedef{ds@a4}{\typeout{Option `a4' not necessary}} \@namedef{ds@a4in}{\typeout{Option `a4in' not necessary}} \@namedef{ds@a4wide}{\typeout{Option `a4wide' not necessary}} % %<*class> \DeclareOption{a4}{\typeout{Option `a4' not necessary}} \DeclareOption{a4in}{\typeout{Option `a4in' not necessary}} \DeclareOption{a4wide}{\typeout{Option `a4wide' not necessary}} \DeclareOption{a4paper}{\typeout{Option `a4paper' not necessary}} % % \end{macrocode} % % \subsubsection*{Extra Options} % The new options that do things are \texttt{nosecnum} (to turn off % section numbering) and \texttt{full} (to read in all the other options in % the \texttt{preprint} collection). Both just set a flag for later usage. % \begin{macrocode} %<*style> \def\ds@nosecnum{\@secnumfalse} \def\ds@secnum{\@secnumtrue} \def\ds@full{\@fulltrue} % %<*class> \DeclareOption{secnum}{\@secnumtrue} \DeclareOption{nosecnum}{\@secnumfalse} \DeclareOption{full}{\@fulltrue} \DeclareOption{bw}{\PassOptionsToPackage{bw}{mpshead}} \newif\if@MPS \@MPStrue \DeclareOption{mpae}{\@MPSfalse} \DeclareOption{mps}{\@MPStrue} % % \end{macrocode} % % \subsubsection*{Invoke Options} % Now for \LaTeX~2.09, invoke the options with |\@options|, and then % redefine that command to |\relax| so that it is not called again by {\tt % article}. The |\@@input| command is stored and redefined so that no files % are read in by \texttt{article}. % \begin{macrocode} %<*style> \@options \let\@options=\relax \let\oriinput=\@@input \def\@@input#1\relax{\relax} \oriinput article.sty \let\@@input=\oriinput % \end{macrocode} % % Now set |\@ptsize| and |\if@titlepage| to the intermediate commands % |\@ptsz| and |\@titpg|, and then read % in the \texttt{art1\textit{n}.sty} file with the size-specific % definitions. % \begin{macrocode} \let\@ptsize=\@ptsz \let\if@titlepage=\if@titpg \input art1\@ptsize.sty\relax % % \end{macrocode} % % For \LaTeXe, the situation is much simpler. Pass unused options over to % \texttt{article}, execute the defaults, and then process the selected % options before loading the main class \texttt{article}. % % In compatibility mode, the paper size options are not activated; hence % the \texttt{a4paper} option must not be issued. Page sizes are explicitly % set later. % \begin{macrocode} %<*class> \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ExecuteOptions{secnum} \ProcessOptions \if@compatibility \LoadClass{article} \else \LoadClass[a4paper]{article} \fi % % \end{macrocode} % % \subsection{Modify the \texttt{article} Specifications} % Now start changing the things set by \texttt{article} and % \texttt{art1\textit{n}.sty} or \texttt{size1\textit{n}.clo}. % % \subsubsection*{Changes for a Manuscript} % The \texttt{ms} option is for a manuscript. This will never be with % two columns and will always have a title page. Furthermore, it is % double-spaced. % \begin{macrocode} \if@draft \@twocolumnfalse \@titlepagetrue \def\baselinestretch{1.4} \typeout{Draft manuscript} \fi % \end{macrocode} % % \subsubsection*{Section Numbering} % Suppress section numbering if flag |\if@secnum| has been set. This is % done by setting the counter \texttt{secnumdepth} to 0. % \begin{macrocode} \setcounter{secnumdepth}{\if@secnum 3 \else 0\fi} % \end{macrocode} % % \subsubsection*{Sectioning Commands} % \begin{macro}{\section} % \begin{macro}{\subsection} % \begin{macro}{\subsubsection} % \begin{macro}{\paragraph} % \begin{macro}{\subparagraph} % The major changes are that |\section| centers its title, with % |\large\bfseries| instead of |\Large\bfseries|; other levels use % |\slshape| in place of % |\bfseries| and tend to be in a smaller font than used by \texttt{article}. % \begin{macrocode} \def\section{\@startsection {section}{1}{\z@}{-2.5ex plus -.5ex minus -.2ex}{1ex plus .1ex}{\reset@font\large\bfseries\centering}} \def\subsection{\@startsection{subsection}{2}{\z@}{-2.25ex plus -.5ex minus -.2ex}{1ex plus .1ex}{\reset@font\normalsize\bfseries}} \def\subsubsection{\@startsection{subsubsection}{3}{\parindent}{2.25ex plus .5ex minus .2ex}{-1em}{\reset@font\normalsize\slshape}} \def\paragraph{\@startsection {paragraph}{4}{\parindent}{2.25ex plus .5ex minus .2ex}{-1em} {\reset@font\normalsize\slshape}} \def\subparagraph{\@startsection {subparagraph}{5}{\parindent}{2.25ex plus .5ex minus .2ex} {-1em}{\reset@font\normalsize\slshape}} % \end{macrocode} % \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} % % \subsubsection*{Plate Environment} % \begin{macro}{\plate} % Add a \texttt{plate} environment, parallel to \texttt{figure}. % \begin{macrocode} \newcounter{plate} \def\theplate{\@arabic\c@plate} \def\fps@plate{tbp} \def\ftype@plate{4} \def\ext@plate{lop} \def\plate{\@float{plate}} \let\endplate\end@float \@namedef{plate*}{\@dblfloat{plate}} \@namedef{endplate*}{\end@dblfloat} % \end{macrocode} % \end{macro} % \begin{macro}{\listofplates} % Include a |\listofplates| command like |\listoffigures|. % \begin{macrocode} \def\listofplates{\section*{\listplatename \@mkboth{\uppercase{\listplatename}}{\uppercase{\listplatename}}}% \@starttoc{lop}} \let\l@plate\l@figure % \end{macrocode} % \end{macro} % \begin{macro}{\platename} % \begin{macro}{\listplatename} % Add name commands for plates. % \begin{macrocode} \def\platename{Plate} \def\listplatename{List of Plates} % \end{macrocode} % \end{macro}\end{macro} % % \subsubsection*{Fix up Float Captions} % Print the words `Figure' and `Plate' in bold in the captions; for two % column mode, print them small. % \begin{macrocode} \if@twocolumn \def\fnum@figure{\reset@font\small{\bfseries \figurename~\thefigure}} \def\fnum@plate{\reset@font\small{\bfseries \platename~\theplate}} \else \def\fnum@figure{\reset@font\normalsize{\bfseries \figurename~\thefigure}} \def\fnum@plate{\reset@font\normalsize{\bfseries \platename~\theplate}} \fi \def\fnum@table{\reset@font{\bfseries \tablename~\thetable}} % \end{macrocode} % \begin{macro}{\@makecaption} % Modification to |\@makecaption|, to use period in place of colon. % \begin{macrocode} \long\def\@makecaption#1#2{ \vskip 1em \setbox\@tempboxa\hbox{#1. #2} \@tempdima\wd\@tempboxa \ifdim \@tempdima >\hsize #1. #2\par \else \hbox to\hsize{\hfil\box\@tempboxa\hfil} \fi} % \end{macrocode} % \end{macro} % % \subsubsection*{Page Styles} % \begin{macro}{\ps@myheadings} % Change the \texttt{myheadings} and \texttt{headings} page styles to use % small caps in place of italics. % \begin{macrocode} \def\ps@myheadings{\let\@mkboth\@gobbletwo \def\@oddhead{\hfil{\scshape\rightmark} \hfil {\rmfamily\thepage}}% \def\@oddfoot{}\def\@evenhead{{\rmfamily \thepage}\hfil {\scshape\leftmark}\hfil}% \def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}} % \end{macrocode} % \end{macro} % % \begin{macro}{\ps@headings} % \changes{6.2}{1995 Jan 08}{Center text, the same as in \texttt{myheadings}} % Do the same for \texttt{headings}; however, many automatic entries are % done with |\uppercase|, something that must be suppressed if small caps % are used. Add |\scnuc| to do this (``small caps no upper case''). % \begin{macrocode} \if@twoside \def\ps@headings{\let\@mkboth\markboth \def\@oddfoot{}\def\@evenfoot{}% \def\@evenhead{{\rmfamily\thepage}\hfil {\scnuc \leftmark}\hfil}% \def\@oddhead{\hfil{\scnuc \rightmark}\hfil {\rmfamily\thepage}}% \def\sectionmark##1{\markboth {\ifnum \c@secnumdepth >\z@ \thesection\hskip 1em\relax \fi ##1}{}}% \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne \thesubsection\hskip 1em\relax \fi ##1}}} \else \def\ps@headings{\let\@mkboth\markboth \def\@oddfoot{}\def\@evenfoot{}% \def\@oddhead{{\scnuc \rightmark}\hfil {\rmfamily\thepage}}% \def\sectionmark##1{\markright{\ifnum \c@secnumdepth >\z@ \thesection\hskip 1em\relax \fi ##1}}} \fi \def\scnuc{\let\uppercase=\relax\scshape} % \end{macrocode} % \end{macro} % % \subsubsection*{Two Column Changes} % In standard \texttt{article}, the style file \texttt{twocolum.sty} is % read in when \texttt{twocolumn} has been selected. This has been % suppressed in the style, so some of the modifications in that file are % made here. % \begin{macrocode} %<*style> \if@twocolumn \sloppy \flushbottom \parindent 1em \leftmargini 2em \leftmarginv .5em \leftmarginvi .5em \fi % % \end{macrocode} % % \subsubsection*{Title Page Check} % In standard \texttt{article}, the style file \texttt{titlepag.sty} is % read in when \texttt{titlepage} has been selected. This has been % suppressed, but this is not serious if \texttt{mpshead} is chosen, % either directly or through the option \texttt{full}. However, without it, % there will be no title page. There, read in \texttt{titlepag.sty} just to % be safe. Later \texttt{mpshead.sty} can overwrite it. (Not needed for % the class.) % \begin{macrocode} % % \end{macrocode} % This algorithm is used by standard \texttt{article}, but really only % makes sense when |\baselinestretch| is 1.0. % % Here we add the \texttt{fullpage} package for \LaTeXe. % In compatibility mode, set the paper sizes explicitly % \begin{macrocode} %<*class> \if@compatibility \setlength\paperheight {297mm} \setlength\paperwidth {210mm} \fi \RequirePackage[in,myheadings]{fullpage} % % \end{macrocode} % % \subsection{New Command: Two Column Test} % \begin{macro}{\iftwocol} % Formatting of equations or figures is often to be different for one or % two column modes. This test allows alternative text to be inserted % depending on the mode. % \begin{macrocode} \def\iftwocol#1#2{\if@twocolumn #1\else #2\fi} % \end{macrocode} % \end{macro} % % \subsection{Input the Full Set of Options} % The option \texttt{full} stands for the full set of \texttt{preprint} % options. Up to 6 other files are read in, depending on other options. % I might consider making this standard some day. % \begin{macrocode} \if@full % \end{macrocode} % The option to print an MPAe/MPS logo and header with the title, and to % place the abstract over two columns in \texttt{twocolumn} mode. % \begin{macrocode} %<*class> \if@MPS \RequirePackage{mpshead}[2004/07/06] \else % % % \end{macrocode} % % Call the default font (to invoke |\baselinestretch|) and select the % default page style to be \texttt{myheadings}. For |twocolumn|, call % |\flushbottom| to line up the bottom lines. % \begin{macrocode} \reset@font\normalsize \pagestyle{myheadings} \if@twocolumn \flushbottom \else \raggedbottom \fi \if@twoside \flushbottom \fi % % \end{macrocode} % % \Finale