diff options
Diffstat (limited to 'Master/texmf-dist/tex/csplain/opmac/opmac.tex')
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/opmac.tex | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/csplain/opmac/opmac.tex b/Master/texmf-dist/tex/csplain/opmac/opmac.tex index 767fa843c72..a643ce92856 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{Dec. 2014c} +\def\OPmacversion{Apr. 2015} \immediate\write16{This is OPmac (Olsak's Plain macros), version <\OPmacversion>} %%%%%%%%%%%%%% Basic macros, sec. 3.1 in opmac-d.pdf @@ -54,7 +54,7 @@ \let\\=\undefined {\lccode`\?=`\% \lowercase{\gdef\percent{?}}} {\lccode`\?=`\\ \lowercase{\gdef\bslash{?}}} -\def\,{\ifmmode \mskip\thinmuskip \else \thinspace \fi} +\def\,{\relax\ifmmode \mskip\thinmuskip \else \thinspace \fi} \addprotect\percent \addprotect\bslash \addprotect\, \addprotect\exfont \bgroup \catcode`!=3 \catcode`?=3 @@ -343,22 +343,28 @@ \def\chap#1\par{\ifnonum\else \global\advance\chapnum by1 \fi \chaphook {\globaldefs=1 \secnum=0 \seccnum=0 \tnum=0 \fnum=0 \dnum=0}\relax \edef\thechapnum{\the\chapnum}\let\thetocnum=\thechapnum - \def\dotocnumafter{\wcontents\Xchap{#1}}% + \def\dotocnumafter{\wtotoc0\bfshape{#1}}% \printchap{#1\unskip}\resetnonumnotoc } \def\sec#1\par{\ifnonum\else \global\advance\secnum by1 \fi \sechook {\globaldefs=1 \seccnum=0 \tnum=0 \fnum=0 \dnum=0}\relax \edef\thesecnum{\othe\chapnum.\the\secnum}\let\thetocnum=\thesecnum - \def\dotocnumafter{\wcontents\Xsec{#1}}% + \def\dotocnumafter{\wtotoc1\rm{#1}}% \printsec{#1\unskip}\resetnonumnotoc } \def\secc#1\par{\ifnonum\else \global\advance\seccnum by1 \fi \secchook {}\relax \edef\theseccnum{\othe\chapnum.\the\secnum.\the\seccnum}\let\thetocnum=\theseccnum - \def\dotocnumafter{\wcontents\Xsecc{#1}}% + \def\dotocnumafter{\wtotoc2\rm{#1}}% \printsecc{#1\unskip}\resetnonumnotoc } -\def\wcontents#1#2{% #1: sequence to REF, #2: titletext +\def\wtotoc#1#2#3{% #1 = level, #2 = info, #3 = titletext + \ifnotoc\else + \def\act{\wref{\Xtoc{#1}{\noexpand#2}}}% + \expandafter\act\expandafter{\expandafter{\thetocnum}{#3}{\the\pageno}}% + \fi +} +\def\wcontents#1#2{% #1 = sequence to REF, #2 = titletext \ifnotoc\else \expandafter\wref\expandafter#1\expandafter {\expandafter{\thetocnum}{#2}{\the\pageno}}% @@ -367,7 +373,7 @@ \def\dotocnum#1{% \leavevmode {\ifnonum \global\advance\nonumnum by1 \edef\thetocnum{!\the\nonumnum}\fi - \wlabel\thetocnum \dest[toc:\thetocnum]% + \wlabel\thetocnum \dest[toc:\tocilabel.\thetocnum]% \dotocnumafter}\ifnonum\else#1\fi \global\let\dotocnumafter=\relax } @@ -462,9 +468,8 @@ \def\toclist{} \newif\ifischap \ischapfalse -\def\Xchap#1#2#3{\ischaptrue\addto\toclist{\tocline{0}{\bfshape}{#1}{#2}{#3}}} -\def\Xsec#1#2#3{\addto\toclist{\tocline{1}{\rm}{#1}{#2}{#3}}} -\def\Xsecc#1#2#3{\addto\toclist{\tocline{2}{\rm}{#1}{#2}{#3}}} +\def\Xtoc#1#2#3#4#5{\ifnum#1=0 \ischaptrue\fi \addto\toclist{\tocline{#1}{#2}{#3}{#4}{#5}}} +\def\Xchap{\Xtoc0\bfshape} \def\Xsec{\Xtoc1\rm} \def\Xsecc{\Xtoc2\rm} \def\tocline#1#2#3#4#5{{\leftskip=#1\iindent \rightskip=2\iindent \ifischap\advance\leftskip by\iindent\fi @@ -910,13 +915,14 @@ \def\hyperlinks#1#2{% \let\dest=\destactive \let\link=\linkactive - \def\toclink##1{\link[toc:##1]{\localcolor#1}{\toclinkA{##1}}}% - \def\pglink##1{\link[pg:##1]{\localcolor#1}{\pgfolioA{##1}}}% + \def\toclink##1{\link[toc:\tocilabel.##1]{\localcolor#1}{\toclinkA{##1}}}% + \def\pglink##1{\link[pg:\pgilabel.##1]{\localcolor#1}{\pgfolioA{##1}}}% \def\citelink##1##2{\link[cite:##1]{\localcolor#1}{##2}}% \def\reflink[##1]##2{\link[ref:##1]{\localcolor#1}{##2}}% \def\ulink[##1]##2{\urllink[url:##1]{##2}}% \def\urlcolor{\localcolor#2}% } +\def\tocilabel{} \def\pgilabel{} \def\pdfborder#1{\if^#1^\else \isdefined{#1border}\iftrue \if^\csname#1border\endcsname^\else attr{/C[\csname#1border\endcsname] /Border[0 0 .6]}\fi @@ -985,9 +991,10 @@ \protectlist \def~{ }\setcnvcodesA \expandafter \setlccodes \toasciidata{}{}% \cnvhook \lowercase{\gdef\tmp{#4}}% - \pdfoutline goto name{toc:#3} count - \ifnum#1<\outlinelevel\space\else-\fi\tmpnum {\tmp}\relax + \outlinesC{#1}{toc:\tocilabel.#3}{\ifnum#1<\outlinelevel\space\else-\fi}{\tmpnum}{\tmp}% } +\def\outlinesC#1#2#3#4#5{\pdfoutline goto name{#2} count #3#4{#5}\relax} + \def\setcnvcodesA{\global\let\setcnvcodesA=\relax % I am working only once \ifx\r\undefined \gdef\toasciidata{} @@ -1518,7 +1525,7 @@ \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \def\doprotect#1{\let#1=\relax} -\def\prepage{\def\destheight{25pt}\dest[pg:\the\pageno]} +\def\prepage{\def\destheight{25pt}\dest[pg:\pgilabel.\the\pageno]} \def\preboxcclv{} \def\postboxcclv{} {\catcode`\@=11 @@ -1705,12 +1712,14 @@ Oct. 2014 \pdfborder corrected: /Border [0 0 0] set for AR users. Nov. 2014 \sortingdata corrected, \specsortingdata introduced. \replacestrings uses \replacestringsA instead \tmp \bfshape used in \titfont and \Xchap - \adef{ }{\ } in verbatim environment (instead \adef{ }[ }). + \adef{ }{\ } in verbatim environment (instead \adef{ }{ }). \fnotemark+\fnotetext+\runningfnotes bug fixed. \flushcolumns, \iiparams removed, \mullines introduced. Dec. 2014 Color features rewritten using \pdfcolorstack. Unwanted spaces in \dosorting removed. Better definition of \frame. \margins/\setpagedimens improved, \isnextchar: \bgroup\egroup added. +Apr. 2015 \wtotoc, \Xtoc, \tocilabel, \pgilabel introduced. + \outlinesC introduced %%%%%%%%%%%%%% End of opmac.tex |