diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-25 21:50:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-25 21:50:26 +0000 |
commit | 6b9c748b268e3e8cc785287f5d31bc7e15db2e76 (patch) | |
tree | f9864d3619856f96457e0dee23a45b4a96d07e3d /Master/texmf-dist/tex/csplain/opmac | |
parent | ad6971d5fe287aa59138369c498a8037d6832589 (diff) |
csplain (25apr16)
git-svn-id: svn://tug.org/texlive/trunk@40747 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/csplain/opmac')
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/fontfam-catalog.tex | 55 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex | 34 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/fontfam.tex | 126 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/opmac-bib.tex | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/csplain/opmac/opmac.tex | 20 |
5 files changed, 226 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/csplain/opmac/fontfam-catalog.tex b/Master/texmf-dist/tex/csplain/opmac/fontfam-catalog.tex new file mode 100644 index 00000000000..56ac94e3c53 --- /dev/null +++ b/Master/texmf-dist/tex/csplain/opmac/fontfam-catalog.tex @@ -0,0 +1,55 @@ +%% fontfam-catalog.tex +%%%%%%%%%%%%%%%%%%%%%% +% Petr Olsak, 2016 + +% This is module for OPmac macros, see http://petr.olsak.net/opmac.html +% This module is automatically loaded when \fontfam[Catalog] is used. + +% See end of the file fontfam.tex for more details. + +\def\fontfamexecC#1#2#3#4#5#6#7{\testfotenc{#6}% + \iftrue\ifx\relax#2\relax \else + \par #7 + \edef\basicfont{\fontname\the\font}% + \noindent {[#1]}\par\nobreak + \def\variants{#2} + \pcatA {}#3\relax + \medskip + \fi\fi +} +\def\pcatA#1{\ifx#1\relax\par\else + \def\prefix{#1}\expandafter\pcatB\variants\relax + \expandafter\pcatA\fi +} +\def\pcatB#1{\ifx#1\relax\par\else + \indent + {\currtt \ifx\prefix\empty \else \expandafter\string\prefix\fi + \string#1 }{\prefix#1% + \edef\tmp{\ifx\prefix\empty\else\fontname\the\font\fi}% + \ifx\tmp\basicfont {\currtt Not available}\else \fontfamsample \fi + \par}% + \expandafter\pcatB\fi +} + +\nonum\sec Font Catalogue + +\begingroup + +Generated \the\day/\the\month/\the\year\space by +{\tt \string\fontfam[Catalog]} (from OPmac). +Encoding: \fotenc, \dimen0=\baselineskip +size: \expandafter\ignorept\the\fontdim /\expandafter\ignorept\the\dimen0 +\bigskip + +\ifx\sizespec\empty \def\sizespec{at10pt}\fi +\letfont\currtt=\tentt +\ifx\loadmathfonts\undefined \let\loadmathfonts=\relax \fi +\let\fontfamexec=\fontfamexecC +\ifx\fontfamsample\undefined + \def\fontfamsample{ABCDabcd áéíóúů řžč ÁÉÍÓÚŮ ŘŽČ 0123456789} +\fi +\fontfamL +\endgroup + +\endinput + diff --git a/Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex b/Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex new file mode 100644 index 00000000000..448805b6f89 --- /dev/null +++ b/Master/texmf-dist/tex/csplain/opmac/fontfam-global.tex @@ -0,0 +1,34 @@ + +\setfontfam [LM fonts] {\rm \it \bf \bi \tt} {\caps} {} {AMS} (8t 8z U) {\input lmfonts} +\famalias{latinmodern}{lmfonts} \famalias{lmfont}{lmfonts} +\famalias{latinmodernfonts}{lmfonts} \famalias{latinmodern}{lmfonts} + +\setfontfam [Times] {\rm \it \bf \bi \tt} {} {} {TX} (8t 8z) {\input ctimes} +\famalias{timesroman}{times} +\setfontfam [Helvetica] {\rm \it \bf \bi \tt} {\cond} {} {TX} (8t 8z) {\input chelvet} +\setfontfam [Avantgarde] {\rm \it \bf \bi \tt} {} {} {TX} (8t 8z) {\input cavantga} +\setfontfam [Bookman] {\rm \it \bf \bi \tt} {} {} {TX} (8t 8z) {\input cbookman} +\setfontfam [Palatino] {\rm \it \bf \bi \tt} {} {} {TX} (8t 8z) {\input cpalatin} +\setfontfam [New Century] {\rm \it \bf \bi \tt} {} {} {TX} (8t 8z) {\input cncent} + +\setfontfam [TG Termes] {\rm \it \bf \bi} {\caps} {} {TX} (8t 8z U) {\input cs-termes} +\famalias{termes}{tgtermes} \famalias{texgyretermes}{tgtermes} +\setfontfam [TG Heros] {\rm \it \bf \bi} {\caps \cond} {} {TX} (8t 8z U) {\input cs-heros} +\famalias{heros}{tgheros} \famalias{texgyreheros}{tgheros} +\setfontfam [TG Adventor] {\rm \it \bf \bi} {\caps} {} {TX} (8t 8z U) {\input cs-adventor} +\famalias{adventor}{tgadventor} \famalias{texgyreadventor}{tgadventor} +\setfontfam [TG Bonum] {\rm \it \bf \bi} {\caps} {} {TX} (8t 8z U) {\input cs-bonum} +\famalias{bonum}{tgbonum} \famalias{texgyrebonum}{tgbonum} +\setfontfam [TG Pagella] {\rm \it \bf \bi} {\caps} {} {TX} (8t 8z U) {\input cs-pagella} +\famalias{pagella}{tgpagella} \famalias{texgyrepagella}{tgpagella} +\setfontfam [TG Schola] {\rm \it \bf \bi} {\caps} {} {TX} (8t 8z U) {\input cs-schola} +\famalias{schola}{tgschola} \famalias{texgyreschola}{tgschola} +\setfontfam [TG Cursor] {\rm \it \bf \bi} {\caps} {} {TX} (8t 8z U) {\input cs-cursor} +\famalias{cursor}{tgcursor} \famalias{texgyrecursor}{tgcursor} + +\setfontfam [Antykwa Torunska] {\lr \li \rm \it \mr \mi \bf \bi} {} {} {TX} (8t 8z) {\input cs-antt} +\setfontfam [Antykwa Poltawskiego] {\rm \it \bf \bi} {\caps \wli} {} {TX} (8t 8z U) {\input cs-polta} + +\setfontfam [Charter] {\rm \it \bf \bi} {} {} {TX} (8t 8z) {\input cs-charter} +\setfontfam [Arev Sans] {\rm \it \bf \bi} {} {} {TX} (8t) {\input cs-arev} +\setfontfam [Bera] {\rm \it \bf \bi} {\sans} {} {TX} (8t) {\input cs-bera} diff --git a/Master/texmf-dist/tex/csplain/opmac/fontfam.tex b/Master/texmf-dist/tex/csplain/opmac/fontfam.tex new file mode 100644 index 00000000000..519249fbb83 --- /dev/null +++ b/Master/texmf-dist/tex/csplain/opmac/fontfam.tex @@ -0,0 +1,126 @@ +%% fontfam.tex +%%%%%%%%%%%%%%%%%%%% +% Petr Olsak, 2016 + +% This is module for OPmac macros, see http://petr.olsak.net/opmac.html +% The file is read automatically when \fontfam macro is used. +% The command: +% \fontfam [Font Family Name] +% loads the approriate fontfile or lists the available +% Font Family Names if unknown. Example: +% \fontfam [Times] or \fontfam [Times Roman] ... does \input ctimes + +% See end of this file this for more details. + +\ifx\OPmacversion\udefined \input opmac \fi + +\def\fontfamL{} +\def\setfontfam [#1]{\def\fsname{}\setfsname #1 {} \setfontfamB{#1}} +\def\setfsname #1 {\ifx\relax#1\relax + \lowercase\expandafter{\expandafter\def\expandafter\fsname\expandafter{\fsname}}% + \else \addto\fsname{#1}\expandafter\setfsname\fi +} +\def\setfontfamB#1#2#3#4#5#6(#7)#8{\sdef{fs:\fsname}{\fontfamexec{#1}{#2}{#3}{#4}{#5}{#7}{#8}}% + \expandafter\addto\expandafter\fontfamL\csname fs:\fsname\endcsname +} +\def\fontfam[#1]{\def\fontfamname{#1}% + \ifx\fotenc\undefined + \ifx\chyph\undefined \def\fotenc{8t}\else \def\fotenc{8z}\fi + \ifx\font\corkencoded \def\fotenc{8t}\fi + \ifx\font\unicoded \def\fotenc{U}\fi + \def\tmp##1##2\relax{\def\tmp{##2}}\tmp ^^^^abcd\relax + \ifx\tmp\empty \def\fotenc{U}\fi + \fi + \let\fontfamexec=\fontfamexecA + \def\fsname{}\setfsname #1 {} + \expandafter \ifx \csname fs:\fsname\endcsname \relax + \immediate\write16{\string\fontfam: unknown font family [#1] (\fotenc). Choose:} + {\let\fontfamexec=\fontfamexecB \fontfamL}% + \else \csname fs:\fsname\expandafter\expandafter\expandafter\endcsname + \fi +} +\def\fontfamexecA#1#2#3#4#5#6#7{\testfotenc{#6}\iftrue#7 \else + \opwarning{The [#1] family is unavailable in (\fotenc) encoding}\fi +} +\def\fontfamexecB#1#2#3#4#5#6#7{\testfotenc{#6}% + \iftrue + {\toks2={#2}\toks3={#3}\toks4={#4}% + \immediate\write16{\space[#1] \space + {\the\toks2 + \ifx\relax#3\relax \else ; mod:\the\toks3 \fi + \ifx\relax#4\relax \else ; \the\toks4 \fi + \ifx\relax#5\relax \else ; +#5\fi} (#6)}}% + \fi +} +\def\testfotenc#1{\def\tmpa{ #1 }\edef\tmpb{\space\fotenc\space}% + \ifx\relax#1\relax \def\tmpa{x}\def\tmpb{x}\fi + \expandafter\isinlist\expandafter\tmpa\expandafter{\tmpb}% +} + +\def\famalias#1#2{\slet{fs:#1}{fs:#2}} + +\input fontfam-global + +\openin10=fontfam-local +\ifeof10 \else \closein10 \input fontfam-local \fi + +\setfontfam [Catalog] {} {} {print catalogue} {} () {\input fontfam-catalog} +\famalias{catalogue}{catalog} + +\endinput + +------------------------------------------------------------ + +After + + \input opmac + +you can use + + \fontfam [Font Family Name]. + +The [Font Family Names] are declared in fontfam-global.tex file and a user +can set his/her own data to fontfam-local.tex file with analogical syntax. + +The parameter [Font Family Name] is case insensitive and the spaces are +irrelevat in it. So [Times Roman] is the same as [TimesRoman] or [timesroman]. + +If a required [Font Family Name] is not known, then all available Font Family +Names are printed on terminal and into log file. Typical usage: \fontfam [?]. + +If a required [Font Family Name] is known then appropriate \input fontfile +is done. Nothing more. This means that \fontfam gives you possibility to +keep a good overview about fontfiles. + +You can use special parameter \fontfam [Catalog]. Then all available font +families are printed to the document with font samples. The pre-defined font +sample can be rewritten: \def\fontfamsample{...}. + +Each fontfile supports a limited set of encodings of the fonts. This is +listed in round brackets: 8t means T1 encoding, 8z means IL2 encoding and +U means Unicode. The default encoding is 8t in pdftex, 8z in pdfcsplain. +XeTeX or LuaTeX uses U as default. The csplain provides one change of default +encoding at begining of the document using \input t1code or \input ucode. + +If a fontfile (required by [Font Family name]) does not provide chosen encoding +then warning occurs and nothig is done. The list of [Font Family Names] +printed by \fontfam [?] or \fontfam [Catalog] includes only those Names +which provides the encoding currently chosen. + +The fontfam-global.tex or fontfam-local.tex files uses \setfontfam with +following format: + +\setfontfam [Name] {variants} {modifiers} {comment} {math} (encodings) {\input fontfile} + +And \famalias can be used: + +\famalias{aliasname}{origname} + +The aliasname and origname must be lowecase and without spaces. See +fontfam-global.tex for examples. + +Note that the macro file fontfam.tex and the data fontfam-global.tex and +fontfam-local.tex are read on demand only when \fontfam macro is used in +OPmac. It is not loaded by OPmac directly because user may not need to use +\fontfam, so the data are irrelevant in such case. And you can generate +a TeX format with opmac macros. diff --git a/Master/texmf-dist/tex/csplain/opmac/opmac-bib.tex b/Master/texmf-dist/tex/csplain/opmac/opmac-bib.tex index d5c90b9733d..ead50e6b3d0 100644 --- a/Master/texmf-dist/tex/csplain/opmac/opmac-bib.tex +++ b/Master/texmf-dist/tex/csplain/opmac/opmac-bib.tex @@ -14,7 +14,7 @@ % before using the command \usebib. % For more information see the end of this file. -\ifx\usebib\udefined \else \endinput \fi +\ifx\MakeReference\udefined \else \endinput \fi \ifx\OPmacversion\undefined \input opmac \fi \ifx\printbib\undefined \errmessage{Please, upgrade OPmac to version Apr. 2014 or newer} @@ -52,7 +52,7 @@ \global\let\addcitelist=\writeXcite \def\tmp##1[*]##2\relax{\def\tmp{##2}}\expandafter\tmp\citelist[*]\relax \ifx\tmp\empty\else % there was \nocite[*] used. - \setbox0=\vbox{\def\citelist{}\adef@{\readentry}% + \setbox0=\vbox{\def\citelist{}\adef@{\readbibentry}% \input #3.bib \expandafter}\expandafter\def\expandafter\citelist\expandafter{\citelist}% \fi @@ -64,9 +64,9 @@ \egroup \fi } -\def\readentry#1#{\readentryA} -\def\readentryA#1{\readentryB#1,,\relax!.} -\def\readentryB#1#2,#3\relax!.{\addto\citelist{\citeI[#1#2]}} +\def\readbibentry#1#{\readbibentryA} +\def\readbibentryA#1{\readbibentryB#1,,\relax!.} +\def\readbibentryB#1#2,#3\relax!.{\addto\citelist{\citeI[#1#2]}} % Corrections in librarian macros: @@ -324,6 +324,6 @@ History: Apr. 2014: released Jan. 2016: "first entry wins" implemented - +Apr. 2016: \readentry -> \readbibentry, \usebib->\MakeReference %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end of the opmac-bib.tex diff --git a/Master/texmf-dist/tex/csplain/opmac/opmac.tex b/Master/texmf-dist/tex/csplain/opmac/opmac.tex index 28940e0864e..7ecc4ac5581 100644 --- a/Master/texmf-dist/tex/csplain/opmac/opmac.tex +++ b/Master/texmf-dist/tex/csplain/opmac/opmac.tex @@ -1,11 +1,11 @@ % OPmac %%%%%%%%%%%%%%%%%%%%%%%%%%% -%% Petr Olsak, 2012 -- 2015 +%% Petr Olsak, 2012 -- 2016 %% The history of versions is at the end of this file, after \endpinput \ifx\OPmacversion\undefined \else \endinput \fi -\def\OPmacversion{Apr. 2016b} +\def\OPmacversion{Apr. 2016c} \immediate\write16{This is OPmac (Olsak's Plain macros), version <\OPmacversion>} %%%%%%%%%%%%%% Basic macros, sec. 3.1 in opmac-d.pdf @@ -73,7 +73,6 @@ } \egroup - %%%%%%%%%%%%%% Global parameters, sec. 3.2 in opmac-d.pdf \widowpenalty=10000 @@ -243,6 +242,7 @@ \addprotect\textfontsize \addprotect\textfontscale \addprotect\em +\def\fontfam{\par \input fontfam \fontfam} %%%%%%%%%%%%%% Multilingual support, sec. 3.5 in opmac-d.pdf @@ -321,7 +321,6 @@ } \def\Xlabel#1#2{\sxdef{lab:#1}{#2}\sxdef{pgref:#1}{\the\lastpage}} - %%%%%%%%%%%%%% Chapters, sections, subsections -- sec. 3.8 in opmac-d.pdf \def\printchap#1{\vfil\break @@ -410,7 +409,6 @@ \def\nbpar{{\interlinepenalty=10000\endgraf}} \def\nl{\hfil\break} - %%%%%%%%%%%%%% Captions, equations -- sec. 3.9 in opmac-d.pdf \newcount\tnum \newcount\fnum \newcount\dnum @@ -616,7 +614,6 @@ \def\scanprevii#1/#2&{\def\previi{#2}\def\tmpa{#1}\edef\tmpa{\meaning\tmpa}} \def\previi{} % previous index item - %%%%%%%%%%%%%% Sorting -- sec. 3.13 in opmac-d.pdf \def\sortingdata{% @@ -765,7 +762,6 @@ \def\sortreturn#1#2\fi\relax{#1} \def\fif{\fi} \def\gobbletoend #1\end{} - %%%%%%%%%%%%%% \begmulti ... \endmulti TBN p. 244, 245 -- sec. 3.14 in opmac-d.pdf \newcount\mullines @@ -901,7 +897,6 @@ \def\draft{\opwarning{\string\draft: Grey color is possible in pdfTeX only}} \fi - %%%%%%%%%%%%%% Hyperrefs -- sec. 3.16 in opmac-d.pdf \def\destheight{1.4em} @@ -975,7 +970,6 @@ \def\urlslashslash{/\urlskip/} \addprotect\url - %%%%%%%%%%%%%% Outlines -- sec. 3.17 in opmac-d.pdf \def\outlines#1{\pdfcatalog{/PageMode/UseOutlines}\openref\ifx\toclist\empty @@ -1045,7 +1039,6 @@ \let\insertoutline=\outlines \fi - %%%%%%%%%%%%%% Verbatim, \begtt, \endtt -- sec. 3.18 in opmac-d.pdf \newcount\ttline \ttline=-1 @@ -1154,7 +1147,6 @@ \def\vireadline{\read\vifile to \tmp \global\advance\viline by1 } \def\viprintline{\expandafter\addto\expandafter\tmpb\expandafter{\tmp}} - %%%%%%%%%%%%%% \table -- sec. 3.19 in opmac-d.pdf \newtoks\tabdata @@ -1211,7 +1203,6 @@ \hbox{\kern\hhkern#1\kern\hhkern}% }\kern\vvkern\hrule}\vrule}} - %%%%%%%%%%%%%% \inspic -- sec. 3.20 in opmac-d.pdf \newdimen\picwidth \picwidth=0pt \let\picw=\picwidth @@ -1272,7 +1263,6 @@ \def\pdfsetmatrix#1{} \def\pdfsave{} \def\pdfrestore{} \fi - %%%%%%%%%%%%%% \fnote, \mnote -- sec 3.22 in opmac-d.pdf \newcount\fnotenum \fnotenum=0 @@ -1332,7 +1322,6 @@ \def\fixmnotes#1{\def\mnotesfixed{#1}} - %%%%%%%%%%%%%% \cite, \bib, \usebibtex, \usebbl -- sec. 3.23 in opmac-d.pdf \newwrite\auxfile % AUX file for BibTeX @@ -1529,6 +1518,7 @@ } \def\Xcite#1{\addto\citelistB{\citeI[#1]}} +\def\usebib{\par \input opmac-bib \usebib} %%%%%%%%%%%%%% output -- sec. 3.24 in opmac-d.pdf @@ -1567,7 +1557,6 @@ \newcount\lastpage \lastpage=0 % the last page of the document \def\Xpage#1{\lastpage=#1 \fnotenumlocal=0 } - %%%%%%%%%%%%%% margins -- sec. 3.25 in opmac-d.pdf \newdimen\pgwidth \newdimen\pgheight \pgwidth=0pt @@ -1772,5 +1761,6 @@ Apr. 2016 \frame: redundant group removed Apr. 2016a \eoldef introduced to \tit, \chap, \sec, \secc, see OPmac trick 0121 Apr. 2016b \input opmac-luatex.tex introduced \slet introduced +Apr. 2016c \fontfam introduced, \usebib as module loaded %%%%%%%%%%%%%% End of opmac.tex |