home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Education Sampler 1992 [NeXTSTEP]
/
Education_1992_Sampler.iso
/
Mathematics
/
TeX
/
TeXsis-2.15
/
TXSmemo.tex
< prev
next >
Wrap
Text File
|
1992-08-04
|
13KB
|
308 lines
% file: TXSmemo.tex TeXsis version 2.15
% $Revision: 15.1 $ : $Date: 92/05/31 21:30:08 $ : $Author: myers $
%======================================================================*
% This is a set of TeX macros for producing simple memos.
% The sytnax is:
%
% \MemoFormat (or simply \memo in TeXsis)
% \to <name>
% \from <name>
% \subj <whatever the memo is about> or \re is same as \subj
% \date <date of memo>
% \text
% <text of memo>
% \bye
%
%----------------------------------------------------------------------*
\message{Memo Format.}
% ---------- Counters and such:
\newdimen\memoindent \memoindent=2.54cm % indent for \to, \from, etc.
\newdimen\firstheadoffset % \headlineoffset for first page only
\firstheadoffset=0pt % start with headline down for \ORGANIZATION
% ---------- Initialization: Memo document format for memoranda
\def\Memo{\ContentsSwitchfalse% % no table of contents
\refswitchfalse % no reference list
\inittexsis % initialize TeXsis
\MemoFormat}% % Setup using \MemoFormat
\def\memo{\Memo} % synonym
\def\MemoFormat{%
\voffset=0.125truein % top margin
\hsize=6.5truein % width of text
\raggedbottom %
\advance \vsize by -\voffset % subtract \voffset from vertical size
\nopagenumbers % no footlines
\let\makeheadline=\makememhed % alternate way of making
\headline={\MemoHeadline}% % headlines for memos
\RunningHeadstrue % default
\headlineoffset=0.8cm % raise all following headlines
\firstheadoffset=0pt % start with headline down for
\def\subjectline{}% % start with this null
\def\nopagenumbers{\RunningHeadsfalse}% redefine \nopagenumbers
\def\pagenumbers{\RunningHeadstrue}%% and \pagenumbers for this document
\twelvepoint % default is 12pt
\quoteon % enable easy quotes
\def\annotations{\annotatememo}% % annotations for memo
\def\cc{\ccmemo}% % carbon copy for memo
\def\Encl{\enclmemo}% % enclosure for memo
\def\ps{\psmemo}% % post script for memo
\def\endmode{\relax}% % for first item
\def\to{\ifmmode\rightarrow\else\To\fi}%
\let\text=\memotext % enable \text
\let\Text=\memotext % \Text is a synonym
\let\body=\memotext % \body is synonym for \text
\memoheader % do headher at top
}
% \ORGANIZATION names your institution. Replace it with whatever you
% want for your own institution.
\def\ORGANIZATION{\hbox{\space}} % change this in TXSsite.tex!
% \memoheader prints the word MEMORANDUM at the top of the page and
% sets up for \to, \from, etc...
\def\memoheader{% % banner for top of first page
\pageno=1 % begin on page 1
\centerline{\fourteenpoint % 14 pt type centered
M E M O R A N D U M}% %
\bigskip\bigskip % space
\relax}% %
%---------------------------------------
% new def of \makeheadline for MEMOFORMAT, uses \firstheadoffset
\def\makememhed{\vbox to 0pt{\vskip-22.5pt
\ifnum\pageno>1\vskip-\headlineoffset
\else\vskip-\firstheadoffset\fi
\line{\vbox to 8.5pt{}\the\headline}\vss}\nointerlineskip}%
% \MemoHeadline prints the subject and page number at the top of each page
\def\MemoHeadline{% headline for Memoranda
\ifnum\pageno>1 % if not first page...
\ifRunningHeads % running headlines on top of page?
{\tenrm\subjectline\hfil Page~\folio}% % print subject line and page #
\else % no running headlines?
{\hfil}% % then nothing
\fi
\else % On the first page do header
{\hfil\twelvess\ORGANIZATION\hfil}% print name of organization
\fi}%
%-----------------------------------------------------------------------
% \memoitem is the basic template for each field
\def\memoitem#1{\endmode % end previous field
\def\endmode{\par\endgroup}% % set up to end the field
\begingroup % begin a new field
\parskip=0pt % no \parskip
\singlespaced % no big space if several lines
\medskip\noindent % skip down a bit
\hangindent=\memoindent % hanging indentation
\hangafter=1 % after first line
\hbox to \memoindent{{\tenss #1}\hfil}% label the field
\nobreak}% % don't break after label
\def\endmode{\relax} % for first item
%---------------------------------------
% TO: and FROM:
\def\To{\memoitem{TO:}}
\def\TO:{\To}
\def\From{\memoitem{FROM:}}
\def\FROM:{\From}
\def\from{\From}
%---------------------------------------
% CC: (Carbon Copies)
\def\ccmemo{\endmode
\def\endmode{\vskip0pt\endgroup}%
\bigskip % skip down a bit
\begingroup\obeylines % obey line ends
\parskip=0pt % no skip between items
\ccitem{cc:\ }%
}
\def\CC{\cc}
% ---------- \ccitem does the work for \cc and other end of memo fields
\def\ccitem#1{\setbox0\hbox{#1\quad}% % box0 = argument
\parindent=\wd0 % get its width
\hang % hanging indentation
\rlap{\copy0}% % and write it
\vskip-\baselineskip\relax}% % kill the skip
% ---------- \Distribution is like CC (\obeyines format)
\def\distribution{\endmode
\def\endmode{\vskip0pt\endgroup}%
\bigskip %
\begingroup\obeylines % obey line ends
\def\n{\par}% % break lines at \n
\parskip=0pt %
\ccitem{Distribution:}%
}
\def\Distribution{\distribution}% % synonym
% ---------- \enclmemo is also like \cc (obeylines format)
\def\enclmemo{\endmode %
\def\endmode{\vskip0pt\endgroup}% %
\bigskip % skip down a bit
\begingroup\obeylines % obey line ends
\parskip=0pt % no skip between items
\ccitem{Encl:\ }%
}
% ---------- \annotatememo is \annotations for memo format
\def\annotatememo{\endmode % end previous item
\def\endmode{\vskip0pt\endgroup}% % set up new ending
\begingroup % changes local
\nobreak\bigskip\nobreak % skip some
\parindent=0pt\parskip=0pt % no indent or skip
\obeylines}% % obey line endings
% ---------- \psmemo does \ps for a memo
\def\psmemo{\endmode % end previous item
\def\endmode{\vskip0pt\endgroup}% % set up ending
\begingroup % start a group
\nobreak\bigskip\nobreak % skip some
\interlinepenalty 5000 % avoid breaks
\def\par{\endgraf\penalty 5000}}% % avoid breaks
%---------------------------------------
% SUBJECT: and RE: (saves first line in \subjectline for tops of pages)
\def\subjectitem#1{\endmode % close previous field
\def\endmode{\relax}% % turn off \endmode before going to \memoitem
\gdef\@subjtype{#1}% % label the field
\begingroup\obeylines % obeylines is on to get first subject line
\getsubject}% % get first line
\def\Subj{\subjectitem{SUBJECT:}}%
\def\SUBJ{\subjectitem{SUBJECT:}}%
\def\subj{\subjectitem{SUBJECT:}}%
\def\subject{\subjectitem{SUBJECT:}}%
\def\Subject{\subjectitem{SUBJECT:}}%
\def\re{\subjectitem{RE:}}%
\def\RE{\subjectitem{RE:}}%
% \getsubject gets the first line in the field in \subjectline
% for use in the headline at the top of pages following
{\obeylines % first line of subject is \subjectline
\gdef\getsubject#1
{\endgroup % end \obeylines
\gdef\subjectline{#1} % define \subjectline as the first line
\memoitem{\@subjtype}\subjectline\space}% print SUBJECT: line
}% close obeylines
%---------------------------------------
% \date takes what follows on the same line and uses it as the
% date of the memo. If nothing follows then today's date is used.
% It is important for the date, if given, to be on the same line as \date.
\def\Date{\endmode % close previous field
\def\endmode{\relax}% % turn off \endmode before going to \memoitem
\begingroup\obeylines %
\getdate} % get the date, or use today's
\def\DATE{\Date} % synonym
\def\date{\Date}
{\obeylines % look for a given date
\gdef\getdate#1
{\endgroup % close \obeylines
\ifx?#1?\relax % if no date given, use today's
\gdef\memodate{\number\day\ \monthname{\month}\ \number\year}%
\else %
\gdef\memodate{#1} % if date is given, use it
\fi %
\memoitem{DATE:}\memodate}% %
}% close \obeylines for definitions
\def\monthname#1{\ifcase #1 \errmessage{0 is not a month.}
\or January\or February\or March\or April\or May\or
June\or July\or August\or September\or October\or
November\or December%
\else \errmessage{#1 is not a month.}\fi}
%---------------------------------------
% TEXT: \text sets up for text of memo
\def\memotext{\endmode % close last item
\def\endmode{\bigskip\vfil}% % \endmode is now blank space
\bigskip\bigskip % skip down for text
\parskip=\normalbaselineskip % \parskip is one blank line
\noindent % like a letter
}
\def\text{\memotext} % start with \text = \memotext
\def\Text{\memotext} % \Text is a synonym
% use \endmemo to end a memo, especially if you use \CC or similar.
\def\endmemo{\endmode\vfill\eject\end} % ends CC: etc, then quits
%=======================================================================
% Referee format for Referee Reports
%
\def\Referee{\ContentsSwitchfalse % no table of contents
\auxswitchfalse % no need for an .AUX file
\refswitchfalse % no reference list
\inittexsis % initialize
\RefReptFormat} % Setup using \MemoFormat
\def\referee{\Referee}% % synonym
\def\RefReptFormat{%
\voffset = 0.125 true in % top margin
\hsize = 6.5 true in % width of text
\raggedbottom %
\advance \vsize by -\voffset % subtract \voffset from vertical size
\nopagenumbers % no footlines
\headlineoffset=0.8cm % raise all following headlines
\firstheadoffset=0pt % start with headline down for
\let\makeheadline=\makememhed %
\def\ORGANIZATION{{\fourteenpoint\bf Referee Report}}% change \ORGANIZATION
\def\subjectline{Referee Report}% % running head is ``Referee Report''
\headline={\MemoHeadline}% % just like a memo
\def\nopagenumbers{\RunningHeadsfalse}% redefine \nopagenumbers
\def\pagenumbers{\RunningHeadstrue}%% and \pagenumbers for this document
\twelvepoint % default is 12pt
\singlespaced\whitespaced % widely spaced, but not double
\parskip=\baselineskip % extra space between paragraphs
\def\endmode{\relax}% % for first item
\quoteon % enable easy quotes
\def\to{\ifmmode\rightarrow\else\To\fi}%
\def\From{\RefFrom}% % say something about \From
\let\text=\memotext %
\let\body=\memotext %
\def\authors{\memoitem{AUTHORS:}}%
\def\author{\memoitem{AUTHOR:}}%
\def\title{\subjectitem{TITLE:}}%
\def\MSref{\memoitem{MANUSCRIPT:}}%
\def\manuscript{\@obsolete\manuscript\MSref\memoitem{MANUSCRIPT:}}%
\def\Number{\memoitem{NUMBER:}}%
\hbox{\space}\bigskip} % space down from top a bit.
\def\RefFrom{\begingroup\obeylines % obeylines to get first subject line
\getFrom}% % get first line
{\obeylines % look for line endings
\gdef\getFrom#1
{\endgroup % end \obeylines
\emsg{> Reminder: Referee Reports are usually anonymous. This one says...}%
\emsg{FROM: #1}% % say something about FROM
\memoitem{From:}#1\space}% % but do it anyway
} % close obeylines
%>>> EOF TXSmemo.tex <<<