diff options
author | Karl Berry <karl@freefriends.org> | 2013-09-06 23:13:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-09-06 23:13:44 +0000 |
commit | a5409c09805bf26ec9aa61b1c32fddbd4a5d2a67 (patch) | |
tree | 30056c5ca7998f3dd66ed8be5f8c3383620679d7 /Master/texmf-dist | |
parent | d211c476a793546259e3fe8b6417f3f36d477a99 (diff) |
csplain (6sep13)
git-svn-id: svn://tug.org/texlive/trunk@31589 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
25 files changed, 602 insertions, 109 deletions
diff --git a/Master/texmf-dist/tex/csplain/base/csplain.ini b/Master/texmf-dist/tex/csplain/base/csplain.ini index 17616df4e14..b8648e5af3e 100644 --- a/Master/texmf-dist/tex/csplain/base/csplain.ini +++ b/Master/texmf-dist/tex/csplain/base/csplain.ini @@ -1,3 +1,4 @@ +% csplain.ini -- see the text after \dump command for more information \input csfonts % re-defines primitive \font \input plain % format Plain \restorefont % original meaning of primitive \font @@ -15,7 +16,7 @@ \fi \ifx\enc\undefined \else \input csenc-\enc.tex \fi % re-encoding using encTeX -\ifx\directlua\undefined \else\input luatexiniconfig.tex \fi % LuaTeX specific +\ifx\directlua\undefined \else\input luatexiniconfig.tex \fi % LuaTeX specific \ifx\XeTeXuseglyphmetrics\undefined \else % XeTeX specific: \csname newcount\endcsname \XeTeXallocatorG \XeTeXallocatorG=3 @@ -29,10 +30,10 @@ \fi \ifx\pdfoutput\undefined \else % added in Feb. 2005 - \def\tmpa{\pdfcsplain} - \expandafter\def\expandafter\tmpb\expandafter{\csname\jobname\endcsname} - \ifx\tmpa\tmpb %% PDFTeX with PDF output - \message {jobname=pdfcsplain, PDF output initialised.} + \def\tmpa#1#2#3#4\relax{\def\tmpa{#1#2#3}}\expandafter\tmpa\jobname\relax + \def\tmpb{pdf} \edef\tmpa{\meaning\tmpa} \edef\tmpb{\meaning\tmpb} + \ifx\tmpa\tmpb %% PDFTeX with PDF output, \jobname starts by "pdf": + \message {jobname=pdf*, PDF output initialised.} \openin0=pdftexconfig.tex \ifeof0 \message{WARNING: pdftexconfig.tex does not exist. I set \string\pdfoutput=1 only.}% @@ -40,18 +41,54 @@ \fi \pdfoutput=1 \else - \message {jobname=csplain with pdftex, DVI output initialised.} + \message {jobname=non-pdf, DVI output initialised.} \pdfoutput=0 \let\oripdfoutput=\pdfoutput \let\pdfoutput=\undefined \fi \let\tmpa=\undefined \let\tmpb=\undefined \fi - \dump -Information about changes (since <Apr. 1995>) -============================================= +csplain.ini -- the basic file for CSplain format generation +=========================================================== + +The default behavior after texengine -ini csplain.ini: + + - csplain.fmt with DVI output is created + - plain.tex is loaded but cs fonts are preloaded instead of cm fonts + - \hsize, \vsize are set basely on A4 paper format (no letter) + - internal encoding is assumed like csfonts encoding + - no input--internal re-encoding is activated + - language patterns for English, Czech, Slovak are preloaded + (see the hyphen.lan file for info how to add more languages) + - if encTeX is detected then characters 128--255 are printable + - if luaTeX is used then \input luatexiniconfig is performed + - if XeTeX is used then \newXeTeXintercharclass is defined + +If pdfTeX primitives are detected and -jobname is set to "pdf*" +(pdfsomething) then PDF output is initialized (instead DVI). Example: + pdftex -ini -jobname pdfcsplain csplain.ini + +If pdfTeX primitives are detected and PDF output is initialized and the +pdftexconfig.tex file exists then \input pdftexconfig.tex is performed. + +If encTeX is detected, then the meaning of \enc sequence is a subject +of the following behavior: + \enc=u ... UTF-8 input is activated (recommended for 8bit texengines) + \enc=w ... CP1250 input is activated (usable for old Win systems) + \enc=p ... CP852 input is activated (for very old systems) + \enc=k ... Kamenicky input is activated (for very old DOS systems) + undefined . No re-encoding (usable for old Unix systems with ISO-8859-2) + +You can type pdftex -ini -enc "\let\enc=u \input csplain.ini" +or you can use a wrapper file (like csplain-utf8.ini). + +See http://petr.olsak.net/csplain.html for more information. + + +Changes of CSplain files (since <Apr. 1995>) +============================================ ** 1 ** <Aug. 1996> file extcode.tex renamed to il2code.tex (suggested by Jan Kasprzak) @@ -134,15 +171,23 @@ file extcode.tex renamed to il2code.tex (suggested by Jan Kasprzak) * \letfont macro introduced. * lmfonts.tex: \ifx\font\corkencoded \def\tmp{rm} corrected. - Jul. 2013: [format didn't modified] + Jul. 2013: [format wasn't modified] * \newXeTeXintercharclass defined for XeTeX. * chars-8z.tex: twice loading is protected. * lmfonts.tex: cs-lmtt10 loaded, encoding is OK. - Aug, 2013: [format didn't modified] + Aug. 2013: [format wasn't modified] * ams-math, tx-math.tex: \dgsize, \whichtfm corrected * ams-math, tx-math.tex: \mathpreloaded introduced, used in fonts/*.tex + Sep. 2013: [format wasn't modified] +* ams-math, tx-math.tex: \mF introduced +* ucode.tex corrected +* fonts/*.tex: \input chars-8z only if !\corkencoded AND !\unicoded +* exchars.tex introduced +* csplain.ini: PDF output initialized if \jobname=pdf* +* chars-8z: \crq 155->96 + COPYRIGHT ========= diff --git a/Master/texmf-dist/tex/csplain/base/ucode.tex b/Master/texmf-dist/tex/csplain/base/ucode.tex index c252230528b..2b09558115e 100644 --- a/Master/texmf-dist/tex/csplain/base/ucode.tex +++ b/Master/texmf-dist/tex/csplain/base/ucode.tex @@ -2,15 +2,14 @@ % (0) sets \czech, \slovak to Cork encoded hyphen-pattern numbers, % (1) sets \catcode, \l/uccode for characters (code by Cork), % (2) defines \csaccents for new behavior of \v, \', etc (code by Cork), -% (3) defines some \sequences for special cs-fonts characters. +% (3) defines some \sequences for special characters. % (4) redefines character-like macros from plainTeX as \chardef -% (5) if encTeX with \mubytein>0 is activated reads t1enc-u.tex file % % Created by Petr Olsak <olsak@math.feld.cvut.cz>, November 2012 \def\tmp#1#2\relax{\def\tmp{#2}}\tmp ^^^^abcd\relax \ifx\tmp\empty \else - \errhelp={The ucode.tex file expects the TeX engine which work in Unicode + \errhelp={The ucode.tex file expects the TeX engine which works in Unicode internally.} \errmessage{Sorry, the Unicoded TeX engine (like luatex, xetex) is not detected} \endinput \fi @@ -284,7 +283,17 @@ \chardef \aa 229 \chardef \AA 197 -% new characters in T1 encoding: +\chardef \ellipsis 8230 +\chardef \dag 8224 +\chardef \ddag 8225 +\chardef \textbullet 8226 +\chardef \euro 8364 +\chardef \trademark 8482 +\chardef \copyright 169 +\chardef \registered 174 +\chardef \currency 164 + +% characters from T1 encoding: \chardef \Eth 272 \chardef \NG 330 @@ -301,14 +310,4 @@ \chardef \sterling 163 \let\pound=\sterling -%% (5) reading UTF-8 input encoding from t1enc-u.tex file - -\ifx\mubytein\undefined \expandafter \endinput \fi -\ifnum\mubytein=0 \expandafter \endinput \fi - -\input t1enc-u - - \endinput - - diff --git a/Master/texmf-dist/tex/csplain/fonts/ams-math.tex b/Master/texmf-dist/tex/csplain/fonts/ams-math.tex index 260194c8a18..a8338ed7e0e 100644 --- a/Master/texmf-dist/tex/csplain/fonts/ams-math.tex +++ b/Master/texmf-dist/tex/csplain/fonts/ams-math.tex @@ -154,7 +154,7 @@ % but now there is a different usage of the \resizefont: % \def\dgsize{17pt}\def\sizespec{at\dgsize}\resizefont\tenrm -\def\corrmsizes#1{} % see tx-math for the example of \corrmsizes +\def\corrmsizes{} % see tx-math for the example of \corrmsizes %% macros: @@ -163,23 +163,23 @@ \def\mitvariables{\def\rm{\fam0\tenrm}% \mathcodechanges 0:0-9\mathcodechanges 1:A-Z\mathcodechanges 1:a-z} -\def\loadmathfamily #1 #2 {\corrmsizes{#1}% +\def\loadmathfamily #1 #2 {\chardef\tmp#1\relax\corrmsizes \let\dgsize=\sizemtext - \font\tmp=\whichtfm{#2} at\dgsize \textfont#1=\tmp + \font\mF=\whichtfm{#2} at\dgsize \textfont#1=\mF \let\dgsize=\sizemscript - \font\tmp=\whichtfm{#2} at \dgsize \scriptfont#1=\tmp + \font\mF=\whichtfm{#2} at \dgsize \scriptfont#1=\mF \let\dgsize=\sizemsscript - \font\tmp=\whichtfm{#2} at\dgsize \scriptscriptfont#1=\tmp + \font\mF=\whichtfm{#2} at\dgsize \scriptscriptfont#1=\mF \ptmunit=1pt \let\dgsize=\undefined } -\def\setmathfamily #1#2{\corrmsizes{#1}% +\def\setmathfamily #1#2{\let\mF=#2% \let\dgsize=\sizemtext - \font\tmp = \specfontname #2 at\sizemtext \textfont#1=\tmp + \font#2= \specfontname\mF \space at\sizemtext \textfont#1=#2% \let\dgsize=\sizemscript - \font\tmp = \specfontname #2 at\sizemscript \scriptfont#1=\tmp + \font#2= \specfontname\mF \space at\sizemscript \scriptfont#1=#2% \let\dgsize=\sizemsscript - \font\tmp = \specfontname #2 at\sizemsscript \scriptscriptfont#1=\tmp - \ptmunit=1pt \let\dgsize=\undefined + \font#2= \specfontname\mF \space at\sizemsscript \scriptscriptfont#1=#2% + \let\dgsize=\undefined \let#2=\mF } \def\specfontname #1{\expandafter \ignoreatpt \fontname #1 \relax} \def\ignoreatpt #1 #2\relax{\whichtfm{#1}} @@ -512,3 +512,6 @@ Jul. 2013: \ifx\dgsize\undefined added Jul. 2013: \def\corrmsizes{} without dependency Aug. 2013: \mathpreloaded introduced Aug. 2013: \newdimen\ptmunit only once +Aug. 2013: \tmp -> \mF (the sequence is printed in overfull messages) + \mF tuned in \setmathfamily + \corrmsizes without parameter diff --git a/Master/texmf-dist/tex/csplain/fonts/cavantga.tex b/Master/texmf-dist/tex/csplain/fonts/cavantga.tex index a3e1aa99a20..0ee89f56310 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cavantga.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cavantga.tex @@ -4,6 +4,8 @@ \message{FONT: AvantGarde - \string\rm, \string\it, \string\bf, \string\bi, \string\tt.} +\ifx\font\unicoded \message{WARNING: This font family is unavailable in UNICODE.} + \endinput\fi \ifx\sizespec\undefined \def\sizespec{}\fi \ifx\font\corkencoded diff --git a/Master/texmf-dist/tex/csplain/fonts/cbookman.tex b/Master/texmf-dist/tex/csplain/fonts/cbookman.tex index 35d115c34c9..5fa2a157dc9 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cbookman.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cbookman.tex @@ -4,6 +4,9 @@ \message{FONT: Bookman - \string\rm, \string\it, \string\bf, \string\bi, \string\tt.} +\ifx\font\unicoded \message{WARNING: This font family is unavailable in UNICODE.} + \endinput\fi + \ifx\sizespec\undefined \def\sizespec{}\fi \ifx\font\corkencoded \def\tmp{8t \sizespec}\def\tmpa{8t \sizespec} diff --git a/Master/texmf-dist/tex/csplain/fonts/chars-8z.tex b/Master/texmf-dist/tex/csplain/fonts/chars-8z.tex index ae39441aa6a..4f7330c2e83 100644 --- a/Master/texmf-dist/tex/csplain/fonts/chars-8z.tex +++ b/Master/texmf-dist/tex/csplain/fonts/chars-8z.tex @@ -21,7 +21,7 @@ \chardef\currency 164 \chardef\section 167 \chardef\clq 154 % czech single left quote -\chardef\crq 155 % czech single right quote +\chardef\crq 96 % czech single right quote \chardef\flq 142 % french single left quote \chardef\frq 143 % french single right quote diff --git a/Master/texmf-dist/tex/csplain/fonts/chelvet.tex b/Master/texmf-dist/tex/csplain/fonts/chelvet.tex index 34b771da76d..4afba8cc891 100644 --- a/Master/texmf-dist/tex/csplain/fonts/chelvet.tex +++ b/Master/texmf-dist/tex/csplain/fonts/chelvet.tex @@ -5,6 +5,9 @@ \string\rm, \string\it, \string\bf, \string\bi, \string\tt, \string\cond\string\rm, ..., \string\cond\string\bi, \string\narrow.} +\ifx\font\unicoded \message{WARNING: This font family is unavailable in UNICODE.} + \endinput\fi + \ifx\sizespec\undefined \def\sizespec{}\fi \ifx\font\corkencoded \def\tmp{8t \sizespec}\def\tmpa{8t \sizespec} diff --git a/Master/texmf-dist/tex/csplain/fonts/cncent.tex b/Master/texmf-dist/tex/csplain/fonts/cncent.tex index dd9a3e64f62..9a180a76776 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cncent.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cncent.tex @@ -4,6 +4,9 @@ \message{FONT: NewCentury - \string\rm, \string\it, \string\bf, \string\bi, \string\tt.} +\ifx\font\unicoded \message{WARNING: This font family is unavailable in UNICODE.} + \endinput\fi + \ifx\sizespec\undefined \def\sizespec{}\fi \ifx\font\corkencoded \def\tmp{8t \sizespec}\def\tmpa{8t \sizespec} diff --git a/Master/texmf-dist/tex/csplain/fonts/cpalatin.tex b/Master/texmf-dist/tex/csplain/fonts/cpalatin.tex index 6a071afea16..8fe9b45ce3f 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cpalatin.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cpalatin.tex @@ -4,6 +4,9 @@ \message{FONT: Palatino - \string\rm, \string\it, \string\bf, \string\bi, \string\tt.} +\ifx\font\unicoded \message{WARNING: This font family is unavailable in UNICODE.} + \endinput\fi + \ifx\sizespec\undefined \def\sizespec{}\fi \ifx\font\corkencoded \def\tmp{8t \sizespec}\def\tmpa{8t \sizespec} diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-adventor.tex b/Master/texmf-dist/tex/csplain/fonts/cs-adventor.tex index 0de83efb1de..edb304d3496 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-adventor.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-adventor.tex @@ -28,7 +28,7 @@ \expandafter\csname\expandafter\tenonlytext\string#1c\endcsname} \def\tenonlytext{ten} -\ifx\font\corkencoded \else \input chars-8z \fi +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi \ifx\mathpreloaded X\else \input tx-math \fi diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-antt.tex b/Master/texmf-dist/tex/csplain/fonts/cs-antt.tex index 0f9bcb31b75..2937157bf1a 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-antt.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-antt.tex @@ -49,8 +49,8 @@ \def\txr{cs-anttr} \def\txmi{mi-anttri} \def\txb{cs-anttb} \def\txbi{mi-anttbi} -\ifx\mathpreloaded X\else \input tx-math \fi -\ifx\font\corkencoded \else \input chars-8z \fi +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi +\ifx\mathpreloaded X\else \input tx-math \fi % end of cs-antt.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-bonum.tex b/Master/texmf-dist/tex/csplain/fonts/cs-bonum.tex index 4d8d67b17ac..53dd6a465c1 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-bonum.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-bonum.tex @@ -28,8 +28,7 @@ \expandafter\csname\expandafter\tenonlytext\string#1c\endcsname} \def\tenonlytext{ten} -\ifx\font\corkencoded \else \input chars-8z \fi - +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi \ifx\mathpreloaded X\else \input tx-math \fi % end of cs-bonum.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-charter.tex b/Master/texmf-dist/tex/csplain/fonts/cs-charter.tex index 8398ae2f5eb..a1381320f14 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-charter.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-charter.tex @@ -8,6 +8,9 @@ \message{FONT: Charter - \string\rm, \string\it, \string\bf, \string\bi} +\ifx\font\unicoded \message{WARNING: This font family is unavailable in UNICODE.} + \endinput\fi + \font\tenrm=bchr\tmp \font\tenbf=bchb\tmp \font\tenit=bchri\tmp @@ -15,6 +18,7 @@ \tenrm +\ifx\font\corkencoded\else \input chars-8z \fi \ifx\mathpreloaded X\else \input tx-math \fi % end of cs-charter.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-cursor.tex b/Master/texmf-dist/tex/csplain/fonts/cs-cursor.tex index cde44cd41a3..7f9a070b2d3 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-cursor.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-cursor.tex @@ -23,8 +23,7 @@ \expandafter\csname\expandafter\tenonlytext\string#1c\endcsname} \def\tenonlytext{ten} -\ifx\font\corkencoded \else \input chars-8z \fi - +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi \ifx\mathpreloaded X\else \input tx-math \fi % end of cs-cursor.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-heros.tex b/Master/texmf-dist/tex/csplain/fonts/cs-heros.tex index b1154bd8e47..e1016cb3274 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-heros.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-heros.tex @@ -49,8 +49,7 @@ \let\tenrmc=\tenrmnc \let\tenbfc=\tenbfnc \let\tenitc=\tenitnc \let\tenbic=\tenbinc \tenrm} -\ifx\font\corkencoded \else \input chars-8z \fi - +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi \ifx\mathpreloaded X\else \input tx-math \fi % end of cs-heros.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-pagella.tex b/Master/texmf-dist/tex/csplain/fonts/cs-pagella.tex index a1fb5c32729..08f0b7f0f17 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-pagella.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-pagella.tex @@ -28,8 +28,7 @@ \expandafter\csname\expandafter\tenonlytext\string#1c\endcsname} \def\tenonlytext{ten} -\ifx\font\corkencoded \else \input chars-8z \fi - +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi \ifx\mathpreloaded X\else \input tx-math \fi % end of cs-pagella.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-schola.tex b/Master/texmf-dist/tex/csplain/fonts/cs-schola.tex index bd4ef4b59ad..86fd033cf8f 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-schola.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-schola.tex @@ -28,8 +28,7 @@ \expandafter\csname\expandafter\tenonlytext\string#1c\endcsname} \def\tenonlytext{ten} -\ifx\font\corkencoded \else \input chars-8z \fi - +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi \ifx\mathpreloaded X\else \input tx-math \fi % end of cs-schola.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/cs-termes.tex b/Master/texmf-dist/tex/csplain/fonts/cs-termes.tex index 5f547853cec..356eb5ed0e6 100644 --- a/Master/texmf-dist/tex/csplain/fonts/cs-termes.tex +++ b/Master/texmf-dist/tex/csplain/fonts/cs-termes.tex @@ -28,8 +28,7 @@ \expandafter\csname\expandafter\tenonlytext\string#1c\endcsname} \def\tenonlytext{ten} -\ifx\font\corkencoded \else \input chars-8z \fi - +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi \ifx\mathpreloaded X\else \input tx-math \fi % end of cs-termes.tex diff --git a/Master/texmf-dist/tex/csplain/fonts/ctimes.tex b/Master/texmf-dist/tex/csplain/fonts/ctimes.tex index 82825f7f552..6b3fdb4aa4e 100644 --- a/Master/texmf-dist/tex/csplain/fonts/ctimes.tex +++ b/Master/texmf-dist/tex/csplain/fonts/ctimes.tex @@ -4,6 +4,9 @@ \message{FONT: Times - \string\rm, \string\it, \string\bf, \string\bi, \string\tt.} +\ifx\font\unicoded \message{WARNING: This font family is unavailable in UNICODE.} + \endinput\fi + \ifx\sizespec\undefined \def\sizespec{}\fi \ifx\font\corkencoded \def\tmp{8t \sizespec}\def\tmpa{8t \sizespec} diff --git a/Master/texmf-dist/tex/csplain/fonts/exchars.tex b/Master/texmf-dist/tex/csplain/fonts/exchars.tex new file mode 100644 index 00000000000..aa6a9c0b527 --- /dev/null +++ b/Master/texmf-dist/tex/csplain/fonts/exchars.tex @@ -0,0 +1,295 @@ +% exchars.tex +%%%%%%%%%%%%%%%%%%%%%%%% +% Petr Olsak Aug. 2013 + +% This macros implement the handling of characters from expert +% or some other special fonts. +% See the end of this file for more information. + +% Macros: + +\def\exchardef #1#2 #3 {\def#1{\printexchar#1{#2}{#3}}} + +\def\printexchar#1#2#3{% if \addprotect\exfont then all \exchars are protected. + \ifx\exfont\relax \noexpand#1\else + \ifx\exxfont\undefined + {\exfont{#2}% + \ifx\exxfont\undefined + \excharblackbox{#1}{#2}{#3}% + \message{WARNING: extra font unavailable for \string#1/#2 in \tmpa.}% + \else + \char#3 + \fi}% + \else \char#3 + \fi\fi +} +\def\exfont#1{\expandafter\expandafter\expandafter + \separethefont\expandafter\fontname\expandafter\font\space\relax + \expandafter \ifx\csname ex:\tmpa/#1\endcsname \relax \else + \font\exxfont=\csname ex:\tmpa/#1\endcsname\space\tmpb\relax \exxfont + \fi +} +\def\separethefont#1 #2\relax{\def\tmpa{#1}\def\tmpb{#2}} +\def\excharblackbox #1#2#3% + {\leavevmode\kern.05em\vrule height.5em width.5em depth0pt\kern.05em } +\def\setexfont #1 #2 #3 {\expandafter\def\csname ex:#1/#2\endcsname{#3}} + +% Fonts declarations: + +\def\declexfamily #1 #2 #3{% we spare TeX memory, so we set only one + \def\tmpb{#1} % preloaded family; others \declexfamily are ingnored + \edef\tmpb{\meaning\tmpb} + \ifx\tmpa\tmpb + \message{EXCHARS: extra characters in TS1 encoding prepared for #2 family.}#3\fi +} +\expandafter\expandafter\expandafter + \separethefont\expandafter\fontname\expandafter\tenrm\space\relax +\edef\tmpa{\meaning\tmpa} + +\def\setexfamilyA #1 #2 #3 #4 #5 #6 #7 #8 {% + \setexfont #1#3#7 TS1 ts1-#2r + \setexfont #1#4#7 TS1 ts1-#2b + \setexfont #1#5#7 TS1 ts1-#2ri + \setexfont #1#6#7 TS1 ts1-#2bi + \setexfont pcrr#8 TS1 ts1-qcrr +} +\declexfamily ptmr8z Times {\setexfamilyA ptm qtm r b ri bi 8z 8u } +\declexfamily pagk8z Avantgarde {\setexfamilyA pag qag k d ko do 8z 8u } +\declexfamily pbkl8z Bookman {\setexfamilyA pbk qbk l d li di 8z 8u } +\declexfamily phvr8z Helvetica {\setexfamilyA phv qhv r b ro bo 8z 8u } +\declexfamily pncr8z NewCentury {\setexfamilyA pnc qcs r b ri bi 8z 8u } +\declexfamily pplr8z Palatino {\setexfamilyA ppl qpl r b ri bi 8z 8u } +\declexfamily ptmr8t Times {\setexfamilyA ptm qtm r b ri bi 8t 8t } +\declexfamily pagk8t Avatgarde {\setexfamilyA pag qag k d ko do 8t 8t } +\declexfamily pbkl8t Bookman {\setexfamilyA pbk qbk l d li di 8t 8t } +\declexfamily phvr8t Helvetica {\setexfamilyA phv qhv r b ro bo 8t 8t } +\declexfamily pncr8t NewCentury {\setexfamilyA pnc qcs r b ri bi 8t 8t } +\declexfamily pplr8t Palatino {\setexfamilyA ppl qpl r b ri bi 8t 8t } + +\def\setexfamilyB #1 #2 #3 #4 #5 #6 {% + \setexfont #6-#1#2 TS1 ts1-#1#2 + \setexfont #6-#1#3 TS1 ts1-#1#3 + \setexfont #6-#1#4 TS1 ts1-#1#4 + \setexfont #6-#1#5 TS1 ts1-#1#5 +} +\declexfamily cs-qtmr Termes {\setexfamilyB qtm r b ri bi cs } +\declexfamily cs-qagr Adventor {\setexfamilyB qag r b ri bi cs } +\declexfamily cs-qbkr Bonum {\setexfamilyB qbk r b ri bi cs } +\declexfamily cs-qhvr Heros {\setexfamilyB qhv r b ri bi cs } +\declexfamily cs-qcsr Pagella {\setexfamilyB qcs r b ri bi cs } +\declexfamily cs-qplr Schola {\setexfamilyB qpl r b ri bi cs } +\declexfamily cs-qcrr Cursor {\setexfamilyB qcr r b ri bi cs } +\declexfamily ec-qtmr Termes {\setexfamilyB qtm r b ri bi ec } +\declexfamily ec-qagr Adventor {\setexfamilyB qag r b ri bi ec } +\declexfamily ec-qbkr Bonum {\setexfamilyB qbk r b ri bi ec } +\declexfamily ec-qhvr Heros {\setexfamilyB qhv r b ri bi ec } +\declexfamily ec-qcsr Pagella {\setexfamilyB qcs r b ri bi ec } +\declexfamily ec-qplr Schola {\setexfamilyB qpl r b ri bi ec } +\declexfamily ec-qcrr Cursor {\setexfamilyB qcr r b ri bi ec } + +\declexfamily cs-lmr10 LatinModern {% + \setexfamilyB lm r10 bx10 ri10 bxi10 cs + \setexfamilyB lm tt10 csc10 csco10 ss10 cs } +\declexfamily ec-lmr10 LatinModern {% + \setexfamilyB lm r10 bx10 ri10 bxi10 ec + \setexfamilyB lm tt10 csc10 csco10 ss10 ec } + +\def\tmp{% + \setexfont csr8 TS1 ts1-lmr8 + \setexfont csr9 TS1 ts1-lmr9 + \setexfont csr10 TS1 ts1-lmr10 + \setexfont csr12 TS1 ts1-lmr12 + \setexfont csr17 TS1 ts1-lmr17 + \setexfont csbx8 TS1 ts1-lmbx8 + \setexfont csbx9 TS1 ts1-lmbx9 + \setexfont csbx10 TS1 ts1-lmbx10 + \setexfont csbx12 TS1 ts1-lmbx12 + \setexfont csti8 TS1 ts1-lmri8 + \setexfont csti9 TS1 ts1-lmri9 + \setexfont csti10 TS1 ts1-lmri10 + \setexfont csti12 TS1 ts1-lmri12 + \setexfont csbxti10 TS1 ts1-lmbxi10 + \setexfont cstt10 TS1 ts1-lmtt10 + \setexfont cstt12 TS1 ts1-lmtt12 + \setexfont cstt8 TS1 ts1-lmtt8 + \setexfont cstt9 TS1 ts1-lmtt9 +} +\declexfamily csr10 CSfont {\tmp} +\declexfamily csr12 CSfont {\tmp} +\declexfamily csr8 CSfont {\tmp} +\declexfamily csr9 CSfont {\tmp} + +% user can declare more metrics by \setexfont. + +% Character declarations: + +\exchardef \excapitalcompwordmark TS1 23 +\exchardef \exascendercompwordmark TS1 31 +\exchardef \exquotestraightbase TS1 13 +\exchardef \exquotestraightdblbase TS1 18 +\exchardef \extwelveudash TS1 21 +\exchardef \exthreequartersemdash TS1 22 +\exchardef \exleftarrow TS1 24 +\exchardef \exrightarrow TS1 25 +\exchardef \exblank TS1 32 +\exchardef \exdollar TS1 36 +\exchardef \exquotesingle TS1 39 +\exchardef \exasteriskcentered TS1 42 +\exchardef \exdblhyphen TS1 45 +\exchardef \exfractionsolidus TS1 47 +\exchardef \exzerooldstyle TS1 48 +\exchardef \exoneoldstyle TS1 49 +\exchardef \extwooldstyle TS1 50 +\exchardef \exthreeoldstyle TS1 51 +\exchardef \exfouroldstyle TS1 52 +\exchardef \exfiveoldstyle TS1 53 +\exchardef \exsixoldstyle TS1 54 +\exchardef \exsevenoldstyle TS1 55 +\exchardef \exeightoldstyle TS1 56 +\exchardef \exnineoldstyle TS1 57 +\exchardef \exlangle TS1 60 +\exchardef \exminus TS1 61 +\exchardef \exrangle TS1 62 +\exchardef \exmho TS1 77 +\exchardef \exbigcircle TS1 79 +\exchardef \exohm TS1 87 +\exchardef \exlbrackdbl TS1 91 +\exchardef \exrbrackdbl TS1 93 +\exchardef \exuparrow TS1 94 +\exchardef \exdownarrow TS1 95 +\exchardef \exasciigrave TS1 96 +\exchardef \exborn TS1 98 +\exchardef \exdivorced TS1 99 +\exchardef \exdied TS1 100 +\exchardef \exleaf TS1 108 +\exchardef \exmarried TS1 109 +\exchardef \exmusicalnote TS1 110 +\exchardef \extildelow TS1 126 +\exchardef \exdblhyphenchar TS1 127 +\exchardef \exasciibreve TS1 128 +\exchardef \exasciicaron TS1 129 +\exchardef \exacutedbl TS1 130 +\exchardef \exgravedbl TS1 131 +\exchardef \exdagger TS1 132 +\exchardef \exdaggerdbl TS1 133 +\exchardef \exbardbl TS1 134 +\exchardef \experthousand TS1 135 +\exchardef \exbullet TS1 136 +\exchardef \excelsius TS1 137 +\exchardef \exdollaroldstyle TS1 138 +\exchardef \excentoldstyle TS1 139 +\exchardef \exflorin TS1 140 +\exchardef \excolonmonetary TS1 141 +\exchardef \exwon TS1 142 +\exchardef \exnaira TS1 143 +\exchardef \exguarani TS1 144 +\exchardef \expeso TS1 145 +\exchardef \exlira TS1 146 +\exchardef \exrecipe TS1 147 +\exchardef \exinterrobang TS1 148 +\exchardef \exinterrobangdown TS1 149 +\exchardef \exdong TS1 150 +\exchardef \extrademark TS1 151 +\exchardef \expertenthousand TS1 152 +\exchardef \expilcrow TS1 153 +\exchardef \exbaht TS1 154 +\exchardef \exnumero TS1 155 +\exchardef \exdiscount TS1 156 +\exchardef \exestimated TS1 157 +\exchardef \exopenbullet TS1 158 +\exchardef \exservicemark TS1 159 +\exchardef \exlquill TS1 160 +\exchardef \exrquill TS1 161 +\exchardef \excent TS1 162 +\exchardef \exsterling TS1 163 +\exchardef \excurrency TS1 164 +\exchardef \exyen TS1 165 +\exchardef \exbrokenbar TS1 166 +\exchardef \exsection TS1 167 +\exchardef \exasciidieresis TS1 168 +\exchardef \excopyright TS1 169 +\exchardef \exordfeminine TS1 170 +\exchardef \excopyleft TS1 171 +\exchardef \exlnot TS1 172 +\exchardef \excircledP TS1 173 +\exchardef \exregistered TS1 174 +\exchardef \exasciimacron TS1 175 +\exchardef \exdegree TS1 176 +\exchardef \expm TS1 177 +\exchardef \extwosuperior TS1 178 +\exchardef \exthreesuperior TS1 179 +\exchardef \exasciiacute TS1 180 +\exchardef \exmu TS1 181 +\exchardef \exparagraph TS1 182 +\exchardef \experiodcentered TS1 183 +\exchardef \exreferencemark TS1 184 +\exchardef \exonesuperior TS1 185 +\exchardef \exordmasculine TS1 186 +\exchardef \exsurd TS1 187 +\exchardef \exonequarter TS1 188 +\exchardef \exonehalf TS1 189 +\exchardef \exthreequarters TS1 190 +\exchardef \exeuro TS1 191 +\exchardef \extimes TS1 214 +\exchardef \exdiv TS1 246 + +\endinput + +=================================================================================== + +After: + +\input ctimes \input exchars + +you can try to type: The leaf in roman: \exleaf, +{\it the leaf in italics: \exleaf}, +{\bf the leaf in bold: \exleaf}. +\end + +You have to include exchars.tex immediatelly after \input ctimes +or \input lmfonts or \input cs-pagella etc. or at the begin of the document +if none of such files is loaded. + +----------------------------------------------------------------------------------- + +Usage of \exchardef: + +\exchardef \exmacro ENC CODE + +The ``exchardefed'' macro tries to find the extra metrics derived from the +metrics of the current font and from the specified encoding ENC. +If it is found then the macro switches to the extra metric in the group and +prints the character of CODE. + +Usage of \setexfont: + +\setexfont base-metrics ENC extra-metrics + +This command declares the extra-metrics as the metrics used when the current +font has the base-metrics and the ``exchardefed'' character is printed in ENC +encoding. Without this declaration the extra metrics is unknown and the +``exchardefed'' character is not printed (only warning is written on the +terminal and \excharblackbox is printed to the document. + +You can swtich to the extra-metrics for more than one character by \exfont: + +Test 1: {\exfont{TS1}\exonequarter \exonehalf \exthreequarters} +Test 2: \exonequarter \exonehalf \exthreequarters + +The only difference between Test 1 and Test 2 is that the characters in Test 1 +can be corrected by kerning if the kerning pairs are in the metrics. The +characters in Test 2 are without kerning. + +User can declare his/her own encoding and metrics-pairs by \setexfont and +extra characters by \exchardef. This file implements only one encoding +as an example: TS1 -- TeX companion symbols. + +Users of encTeX can add the UTF-8 declarations of ``exchadefed'' symbols. Example: + +\mubyte \exonehalf ^^c2^^bd\endmubyte +\mubyte \exflorin ^^c6^^92\endmubyte +etc... + +Now user can write raw characters in the document: ½. + +---------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/csplain/fonts/lmfonts.tex b/Master/texmf-dist/tex/csplain/fonts/lmfonts.tex index bc433f88299..aa1ed043dbf 100644 --- a/Master/texmf-dist/tex/csplain/fonts/lmfonts.tex +++ b/Master/texmf-dist/tex/csplain/fonts/lmfonts.tex @@ -7,8 +7,8 @@ \ifx\sizespec\undefined \def\sizespec{}\fi +\ifx\font\corkencoded\else \ifx\font\unicoded\else \input chars-8z \fi\fi \ifx\mathpreloaded A\else \input ams-math \fi -\ifx\font\corkencoded \else \input chars-8z \fi \ifx\font\corkencoded \def\tmp{ec}\else \def\tmp{cs}\fi diff --git a/Master/texmf-dist/tex/csplain/fonts/tx-math.tex b/Master/texmf-dist/tex/csplain/fonts/tx-math.tex index f5df0efe4b2..adbf868bec0 100644 --- a/Master/texmf-dist/tex/csplain/fonts/tx-math.tex +++ b/Master/texmf-dist/tex/csplain/fonts/tx-math.tex @@ -91,10 +91,19 @@ \ifx\bisans\undefined % user can define his own \bfsans, \bisans \def\bfsans{phvb8z}\def\bisans{phvbo8z} % \bffam, \bifam normal \def\bbfsans{phvb8z}\def\bbisans{phvbo8z} % \bffam, \bifam bold - \def\corrmsizes#1{\ifnum#1=10 \ptmunit=.83pt \fi % wee need to correct - \ifnum#1=11 \ptmunit=.83pt \fi} % the sizes o phvb8t and + \def\corrmsizes{\ifnum\tmp=10 \ptmunit=.83pt \fi % wee need to correct + \ifnum\tmp=11 \ptmunit=.83pt \fi} % the sizes o phvb8t and \fi % phvbo8t fonts -\ifx\corrmsizes\undefined \def\corrmsizes#1{}\fi +\ifx\corrmsizes\undefined \def\corrmsizes{}\fi + +% User can use \corrmsizes if he/she loads new family. The following example +% loads ZapfChancery as \fam 15 with fonts scaled by 1.32 as compared with +% others fonts in math formula: + +% \def\zapf {\fam 15 } +% \addto\corrmsizes {\ifnum\tmp=15 \ptmunit=1.32pt \fi} +% \addto\normalmath {\loadmathfamily 15 pzcmi8z } \normalmath +% \addto\boldmath {\loadmathfamily 15 pzcmi8z } % macros: @@ -103,16 +112,17 @@ \def\mitvariables{\def\rm{\fam0\tenrm}% \mathcodechanges 0:0-9\mathcodechanges 1:A-Z\mathcodechanges 1:a-z} -\def\loadmathfamily #1 #2 {\corrmsizes{#1}% - \font\tmp = #2 at\sizemtext \textfont#1=\tmp - \font\tmp = #2 at\sizemscript \scriptfont#1=\tmp - \font\tmp = #2 at\sizemsscript \scriptscriptfont#1=\tmp +\def\loadmathfamily #1 #2 {\chardef\tmp#1\relax\corrmsizes + \font\mF = #2 at\sizemtext \textfont#1=\mF + \font\mF = #2 at\sizemscript \scriptfont#1=\mF + \font\mF = #2 at\sizemsscript \scriptscriptfont#1=\mF \ptmunit=1pt } -\def\setmathfamily #1#2{% - \font\tmp = \specfontname #2 at\sizemtext \textfont#1=\tmp - \font\tmp = \specfontname #2 at\sizemscript \scriptfont#1=\tmp - \font\tmp = \specfontname #2 at\sizemsscript \scriptscriptfont#1=\tmp +\def\setmathfamily #1#2{\let\mF=#2% + \font#2= \specfontname \mF\space at\sizemtext \textfont#1=#2% + \font#2= \specfontname \mF\space at\sizemscript \scriptfont#1=#2% + \font#2= \specfontname \mF\space at\sizemsscript \scriptscriptfont#1=#2% + \let#2=\mF } \def\specfontname #1{\expandafter \ignoreatpt \fontname #1 \relax} \def\ignoreatpt #1 #2\relax{#1} @@ -713,3 +723,6 @@ Jul. 2013: \corrmsizes defined if \bisans undefined Aug. 2013: \mathpreloaded introduced Aug. 2013: \newdimen\ptmunit only once +Aug. 2013: \tmp -> \mF (the sequence is printed in overfull messages) + \mF tuned in \setmathfamily + \corrmsizes without parameter diff --git a/Master/texmf-dist/tex/csplain/opmac/opmac-xetex.tex b/Master/texmf-dist/tex/csplain/opmac/opmac-xetex.tex new file mode 100644 index 00000000000..d62a97f26cc --- /dev/null +++ b/Master/texmf-dist/tex/csplain/opmac/opmac-xetex.tex @@ -0,0 +1,106 @@ +% opmac-xetex.tex +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Petr Olsak, 2013 + +% OPmac features (such as hyperlinks, outlines, colors, transformations, +% pictures) are based on pdfTeX primitives. Unfortunately, these pdfTeX +% primitives are unavailable in XeTeX. XeTeX uses dvipdfm(x) extension +% instead this, which is based on \special{pdf:SOMETHING} commands (see the +% documentation of dvipdfmx). This is a reason why we need to redefine some +% OPmac macros in order to keep the mentioned features in XeTeX. + +% This file is read by opmac.tex automatically when XeTeX is detected. +% Don't use \input opmac-xetex in your document. + +% Implementation + +% \special{pdf:bann <</Type/Annot/Subtype/Link/A<</S/GoTo/D(LABEL)>>>>}% +% TEXT\special{pdf:eann} has to be used instead of +% \pdfstartlink goto name{LABEL}\relax TEXT\pdfendlink: + +\def\link[#1:#2]#3#4{\leavevmode + \special{pdf:bann <</Type/Annot/Subtype/Link\pdfborder{#1}/A<</S/GoTo/D(#1:#2)>>>>}% + {#3#4}\special{pdf:eann}% +} +\def\pdfborder#1{\if^#1^\else \isdefined{#1border}\iftrue + \if^\csname#1border\endcsname^\else /C[\csname#1border\endcsname]/Border[0 0 1]% + \fi\fi\fi +} + +% Unfortunately, \pdflinkmargin is unsupported in XeTeX. We create +% only a void compensation: + +\newdimen\pdflinkmargin + +% \special{pdf:bann <</Type/Annot/Subtype/Link/A<</S/URI/URI(URL)>>>>}% +% TEXT\special{pdf:eann} has to be used instead of +% \pdfstartlink user{/Subtype/Link/A <</Type/Action/S/URI/URI(URL)>>}TEXT\pdfendlink: + +\def\urllink[#1:#2]#3{{\let~=\relax \let\\=\relax \let\{=\relax \let\}=\relax + \leavevmode + \special{pdf: bann <</Type/Annot/Subtype/Link\pdfborder{#1}/A<</S/URI/URI(#2)>>>>}% + {\def~{\nobreak\space}\urlcolor#3}\special{pdf:eann}}% +} + +% \special{pdf:dest (LABEL) [@thispage /XYZ @xpos @ypos null]} +% has to be used instead of \pdfdest name{LABEL} xyz : + +\def\destbox[#1]{\vbox to0pt{\kern-\destheight + \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}\vss}} + +% \special{pdf:literal CODE} has to be used instead of \pdfliteral{CODE}: + +\def\pdfliteral#1{\special{pdf:literal #1}} + +% The \pdfsetmatrix, \pdfsave, \pdfrestore can be implemented by \pdfliteral: + +\def\pdfsetmatrix#1{\pdfliteral{#1 0 0 cm}} +\def\pdfsave{\pdfliteral{q}} +\def\pdfrestore{\pdfliteral{Q}} + +% \special{pdf:outline LEVEL <</Title(TEXT)/A<</S/GoTo/D(LABEL)>>>>} +% has to be used instead of +% \pdfoutline goto name{LABEL} count CHILDS {TEXT}. +% Note, we needn't calculate CHILDS, simply LEVEL of outline is used. + +\def\insertoutline#1{\global\advance\oulnum by1 + \special{pdf:dest (oul:\the\oulnum) [@thispage /XYZ @xpos @ypos null]}% + \special{pdf:outline 0<</Title(#1)/A<</S/GoTo/D(oul:\the\oulnum)>>>>}% +} +\def\pdfoutline goto name#1 count #2#3<#4\relax{% + \special{pdf:out [\ifnum#3<\outlinelevel\space\else-\fi] #3 + <</Title(\tmp)/A<</S/GoTo/D(#1)>>>>}% +} + +% \special{pdf:docview<<CODE>>} has to be used instead of \pdfcatalog{CODE}: + +\def\pdfcatalog#1{\special{pdf:docview <<#1>>}} + +% \special{pdf:docinfo<<CODE>>} has to be used instead of \pdfinfo{CODE}: + +\def\pdfinfo#1{\special{pdf:docinfo <<#1>>}} + +% \XeTeXpicfile FILE width DIMEN height DIMEN +% has to be used to load bitmap picture and +% \XeTeXpdffile FILE width DIMEN height DIMEN +% has to be used to load the picture in PDF format. We need to detect the +% format by the extension of the file. + +\def\inspic #1 {\hbox{\def\tmp##1.pdf##2\relax{% + \ifnum\strcmp{##2}{.pdf}=0 \XeTeXpdffile \else \XeTeXpicfile \fi}% + \lowercase{\tmp #1}.pdf\relax \picdir#1 + \ifdim\picwidth=0pt \else width\picwidth\fi + \ifdim\picheight=0pt \else height\picheight\fi}} + +\endinput + +=== Unsolved problems === + +1) The size of clickable area cannot be controlled by height/depth parameter + and by \pdflinkmargin. The result depends on an accident. +2) The PDF/bitmap loading depends on suffix, not on interal magic code in + the loaded file. The \inspic parameter have to be expanded. +3) The memory sparing method of \pdfximage ... \pdfrefximage + is not simply available. + +% End of opmac-xetex.tex file diff --git a/Master/texmf-dist/tex/csplain/opmac/opmac.tex b/Master/texmf-dist/tex/csplain/opmac/opmac.tex index a365fea689b..bea5cdb51e7 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{Aug. 2013} +\def\OPmacversion{Sep. 2013} \immediate\write16{This is OPmac (Olsak's Plain macros), version <\OPmacversion>} @@ -23,8 +23,8 @@ \addprotect~ \newif\ifpdftex \pdftextrue -\ifx\pdfoutput\undefined \pdftexfalse -\else \ifnum\pdfoutput=0 \pdftexfalse \fi \fi +\ifx\pdfoutput\undefined \pdftexfalse \else \ifnum\pdfoutput=0 \pdftexfalse \fi \fi +\ifx\XeTeXversion\undefined \else \pdftextrue \fi \def\sdef#1{\expandafter\def\csname#1\endcsname} \def\sxdef#1{\expandafter\xdef\csname#1\endcsname} @@ -55,9 +55,8 @@ \let\\=\undefined {\lccode`\?=`\% \lowercase{\gdef\percent{?}}} {\lccode`\?=`\\ \lowercase{\gdef\bslash{?}}} -\addprotect\percent \addprotect\bslash -\def\,{\ifmmode \mskip\thinmuskip \else \kern.166em \fi} - +\def\,{\ifmmode \mskip\thinmuskip \else \thinspace \fi} +\addprotect\percent \addprotect\bslash \addprotect\, \addprotect\exfont %%%%%%%%%%%%%% Global parameters, sec. 3.2 in opmac-d.pdf @@ -246,7 +245,7 @@ \ifeof\testin \else \closein\testin \input \jobname.ref - \fnotenum=0 \mnotenum=0 + \fnotenum=0 \mnotenum=0 \immediate\openout\reffile=\jobname.ref \def\wref##1##2{\write\reffile{\string##1##2}} \immediate\write\reffile {\percent\percent\space OPmac - REF file} @@ -264,15 +263,15 @@ %%%%%%%%%%%%%% \label, \ref, \pgref, sec. 3.7 in opmac-d.pdf -\def\label[#1]{\xdef\lastlabel{#1}\ignorespaces} +\def\label[#1]{\isdefined{l0:#1}% + \iftrue \opwarning{duplicated label [#1], ignored}\else \xdef\lastlabel{#1}\fi + \ignorespaces} \def\wlabel#1{% \ifx\lastlabel\undefined \else \dest[ref:\lastlabel]% \edef\tmp{\wref\Xlabel{{\lastlabel}{#1}}}\tmp - \isdefined{lab:\lastlabel}\iftrue \else - \sxdef{lab:\lastlabel}{#1}% - \fi + \sxdef{lab:\lastlabel}{#1}\sxdef{l0:\lastlabel}{}% \global\let\lastlabel=\undefined \fi } @@ -365,7 +364,7 @@ \def\othe#1.{\ifnum#1>0 \the#1.\fi} \def\thechapnum{} \def\thesecnum{} \def\theseccnum{} -\def\afternoindent{\global\everypar={\wipeepar\setbox0=\lastbox}} +\def\afternoindent{\global\everypar={\wipeepar\setbox7=\lastbox}} \def\wipeepar{\global\everypar={}} \let\firstnoindent=\afternoindent \def\nbpar{{\interlinepenalty=10000\par}} @@ -395,6 +394,8 @@ } \def\printcaption#1#2{{\bf#1 #2}\enspace} +\expandafter\def\expandafter\endinsert\expandafter{\expandafter\par\endinsert} + \def\eqmark{\global\advance\dnum by1 \ifinner\else\eqno \fi {\destheight=2.1em \wlabel\thednum}\thednum @@ -821,7 +822,7 @@ \def\setcmykcolor#1{{% \def\tmp{#1}\expandafter \ifx\csname currcolor\pdfK\endcsname \tmp \else - \special{PDF:#1 \pdfK}% + \pdfliteral{#1 \pdfK}% \expandafter\xdef\csname currcolor\pdfK\endcsname{#1}% \writecolor\pdfK \fi}% @@ -850,9 +851,9 @@ \def\restorecolor{{\def\tmp##1##2##3##4\end{\xdef\savedcolors{##4}% \def\tmpa{##2}\def\tmpb{##3}\writecolortrue - \ifx\tmpa\currcolork \else \special{PDF:##2 k}\xdef\currcolork{##2}% + \ifx\tmpa\currcolork \else \pdfliteral{##2 k}\xdef\currcolork{##2}% \ifnum##1=1 \writecolor k\fi\fi - \ifx\tmpb\currcolorK \else \special{PDF:##3 K}\xdef\currcolorK{##3}% + \ifx\tmpb\currcolorK \else \pdfliteral{##3 K}\xdef\currcolorK{##3}% \ifnum##1=1 \writecolor K\fi\fi}% \expandafter\tmp\savedcolors\end}} @@ -880,25 +881,23 @@ {\let\setpgcolor=\relax \sxdef{pgc:#1}% {\csname pgc:#1\endcsname\setpgcolor K{\pdflastcolorK}}}\fi } -\def\setpgcolor#1#2{\special{PDF:#2 #1}} +\def\setpgcolor#1#2{\pdfliteral{#2 #1}} \def\preboxcclv{\csname pgc:\the\pageno\endcsname} -\def\postboxcclv{% +\def\postboxcclv{{% \def\setpgcolor##1##2{\expandafter\xdef\csname currcolor##1\endcsname{##2}}% - \ifnum\pageno<\lastpage {\advance\pageno by1 \csname pgc:\the\pageno\endcsname}% + \ifnum\pageno<\lastpage + \globaldefs=-1 \advancepageno \globaldefs=0 \csname pgc:\the\pageno\endcsname \else \xdef\currcolork{\pdflastcolork}\xdef\currcolorK{\pdflastcolorK}\fi - \Black \linecolor\Black -} + \let\longlocalcolor=\relax \let\localcolor=\relax \Black \linecolor\Black +}} \ifpdftex\else - \def\setcmykcolor#1{} - \let\localcolor=\relax + \def\setcmykcolor#1{} \def\pdfliteral#1{} + \let\localcolor=\relax \let\longlocalcolor=\relax \fi -\def\draft{\edef\tmp{\headline={\noexpand\draftbox{\tenbf DRAFT}\the\headline}} - \ifpdftex \tmp \else - \opwarning{\string\draft: Grey color is possible in pdfTeX only}% - \fi} +\def\draft{\edef\tmp{\headline={\noexpand\draftbox{\tenbf DRAFT}\the\headline}}\tmp} \def\draftbox#1{\vbox to0pt{\setbox0=\hbox{\typosize[10/]#1}% \kern.5\vsize \kern4\wd0 \hbox to0pt{\kern.5\hsize \kern-2.5\wd0 @@ -907,6 +906,10 @@ \pdfrestore \hss}\vss}\hss} +\ifpdftex\else + \def\draft{\opwarning{\string\draft: Grey color is possible in pdfTeX only}} +\fi + %%%%%%%%%%%%%% Hyperrefs -- sec. 3.16 in opmac-d.pdf @@ -941,13 +944,12 @@ \def\pglink##1{\link[pg:##1]{\localcolor#1}{##1}}% \def\citelink##1{\link[cite:##1]{\localcolor#1}{##1}}% \def\reflink[##1]##2{\link[ref:##1]{\localcolor#1}{##2}}% - \def\ulink[##1]##2{\urllink[##1]{##2}}% + \def\ulink[##1]##2{\urllink[url:##1]{##2}}% \def\urlcolor{\longlocalcolor#2}% } \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 1]}% \fi\fi\fi } @@ -970,7 +972,7 @@ \replacestrings{\{}{\char`\{ }% \replacestrings{\}}{\char`\} }% \replacestrings{&}{\urlbskip\char`\& \urlskip}% - \ulink[url:#1]{\urlfont\tmpb}% + \ulink[#1]{\urlfont\tmpb}% }} \def\urlfont{\tt} \def\urlskip{\null\nobreak\hskip0pt plus0.05em\relax} @@ -1038,8 +1040,10 @@ } \def\setlccodes#1#2{\if\relax#2\relax \else \lccode`#1=`#2 \expandafter \setlccodes \fi} -\def\insertoutline#1{\pdfdest name{oul:#1} xyz\relax - \pdfoutline goto name{oul:#1} count0 {#1}\relax +\newcount\oulnum +\def\insertoutline#1{\global\advance\oulnum by1 + \pdfdest name{oul:\the\oulnum} xyz\relax + \pdfoutline goto name{oul:\the\oulnum} count0 {#1}\relax } \ifpdftex \else @@ -1170,8 +1174,8 @@ \halign\expandafter{\the\tabdata\tabstrutA\cr#2\crcr}\egroup} \def\scantabdata#1{\let\next=\scantabdata - \ifx#1\relax\let\next=\relax - \else\if#1|\addtabvrule + \ifx\relax#1\let\next=\relax + \else\ifx|#1\addtabvrule \else\expandafter\ifx\csname tabdeclare#1\endcsname \relax \opwarning{tab-declare letter #1 unknown, ignored}% \else\expandafter \addtabitem\expandafter{\csname tabdeclare#1\endcsname}% @@ -1311,10 +1315,12 @@ \fi } \def\mnoteA#1{\global\advance \mnotenum by1 - \isdefined{mn:\the\mnotenum}\iftrue - \else\opwarning{unknown \noexpand\mnote side. TeX me again}\fi - \edef\tmp{\csname mn:\the\mnotenum\endcsname}% - \openref\wref\Xmnote{}% + \ifx\mnotesfixed\undefined + \isdefined{mn:\the\mnotenum}\iftrue + \else\opwarning{unknown \noexpand\mnote side. TeX me again}\fi + \edef\tmp{\csname mn:\the\mnotenum\endcsname}% + \openref\wref\Xmnote{}% + \else \let\tmp=\mnotesfixed \fi \expandafter\ifx\tmp \left \hbox to0pt{\kern-\mnotesize \kern-\mnoteindent \vbox to0pt{\vss \setbox0=\vtop{\hsize=\mnotesize @@ -1330,9 +1336,7 @@ \def\Xmnote{\advance\mnotenum by1 \sxdef{mn:\the\mnotenum}{\ifodd\lastpage \right \else \left \fi}} -\def\fixmnotes#1{\tmpnum=0 - \loop \advance\tmpnum by1 - \isdefined{mn:\the\tmpnum}\iftrue \sxdef{mn:\the\tmpnum}{#1}\repeat} +\def\fixmnotes#1{\def\mnotesfixed{#1}} %%%%%%%%%%%%%% \cite, \bib, \usebibtex, \usebbl -- sec. 3.23 in opmac-d.pdf @@ -1424,8 +1428,7 @@ \def\readbblfile #1{% \openin\testin=#1.bbl \ifeof\testin - \opwarning{.bbl file doesn't exist. - Use the ``bibtex #1'' command}% + \opwarning{.bbl file doesn't exist. Use the ``bibtex #1'' command}% \else \closein\testin \bibnum=0 @@ -1587,8 +1590,9 @@ \fi} \def\truedimen#1{#1=\expandafter\ignorept\the#1truept } -%%%%%%%%%%%%%% REF file is read now -- sec 3.26 in opmac-d.pdf +%%%%%%%%%%%%%% XeTeX specific + REF file is read now -- sec 3.26 in opmac-d.pdf +\ifx\XeTeXversion\undefined \else \pdftexfalse \input opmac-xetex \fi \inputref \endinput @@ -1617,7 +1621,7 @@ May 2013 \margins (2pages laylout) can be redefined by new \margins \outlines use \pdfcatalog{/PageMode/UseOutlines} Jul. 2013 \fnotetext unwanted space - corrected \picw=0pt prints picture in natural size, \picheight introduced - \isinlist corrected, + \isinlist corrected, \othe\secnum in \secc removed \dotocnum, \remskip, \reminsert introduced \nonum, \notoc implemented @@ -1632,7 +1636,19 @@ Aug. 2013 \dgsize corrected \destheight rewritten as a dimen register \rightskip, \leftskip corrected in \mnote space corrected in \prepii - \input ams-math only if \normalmath is \undefined + \input ams-math only if \normalmath is \undefined (released) +Sep. 2013 \label: the ``duplicated label'' test added + \afternoindent: \box0 -> \box7 + \scantabdata: \if#1| -> \ifx|#1 + \fixmnotes recoded + \, uses \thinspace and it is \addprotected + \pdfliteral instead \special{PDF:...} used + XeTeX specific added + \draft, \insertoulines recoded + \endinsert redefined (\par added) + \addprotect\exfont (for exchars.tex cooperating) + \ulink improved and added to opmac-u + \postboxcclv: {\advancepageno} corrected %%%%%%%%%%%%%% End of opmac.tex diff --git a/Master/texmf-dist/tex/csplain/opmac/pdfuni.tex b/Master/texmf-dist/tex/csplain/opmac/pdfuni.tex index 302d5ac940e..a2c35b4c5a0 100644 --- a/Master/texmf-dist/tex/csplain/opmac/pdfuni.tex +++ b/Master/texmf-dist/tex/csplain/opmac/pdfuni.tex @@ -16,6 +16,7 @@ % setting more converted characters (not only Czech/Slovak) see the end of % this file (after \endinput command) +\ifx\XeTeXversion\undefined\else \def\cnvhook#1{}\endinput \fi \def\tmp#1#2\end{\if$#2$\else \errmessage {This file is UTF-8 encoded. Use TeX+encTeX or 16bit TeX engine.}\fi}% |