diff options
Diffstat (limited to 'Master/texmf-dist/tex/csplain/opmac')
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/opmac.tex | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/csplain/opmac/opmac.tex b/Master/texmf-dist/tex/csplain/opmac/opmac.tex index bea5cdb51e7..d7ada7a3d28 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{Sep. 2013} +\def\OPmacversion{Oct. 2013} \immediate\write16{This is OPmac (Olsak's Plain macros), version <\OPmacversion>} @@ -29,11 +29,9 @@ \def\sdef#1{\expandafter\def\csname#1\endcsname} \def\sxdef#1{\expandafter\xdef\csname#1\endcsname} -\def\adef#1{\lccode`\~=`#1\catcode`#1=13 - \afterassignment\lccodetiezero - \lowercase{\def~}% +\def\adef#1{\catcode`#1=13 + \bgroup \lccode`\~=`#1\lowercase{\egroup\def~}% } -\def\lccodetiezero{\lccode`\~=0 } \def\isdefined #1#2{\expandafter\ifx \csname#1\endcsname \relax \csname iffalse\expandafter\endcsname @@ -122,23 +120,22 @@ \opwarning{csplain version <Nov. 2012> or later is recommended} % macros from csplain, file csfontsm.tex: \font\tenbi=csbxti10 \def\bi{\tenbi} - \def\sizespec{} - \def\resizefont #1{\expandafter - \font\expandafter#1\expandafter\resizefontskipat\fontname#1 \relax} - \def\regfont#1{\expandafter\def\expandafter\resizeall\expandafter{% - \resizeall \resizefont#1}} + \def\letfont#1#2{\ifx#2=\expandafter\letfont\expandafter#1\else + \expandafter\font\expandafter#1\expandafter\rfontskipat\fontname#2 \relax\space \fi} + \def\rfontskipat#1{\ifx#1"\expandafter\rfskipatX\else\expandafter\rfskipatN\expandafter#1\fi} + \def\rfskipatX #1" #2\relax{"\whichtfm{#1}"} \def\rfskipatN #1 #2\relax{\whichtfm{#1}} + \def\sizespec{} \def\whichtfm#1{#1} + \def\resizefont#1{\letfont#1#1\sizespec} + \def\regfont#1{\expandafter\def\expandafter\resizeall\expandafter{\resizeall \resizefont#1}} \def\resizeall{} \regfont\tenrm \regfont\tenit \regfont\tenbf \regfont\tenbi \regfont\tentt \fi -\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 +\ifx\normalmath\undefined \input ams-math \fi % ams-math.tex is in csplain package + {\lccode`\?=`\p \lccode`\!=`\t \lowercase{\gdef\ignorept#1?!{#1}}} \def\typosize[#1/#2]{\fontsizex[#1]\setbaselineskip[#2]\ignorespaces} @@ -153,7 +150,7 @@ \fi } \def\textfontsize[#1]{\if$#1$\else - \fontdim=#1\ptunit + \fontdim=#1\ptunit \ifx\fontdimB\undefined \edef\fontdimB{\the\fontdim}\fi \let\dgsize=\fontdim \edef\sizespec{at\the\fontdim}% \resizeall \rm \let\dgsize=\undefined @@ -161,7 +158,8 @@ } \def\setbaselineskip[#1]{\if$#1$\else \tmpdim=#1\ptunit - \baselineskip=\tmpdim \relax + \baselineskip=\tmpdim \relax + \ifx\baselineskipB\undefined \edef\baselineskipB{\the\baselineskip}\fi \bigskipamount=\tmpdim plus.33333\tmpdim minus.33333\tmpdim \medskipamount=.5\tmpdim plus.16666\tmpdim minus.16666\tmpdim \smallskipamount=.25\tmpdim plus.08333\tmpdim minus.08333\tmpdim @@ -173,11 +171,11 @@ } \def\withoutunit#1#2{\expandafter#1\expandafter[\expandafter\ignorept\the#2]} -\def\fontscalex[#1]{\if$#1$\else - \tmpdim=#1pt \divide\tmpdim by1000 +\def\fontscalex[#1]{\if$#1$\else \ifnum#1=1000 \else + \tmpdim=3277sp \tmpdim=#1\tmpdim \divide\tmpdim by50 \tmpdim=\expandafter\ignorept\the\tmpdim \fontdim \withoutunit\fontsizex\tmpdim - \fi + \fi\fi } \def\textfontscale[#1]{\if$#1$\else \tmpdim=#1pt \divide\tmpdim by1000 @@ -185,11 +183,11 @@ \withoutunit\textfontsize\tmpdim \fi } -\def\scalebaselineskip[#1]{\if$#1$\else - \tmpdim=#1pt \divide\tmpdim by1000 +\def\scalebaselineskip[#1]{\if$#1$\else \ifnum#1=1000 \else + \tmpdim=3277sp \tmpdim=#1\tmpdim \divide\tmpdim by50 \tmpdim=\expandafter\ignorept\the\tmpdim \baselineskip \withoutunit\setbaselineskip\tmpdim - \fi + \fi\fi } \def\thefontsize[#1]{% \expandafter\let \expandafter\thefont \the\font @@ -203,6 +201,10 @@ } \def\magstep#1{\ifcase#1 1000\or1200\or1440\or1728\or2074\or2488\fi\space} +\def\typobase{\ifx\baselineskipB\undefined \def\baselineskipB{12pt}\fi + \ifx\fontdimB\undefined \def\fontdimB{10pt}\fi + \baselineskip=\baselineskipB\relax \fontdim=\fontdimB\relax +} \def\em {\expandafter\ifx \the\font \tenit \additcorr \rm \else \expandafter\ifx \the\font \tenbf \bi\aftergroup\afteritcorr\else \expandafter\ifx \the\font \tenbi \additcorr \bf \else @@ -308,10 +310,10 @@ \titfont \noindent #1\unskip\par}% \nobreak\bigskip } -\def\titfont{\typoscale[\magstep4/\magstep4]\bf} -\def\chapfont{\typoscale[\magstep3/\magstep3]\bfshape} -\def\secfont{\typoscale[\magstep2/\magstep2]\bfshape} -\def\seccfont{\typoscale[\magstep1/\magstep2]\bfshape} +\def\titfont{\typobase\typoscale[\magstep4/\magstep4]\bf} +\def\chapfont{\typobase\typoscale[\magstep3/\magstep3]\bfshape} +\def\secfont{\typobase\typoscale[\magstep2/\magstep2]\bfshape} +\def\seccfont{\typobase\typoscale[\magstep1/\magstep2]\bfshape} \def\bfshape{\let\tenit=\tenbi \boldmath \bf} \newcount\chapnum \newcount\secnum \newcount\seccnum \newcount\nonumnum @@ -949,7 +951,7 @@ } \def\pdfborder#1{\if^#1^\else \isdefined{#1border}\iftrue - \if^\csname#1border\endcsname^\else attr{/C[\csname#1border\endcsname] /Border[0 0 1]}% + \if^\csname#1border\endcsname^\else attr{/C[\csname#1border\endcsname] /Border[0 0 .6]}% \fi\fi\fi } @@ -1080,11 +1082,11 @@ \ifx\savedttchar\undefined\else \catcode\savedttchar=\savedttcharc \fi \chardef\savedttchar=`#1% \chardef\savedttcharc=\catcode`#1% - \lccode`\~=`#1 - \lowercase {\def~}{\leavevmode\hbox\bgroup\setverb\adef{ }{ }% + \bgroup\lccode`\~=`#1% + \lowercase {\egroup\def~}{\leavevmode\hbox\bgroup\setverb\adef{ }{ }% \intthook\tt\readverb}% - \lowercase{\def\readverb ##1~}{##1\egroup}% - \lccode`\~=0 \catcode\savedttchar=13 + \bgroup\lccode`\~=`#1\lowercase{\egroup\def\readverb ##1~}{##1\egroup}% + \catcode`#1=13 } \def\verbinput (#1) #2 {\par \def\tmpa{#2}% @@ -1289,7 +1291,7 @@ \iflocfnum \leavevmode\openref\wref\Xfnote{}% \isdefined{fn:\the\fnotenum}\iftrue \else\opwarning{unknown \noexpand\fnote mark. TeX me again}\fi\fi - \fnmarkx{\typoscale[800/800]\vfootnote\fnmarkx{#1}}% + \fnmarkx{\typobase\typoscale[800/800]\vfootnote\fnmarkx{#1}}% } \def\fnotemark#1{{\advance\fnotenum by#1\relax \isdefined{fn:\the\fnotenum}\iftrue\thefnote @@ -1510,7 +1512,7 @@ \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \def\doprotect#1{\let#1=\relax} -\addto\begoutput{\def\nl{ }} +\addto\begoutput{\def\nl{ }\def\fnote##1{}\def\fnotemark##1{}} \def\prepage{\destheight=25pt \dest[pg:\the\pageno]} {\catcode`\@=11 @@ -1649,6 +1651,11 @@ Sep. 2013 \label: the ``duplicated label'' test added \addprotect\exfont (for exchars.tex cooperating) \ulink improved and added to opmac-u \postboxcclv: {\advancepageno} corrected +Oct. 2013 /Border .6 + better \adef + \typobase introduced + \typoscale[20000/] ``too large dimension'' ... solved + \activettchar reimplemented %%%%%%%%%%%%%% End of opmac.tex |