summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/csplain/opmac/opmac.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/csplain/opmac/opmac.tex')
-rw-r--r--Master/texmf-dist/tex/csplain/opmac/opmac.tex68
1 files changed, 38 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/csplain/opmac/opmac.tex b/Master/texmf-dist/tex/csplain/opmac/opmac.tex
index 89cceb21682..a365fea689b 100644
--- a/Master/texmf-dist/tex/csplain/opmac/opmac.tex
+++ b/Master/texmf-dist/tex/csplain/opmac/opmac.tex
@@ -5,7 +5,7 @@
%% The history of versions is at the end of this file, after \endpinput
\ifx\OPmacversion\undefined \else \endinput \fi
-\def\OPmacversion{Jul. 2013}
+\def\OPmacversion{Aug. 2013}
\immediate\write16{This is OPmac (Olsak's Plain macros), version <\OPmacversion>}
@@ -132,9 +132,10 @@
\regfont\tenrm \regfont\tenit \regfont\tenbf \regfont\tenbi \regfont\tentt
\fi
-\input ams-math % ams-math.tex is in csplain package Nov. 2012 or later
-
-\def\resizefontskipat#1 #2\relax{\whichtfm{#1} \sizespec\relax}
+\ifx\normalmath\undefined \input ams-math \fi % ams-math.tex is in csplain package
+\ifx\whichtfm\undefined \else
+ \def\resizefontskipat#1 #2\relax{\whichtfm{#1} \sizespec\relax}
+\fi
\newdimen\ptunit \ptunit=1pt
\newdimen\fontdim \fontdim=10pt
@@ -156,7 +157,7 @@
\fontdim=#1\ptunit
\let\dgsize=\fontdim
\edef\sizespec{at\the\fontdim}%
- \resizeall \rm
+ \resizeall \rm \let\dgsize=\undefined
\fi
}
\def\setbaselineskip[#1]{\if$#1$\else
@@ -194,7 +195,7 @@
\def\thefontsize[#1]{%
\expandafter\let \expandafter\thefont \the\font
\def\sizespec{at#1\ptunit}\def\dgsize{#1\ptunit}\resizefont\thefont
- \thefont \ignorespaces
+ \thefont \let\dgsize=\undefined \ignorespaces
}
\def\thefontscale[#1]{%
\tmpdim=#1pt \divide\tmpdim by1000
@@ -389,14 +390,14 @@
\parfillskip=0pt plus2fil
\def\par{\endgraf\egroup}%
\captionhook{#1}\noindent
- {\def\destheight{2.1em}\wlabel{\csname the#1num\endcsname}}%
+ {\destheight=2.1em \wlabel{\csname the#1num\endcsname}}%
\printcaption{\mtext{#1}}{\csname the#1num\endcsname}%
}
\def\printcaption#1#2{{\bf#1 #2}\enspace}
\def\eqmark{\global\advance\dnum by1
\ifinner\else\eqno \fi
- {\def\destheight{2.1em}\wlabel\thednum}\thednum
+ {\destheight=2.1em \wlabel\thednum}\thednum
}
%%%%%%%%%%%%%% Items -- sec. 3.10 in opmac-d.pdf
@@ -453,7 +454,7 @@
\opwarning{\noexpand\maketoc -- data unavailable, TeX me again}\openref
\else \toclist \fi}
-\def\toclinkA#1{\def\tmp##1!##2\end{\if&##1&\kern.8em \else##1\fi}\tmp#1!\end}
+\def\toclinkA#1{\def\tmp##1!##2\end{\if^##1^\kern.8em \else##1\fi}\tmp#1!\end}
%%%%%%%%%%%%%% Index -- sec. 3.12 on opmac-d.pdf
@@ -538,11 +539,11 @@
\orippx \global\let\act=\undefined \global\let\orippx=\undefined
\fi
}
-\def\printiipages#1&{#1\par}
+\def\printiipages#1&{ #1\par}
\def\prepii #1{\isinlist \iispeclist #1\iftrue
- \expandafter\expandafter\expandafter \printii \csname\string#1\endcsname&
- \else \expandafter\prepiiA\string #1&
+ \expandafter\expandafter\expandafter \printii \csname\string#1\endcsname&%
+ \else \expandafter\prepiiA\string #1&%
\fi
}
\def\prepiiA #1#2#3&{\printii#3&}
@@ -550,18 +551,17 @@
\def\iis #1 #2{\bgroup \def~{ }%
\global\expandafter\addto\expandafter\iispeclist\csname,#1\endcsname
\global\sdef{\expandafter\string\csname,#1\endcsname}{#2}%
- \egroup
+ \egroup \ignorespaces
}
\def\iispeclist{}
\def\printii #1&{\gdef\currii{#1}\noindent\everyii
\hskip-\iindent \ignorespaces\printiiA#1//}
-\def\printiiA #1/{\if$#1$\expandafter\printiiB\else
- \expandafter\scanprevii\previi/&\gdef\tmpb{#1}%
+\def\printiiA #1/{\if^#1^\let\previi=\currii \else
+ \expandafter\scanprevii\previi/&\def\tmpb{#1}\edef\tmpb{\meaning\tmpb}%
\ifx\tmpa\tmpb \iiemdash \else#1 \gdef\previi{}\fi
\expandafter\printiiA\fi
}
-\def\printiiB{\let\previi=\currii}
\def\iiemdash{\kern.1em---\space}
\def\everyii{}
@@ -574,7 +574,7 @@
\global\leftskip=\iindent
}
-\def\scanprevii#1/#2&{\def\previi{#2}\def\tmpa{#1}}
+\def\scanprevii#1/#2&{\def\previi{#2}\def\tmpa{#1}\edef\tmpa{\meaning\tmpa}}
\def\previi{} % previous index item
@@ -910,6 +910,7 @@
%%%%%%%%%%%%%% Hyperrefs -- sec. 3.16 in opmac-d.pdf
+\newdimen\destheight \destheight=1.3em
\def\destactive[#1:#2]{\if$#2$\else\ifvmode
\tmpdim=\prevdepth \prevdepth=-1000pt
\destbox[#1:#2]\prevdepth=\tmpdim
@@ -917,7 +918,6 @@
\fi\fi
}
\def\destbox[#1]{\vbox to0pt{\kern-\destheight \pdfdest name{#1} xyz\vss}}
-\def\destheight{1.3em}
\def\dest[#1]{}
\def\link[#1:#2]#3#4{\leavevmode\pdfstartlink height.9em depth.3em
@@ -945,8 +945,8 @@
\def\urlcolor{\longlocalcolor#2}%
}
-\def\pdfborder#1{\if$#1$\else \isdefined{#1border}\iftrue
- \if$\csname#1border\endcsname$\else
+\def\pdfborder#1{\if^#1^\else \isdefined{#1border}\iftrue
+ \if^\csname#1border\endcsname^\else
attr{/C[\csname#1border\endcsname] /Border[0 0 1]}%
\fi\fi\fi
}
@@ -957,7 +957,7 @@
\def\hyperlinks#1#2{}
\fi
-\def\url#1{\def\tmpb{#1}%
+\def\url#1{{\def\tmpb{#1}%
\replacestrings{//}{\urlskip\urlslashslash\urlbskip}%
\replacestrings{/}{\urlskip/\urlbskip}%
\replacestrings{.}{\urlskip.\urlbskip}%
@@ -971,7 +971,7 @@
\replacestrings{\}}{\char`\} }%
\replacestrings{&}{\urlbskip\char`\& \urlskip}%
\ulink[url:#1]{\urlfont\tmpb}%
-}
+}}
\def\urlfont{\tt}
\def\urlskip{\null\nobreak\hskip0pt plus0.05em\relax}
\def\urlbskip{\penalty100 \hskip0pt plus0.05em\relax}
@@ -1317,14 +1317,14 @@
\openref\wref\Xmnote{}%
\expandafter\ifx\tmp \left
\hbox to0pt{\kern-\mnotesize \kern-\mnoteindent
- \vbox to0pt{\vss \setbox0=\vtop{%
- \hsize=\mnotesize \leftskip=0pt plus 1fill \relax \mnotehook \noindent#1}%
- \dp0=0pt \box0 \kern\mnoteskip \global\mnoteskip=0pt}\hss}%
+ \vbox to0pt{\vss \setbox0=\vtop{\hsize=\mnotesize
+ \leftskip=0pt plus 1fill \rightskip=0pt \relax \mnotehook \noindent#1}%
+ \dp0=0pt \box0 \kern\mnoteskip \global\mnoteskip=0pt}\hss}%
\else
\hbox to0pt{\kern\hsize \kern\mnoteindent
- \vbox to0pt{\vss \setbox0=\vtop{%
- \hsize=\mnotesize \rightskip=0pt plus 1fil \relax \mnotehook \noindent#1}%
- \dp0=0pt \box0 \kern\mnoteskip \global\mnoteskip=0pt}\hss}%
+ \vbox to0pt{\vss \setbox0=\vtop{\hsize=\mnotesize
+ \rightskip=0pt plus 1fil \leftskip=0pt \relax \mnotehook \noindent#1}%
+ \dp0=0pt \box0 \kern\mnoteskip \global\mnoteskip=0pt}\hss}%
\fi
}
\def\Xmnote{\advance\mnotenum by1
@@ -1508,7 +1508,7 @@
}
\def\doprotect#1{\let#1=\relax}
\addto\begoutput{\def\nl{ }}
-\def\prepage{\def\destheight{25pt}\dest[pg:\the\pageno]}
+\def\prepage{\destheight=25pt \dest[pg:\the\pageno]}
{\catcode`\@=11
\gdef\pagecontents{\prepage % dest of pageno
@@ -1621,10 +1621,18 @@ Jul. 2013 \fnotetext unwanted space - corrected
\othe\secnum in \secc removed
\dotocnum, \remskip, \reminsert introduced
\nonum, \notoc implemented
- \destheight introduced
+ \destheight introduced as macro
\runningfnotes introduced
\addto defined as \long
\iiskip, \ttskip, \bibskip precedes by \par
+Aug. 2013 \dgsize corrected
+ \ifx\tmpa\tmpb in \printiiA is realized via \meaning
+ \ignorespaces included to \iis
+ \url hidden in group, in order to handle & in tables
+ \destheight rewritten as a dimen register
+ \rightskip, \leftskip corrected in \mnote
+ space corrected in \prepii
+ \input ams-math only if \normalmath is \undefined
%%%%%%%%%%%%%% End of opmac.tex