summaryrefslogtreecommitdiff
path: root/macros/plain/contrib/misc/scmac.tex
blob: e1b641465a79958cc953f99412c30ef67ee641ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

%% scmac.tex
%% TeX macros for typesetting scripts version 2.00
%% Copyright (C) 1989 by Na Choon Piaw
%% This file may be freely used, distributed, and modified provided
%% credit is given to the original author.  You can even try to sell it,
%% assuming someone's willing to pay for this, of course.

%% This is a major rewrite --- hence, no change update is given.
%% For more information see the user's documentation.

%% tell user what version

\immediate\write16{Loading scmac version 2.00 Beta release ...}

%% fonts --- Use Computer Modern.  Substitute these with local
%%           equivalents if no Computer Modern.
\font\bigtenrm=cmr10 scaled\magstep2	%% big font for title
\font\rm=cmr10				%% standard roman text
\font\bf=cmbx10				%% for bold
\font\sl=cmsl10				%% slanted text
\font\it=cmti10				%% italics

%% variable declarations
\newcount\fnotecnt
\newcount\FootNoteStyle
\newcount\Style
\newwrite\auxfile
\fnotecnt=1
\FootNoteStyle=1			%% "true" footnotes
\Style=1

%% preamble handling
\def\Title{}
\def\transl{}
\def\oth{}
\def\cpmessage{}
\def\heading#1{\global\headline={\bf #1 \hfil Page \folio}}
\def\translator#1{\edef\transl{\noindent\it Translation by #1.\hfil}}
\def\others#1{\edef\oth{\noindent\it #1.\hfil}}
\footline={\hfil}

%% open auxilary file.
\immediate\openout\auxfile=\jobname.aux

%% Environments
\def\beginscript{
	\Title
	\cpmessage
	\transl
	\oth
	%% Open output file for footnotes
	%% Can your wordprocessor do this?
}

\def\endscript{
\immediate\closeout\auxfile
\ifnum\FootNoteStyle=1
	\relax
\else
	%% read in from aux file.
	\bigskip
	\filbreak
	\line{\bf Footnotes\hfil}
	\openin 1 = \jobname.aux
	\readfootnotes
\fi
}

%% songs
\def\beginsong{\bigskip\begingroup\obeylines\narrower}
\def\endsong{\par\endgroup\bigskip}

\def\readfootnotes{
%% recursive TeX macro!  Can WordPerfect do this?
\def\temp{}
\ifeof 1
	\relax
\else
	\read 1 to \temp
	\ifeof 1
		\relax
	\else
		\item{[\temp]}
		\read 1 to \temp
		\temp
		\readfootnotes
	\fi
\fi
}

%% describe and desc are unchanged.
\def\describe#1{\sl #1 \medskip\goodbreak}
\def\desc#1{\it (#1\/)\rm}

%% footnoting
\def\fnote#1{\ifnum\FootNoteStyle=1				
%% footnotes at bottom of page
 	\footnote{$^{\the\fnotecnt}$}{\rm #1}
\else 
%% new-style typeinto aux file  for readback
%% remember to change the \hskip value for different fonts!
	$^{\the\fnotecnt}$ \hskip -0.15in
	\immediate\write\auxfile{\the\fnotecnt}
	\immediate\write\auxfile{#1}
\fi
\global\advance\fnotecnt by 1
}

%% unavoidable processing
\ifnum\Style=1
        %% old style: version 1.xx
	\gdef\say#1#2{
		\centerline{\bf #1}
		{
			\parindent=1in
			\rm\narrower\raggedright\noindent
			#2
			\par
		}
		\bigskip\goodbreak
	}
\else
	%% version 2.xx
	\gdef\say#1:#2\par{
		\centerline{\bf #1}
		{
			\parindent=1in
			\rm\narrower\raggedright\noindent
			#2
			\par
		}
		\bigskip\goodbreak
	}
\fi