diff options
author | Karl Berry <karl@freefriends.org> | 2015-09-11 22:45:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-09-11 22:45:37 +0000 |
commit | af130f6132abe143060e18f2e0275dcaa1f93f83 (patch) | |
tree | a8b8b29e8ad40cb039a8276e41439d2ff934b568 /Master/texmf-dist/tex/csplain/opmac/opmac.tex | |
parent | 3c60c218ad17a6f296309c287e9ecacade348dee (diff) |
csplain (11sep15)
git-svn-id: svn://tug.org/texlive/trunk@38351 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/csplain/opmac/opmac.tex')
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/opmac.tex | 114 |
1 files changed, 63 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/csplain/opmac/opmac.tex b/Master/texmf-dist/tex/csplain/opmac/opmac.tex index 7425f1be088..78a97213930 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. 2015} +\def\OPmacversion{Sep. 2015} \immediate\write16{This is OPmac (Olsak's Plain macros), version <\OPmacversion>} %%%%%%%%%%%%%% Basic macros, sec. 3.1 in opmac-d.pdf @@ -249,11 +249,10 @@ \sdef{lan:5}{cs} \sdef{lan:15}{cs} \sdef{lan:115}{cs} \sdef{lan:6}{sk} \sdef{lan:16}{sk} \sdef{lan:116}{sk} -\ifx\uselanguage\undefined \else \message{OPmac: etex.src macros detected} - \bgroup - \uselanguage{czech} \sxdef{lan:\the\language}{cs} - \uselanguage{slovak} \sxdef{lan:\the\language}{sk} - \egroup +\ifx\uselanguage\undefined \def\isolangset#1#2{}\else + \message{OPmac: etex.src macros detected} + \def\isolangset#1#2{{\uselanguage{#1}\sxdef{lan:\the\language}{#2}}} + \isolangset{USenglish}{en} \isolangset{czech}{cs} \isolangset{slovak}{sk} \fi %%%%%%%%%%%%%% REF file, sec 3.6 in opmac-d.pdf @@ -650,27 +649,34 @@ \def\specsortingdatask {ch:^^T Ch:^^U CH:^^V} % DZ etc. are sorted normally \def\setprimarysorting {% - \ifx\r\undefined - \opwarning{\noexpand\csaccents is unused, falling back to ASCII sorting}% - \global\let\asciisorting=t% - \fi - \ifx\asciisorting\undefined - \xdef\sortingdata{\sortingdata}% expand sorting data now - \isdefined{specsortingdata\csname lan:\the\language\endcsname}\iftrue - \xdef\specsortingdata{\csname specsortingdata\csname lan:\the\language\endcsname - \endcsname\space}% - \expandafter\setprimarysortingA \meaning\specsortingdata\relax - \else \gdef\specsortingdata{}\fi - \else - \gdef\sortingdata{.}\gdef\specsortingdata{}% - \fi - \def\act##1{\ifx##1.\else - \ifx##1,\advance\tmpnum by1 - \else \lccode`##1=\tmpnum \fi - \expandafter \act \fi}% - \tmpnum=60 \expandafter \act\sortingdata \setignoredchars + \isdefined{sortingdata\csname lan:\the\language\endcsname}\iftrue + \expandafter \let\expandafter\sortingdata + \csname sortingdata\csname lan:\the\language\endcsname\endcsname + \xdef\sortingmessage{using \string\sortingdata\csname lan:\the\language\endcsname}% + \else + \xdef\sortingmessage{using internal \string\sortingdata}% + \ifx\r\undefined + \opwarning{\noexpand\csaccents is unused, falling back to ASCII sorting}% + \global\let\asciisorting=t% + \fi\fi + \ifx\asciisorting\undefined + \xdef\sortingdata{\sortingdata}% expand sorting data now + \isdefined{specsortingdata\csname lan:\the\language\endcsname}\iftrue + \xdef\specsortingdata{\csname specsortingdata\csname lan:\the\language\endcsname + \endcsname\space}% + \expandafter\setprimarysortingA \meaning\specsortingdata\relax + \else \gdef\specsortingdata{}\fi + \else + \gdef\sortingdata{.}\gdef\specsortingdata{}\gdef\sortingmessage{ASCII}% + \fi + \def\act##1{\ifx##1.\else + \ifx##1,\advance\tmpnum by1 + \else \lccode`##1=\tmpnum \fi + \expandafter \act \fi}% + \tmpnum=60 \expandafter \act\sortingdata \setignoredchars } \def\setprimarysortingA#1->#2\relax{\gdef\specsortingdata{#2}} +\def\sortingmessage{ASCII default} \def\setsecondarysorting {\def\act##1{\ifx##1.\else \ifx##1,\else \advance\tmpnum by1 \lccode`##1=\tmpnum \fi @@ -713,41 +719,40 @@ \fi } \def\dosorting{% - \message{Opmac: Sorting index...}% - \def\act##1{\ifx##1\relax\else \global\addto\iilist{##1,}% + \message{Opmac: Sorting index (\sortingmessage)...}% + \def\act##1{\ifx##1\relax\else \addto\iilist{##1,}% \expandafter\act\fi}% - \expandafter\removeiilist \expandafter\act \iilist\relax - \expandafter\removeiilist \expandafter\mergesort \iilist \end,\end + \edef\iilist{\expandafter}\expandafter\act \iilist\relax + \edef\iilist{\expandafter}\expandafter\mergesort \iilist \end,\end } -\def\removeiilist{\gdef\iilist{}} \def\mergesort #1#2,#3{% by Miroslav Olsak \ifx,#1% % prazdna-skupina,neco, (#2=neco #3=pokracovani) \addto\iilist{#2,}% % dvojice skupin vyresena - \return{\fif\mergesort#3}% % \mergesort pokracovani + \sortreturn{\fif\mergesort#3}% % \mergesort pokracovani \fi \ifx,#3% % neco,prazna-skupina, (#1#2=neco #3=,) \addto\iilist{#1#2,}% % dvojice skupin vyresena - \return{\fif\mergesort}% % \mergesort dalsi + \sortreturn{\fif\mergesort}% % \mergesort dalsi \fi \ifx\end#3% % neco,konec (#1#2=neco) \ifx\empty\iilist % neco=kompletni setrideny seznam \def\iilist{#1#2}% - \return{\fif\fif\gobbletoend}% % koncim + \sortreturn{\fif\fif\gobbletoend}% % koncim \else % neco=posledni skupina nebo \end - \return{\fif\fif \expandafter\removeiilist % spojim \indexbuffer+necoa cele znova - \expandafter\mergesort\iilist#1#2,#3}% + \sortreturn{\fif\fif % spojim \indexbuffer+necoa cele znova + \edef\iilist{\expandafter}\expandafter\mergesort\iilist#1#2,#3}% \fi\fi % zatriduji: p1+neco1,p2+neco2, (#1#2=p1+neco1 #3=p2) \isAleB #1#3\ifAleB % p1<p2 \addto\iilist{#1}% % p1 do bufferu - \return{\fif\mergesort#2,#3}% % \mergesort neco1,p2+neco2, + \sortreturn{\fif\mergesort#2,#3}% % \mergesort neco1,p2+neco2, \else % p1>p2 \addto\iilist{#3}% % p2 do bufferu - \return{\fif\mergesort#1#2,}% % \mergesort p1+neco1,neco2, + \sortreturn{\fif\mergesort#1#2,}% % \mergesort p1+neco1,neco2, \fi - \relax % zarazka, na ktere se zastavi \return + \relax % zarazka, na ktere se zastavi \sortreturn } -\def\return#1#2\fi\relax{#1} \def\fif{\fi} +\def\sortreturn#1#2\fi\relax{#1} \def\fif{\fi} \def\gobbletoend #1\end{} @@ -935,7 +940,7 @@ \ifpdftex \else \def\link[#1]#2#3{#3} \def\urllink[#1]#2{#2} - \def\hyperlinks#1#2{} + \def\hyperlinks#1#2{\opwarning{No pdfTeX detected, \noexpand\hyperlinks ignored}} \fi \def\url#1{{\def\tmpb{#1}% @@ -993,26 +998,29 @@ \tmpnum=\isdefined{ol:\the\count0:\the\count1}% \iftrue\csname ol:\the\count0:\the\count1\endcsname\else0\fi \or \tmpnum = 0 \fi - \protectlist \def~{ }\setcnvcodesA - \expandafter \setlccodes \toasciidata{}{}% - \cnvhook \lowercase{\gdef\tmp{#4}}% - \outlinesC{#1}{toc:\tocilabel.#3}{\ifnum#1<\outlinelevel\space\else-\fi}{\tmpnum}{\tmp}% + \protectlist \def~{ }\setcnvcodesA + \ifx\toasciidata\empty \let\lowercase=\relax \else \expandafter\setlccodes\toasciidata{}{}\fi + \cnvhook \lowercase{\gdef\tmp{#4}}% + \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{} - \opwarning{\noexpand\csaccents unused, CZ/SK outline-conversion is off}% - \else - \xdef\toasciidata{\toasciidata}% - \fi + \isdefined{toasciidata\csname lan:\the\language\endcsname}\iftrue + \xdef\toasciidata{\csname toasciidata\csname lan:\the\language\endcsname\endcsname}% + \else + \ifx\r\undefined + \gdef\toasciidata{} + \opwarning{\noexpand\csaccents unused, CZ/SK outline-conversion is off}% + \else + \xdef\toasciidata{\toasciidata}% + \fi\fi } \def\toasciidata{% Removes Czech+Slovak accents AA\'AA\"AA\'aa\"aaBBCC\v CC\v ccDD\v DD\v ddEE\'EE\v EE\'ee\v ee% FFGGHHII\'II\'iiJJKKLL\'LL\v LL\'ll\v llMMNN\v NN\v nnOO\'OO\"OO\^OO% \'oo\"oo\^ooPPQQRR\v RR\v rrSS\v SS\v ssTT\v TT\v ttUU\'UU\"UU\r UU% - \'uu\"uu\r uuVVWWXXYY\'YY\'yyZZ\v ZZ\v zz% + \'uu\"uu\r uuVVWWXXYY\'YY\'yyZZ\v ZZ\v zz% } \def\setlccodes#1#2{\if\relax#2\relax \else \lccode`#1=`#2 \expandafter \setlccodes \fi} @@ -1738,5 +1746,9 @@ Jun 2015 \urlfont: \hyphenchar=-1 removed (bug fixed) default \ulink: \leavevmode added (bug fixed) Jul. 2015 \openref: \def\wref -> \gdef\wref (bug fixed) \margins/2: \prephoffset introduced (bug fixed) + \hyperlinks when non-pdftex prints warning +Sep. 2015 \sortingdata<iso-code> introduced, \isolangset introduced. + \toasciidata<iso-code> introduced. + \dosorting: local \iisort changes %%%%%%%%%%%%%% End of opmac.tex |