From c36a274c633c08115b6006622112f5609031001e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 19 Feb 2020 03:02:04 +0000 Subject: CTAN sync 202002190302 --- macros/luatex/optex/README | 12 + macros/luatex/optex/alloc.opm | 10 +- macros/luatex/optex/basics-a.opm | 47 - macros/luatex/optex/basics-macros.opm | 22 +- macros/luatex/optex/bib-iso690.opm | 922 ++++++++++++ macros/luatex/optex/bib-simple.opm | 183 +++ macros/luatex/optex/catcodes.opm | 137 -- macros/luatex/optex/demo.tex | 125 -- macros/luatex/optex/doc/optex-doc.pdf | Bin 0 -> 145296 bytes macros/luatex/optex/doc/optex-doc.tex | 1546 +++++++++++++++++++++ macros/luatex/optex/doc/optex.1 | 42 + macros/luatex/optex/f-adventor.opm | 2 +- macros/luatex/optex/f-antt.opm | 4 +- macros/luatex/optex/f-baskerville.opm | 2 +- macros/luatex/optex/f-bonum.opm | 4 +- macros/luatex/optex/f-cursor.opm | 2 +- macros/luatex/optex/f-gfsbodoni.opm | 2 +- macros/luatex/optex/f-heros.opm | 4 +- macros/luatex/optex/f-libertine-s.opm | 2 +- macros/luatex/optex/f-libertine.opm | 4 +- macros/luatex/optex/f-lmfonts.opm | 4 +- macros/luatex/optex/f-pagella.opm | 4 +- macros/luatex/optex/f-schola.opm | 4 +- macros/luatex/optex/f-technika.opm | 2 +- macros/luatex/optex/f-termes.opm | 4 +- macros/luatex/optex/f-xcharter.opm | 2 +- macros/luatex/optex/fams-ini.opm | 22 +- macros/luatex/optex/fonts-catalog.opm | 36 +- macros/luatex/optex/fonts-opmac.opm | 2 +- macros/luatex/optex/fonts-resize.opm | 8 +- macros/luatex/optex/fonts-select.opm | 41 +- macros/luatex/optex/hyphen-lan.opm | 130 +- macros/luatex/optex/if-macros.opm | 19 +- macros/luatex/optex/logos.opm | 13 +- macros/luatex/optex/luatex-ini.opm | 7 - macros/luatex/optex/math-macros.opm | 12 +- macros/luatex/optex/math-preload.opm | 5 +- macros/luatex/optex/math-unicode.opm | 155 +++ macros/luatex/optex/mathclass.opm | 1591 +++++++++++++++++++++ macros/luatex/optex/op-demo.tex | 127 ++ macros/luatex/optex/op-macros.opm | 94 ++ macros/luatex/optex/opmac-rest.opm | 148 +- macros/luatex/optex/optex.ini | 37 +- macros/luatex/optex/pdfuni-string.opm | 15 +- macros/luatex/optex/plain-macros.opm | 30 +- macros/luatex/optex/prefixed.opm | 17 +- macros/luatex/optex/unimath-codes.opm | 304 ++++ macros/luatex/optex/unimath-table.opm | 2467 +++++++++++++++++++++++++++++++++ macros/luatex/optex/usebib.opm | 334 +++++ macros/luatex/optex/verbatim.opm | 189 +++ 50 files changed, 8255 insertions(+), 640 deletions(-) delete mode 100644 macros/luatex/optex/basics-a.opm create mode 100644 macros/luatex/optex/bib-iso690.opm create mode 100644 macros/luatex/optex/bib-simple.opm delete mode 100644 macros/luatex/optex/catcodes.opm delete mode 100644 macros/luatex/optex/demo.tex create mode 100644 macros/luatex/optex/doc/optex-doc.pdf create mode 100644 macros/luatex/optex/doc/optex-doc.tex create mode 100644 macros/luatex/optex/doc/optex.1 create mode 100644 macros/luatex/optex/math-unicode.opm create mode 100644 macros/luatex/optex/mathclass.opm create mode 100644 macros/luatex/optex/op-demo.tex create mode 100644 macros/luatex/optex/op-macros.opm create mode 100644 macros/luatex/optex/unimath-codes.opm create mode 100644 macros/luatex/optex/unimath-table.opm create mode 100644 macros/luatex/optex/usebib.opm create mode 100644 macros/luatex/optex/verbatim.opm (limited to 'macros/luatex/optex') diff --git a/macros/luatex/optex/README b/macros/luatex/optex/README index 066037a0f9..8cc02a11bf 100644 --- a/macros/luatex/optex/README +++ b/macros/luatex/optex/README @@ -5,3 +5,15 @@ Author: Petr Olsak, This software is in public domain. See http://petr.olsak.net/optex + +History: + +<0.03> optex-doc optex.1 included, + verbatim.opm re-implmented, + math-unicode implemented, + usebib.opm + bib-style.opm included + \catcodetable stack implemented + bugfixing of macros. + catcodes.opl: removed, one can use \catcodetable, ... primitives, + pdfuni-string: lua code for lua5.3 fixed. +<0.02> Released. diff --git a/macros/luatex/optex/alloc.opm b/macros/luatex/optex/alloc.opm index 1e27d0cc23..6ca5939ab1 100644 --- a/macros/luatex/optex/alloc.opm +++ b/macros/luatex/optex/alloc.opm @@ -55,6 +55,14 @@ \_fi } +\_newcount \_attributealloc \_attributealloc=0 +\_chardef\_maiattribute=\_maicount +\_def\_newattribute #1{\_allocator #1{attribute}\_attributedef} + +\_newcount \_catcodetablealloc \_catcodetablealloc=10 +\_chardef\_maicatcodetable=32767 +\_def\_newcatcodetable #1{\_allocator #1{catcodetable}\_chardef} + \_newcount \tmpnum \_newcount \_tmpnum \_newdimen \tmpdim \_newdimen \_tmpdim @@ -65,8 +73,8 @@ \_newbox\_voidbox % permanently void box register \_public - \maicount \maidimen \maiskip \maimuskip \maibox \maitoks \mairead \maiwrite \maimath \newcount \newdimen \newskip \newmuskip \newbox \newtoks \newread \newwrite \newmath + \newattribute \newcatcodetable \insertmin \newinsert \maxdimen \hideskip \centering \zoskip \voidbox ; diff --git a/macros/luatex/optex/basics-a.opm b/macros/luatex/optex/basics-a.opm deleted file mode 100644 index 988457837d..0000000000 --- a/macros/luatex/optex/basics-a.opm +++ /dev/null @@ -1,47 +0,0 @@ -%% This is part of OpTeX project, see http://petr.olsak.net/optex - -\_codedecl \sdef {Basic macros for OpTeX <2019-05-21>} - -\let\_bgroup={ \let\_egroup=} - -\_bgroup \_lccode`\.=`\\ \_lowercase{\_egroup \_def\_nbackslash {.}} -\_def\_empty {} -\_def\_wlog {\_immediate\_write-1 } % write on log file (only) - -\_def\_sdef #1{\_ea\_def \_csname#1\_endcsname} -\_def\_sxdef #1{\_ea\_xdef \_csname#1\_endcsname} -\_def\_slet#1#2{\_ea\_let \_csname#1\_ea\_endcsname \_csname#2\_endcsname} -\_def\_adef#1{\_catcode`#1=13 \_begingroup \_lccode`\~=`#1\_lowercase{\_endgroup\_def~}} -\_def\_cs #1{\_csname#1\_endcsname} - -\_long\_def \_addto #1#2{\_ea\_def\_ea#1\_ea{#1#2}} -\_ea\_def \_ea\_meaningsepare \_ea#\_ea1\_string m#2:#3->#4^{{#1}{#3}{#4}} - -\_long\_def\_isinlist #1#2#3{% \isinlist \list{word}\iftrue - \_long\_def\_isinlistA ##1#2##2\_end{% - \_def\_isinlistA {##2}% - \_unless\_ifx\_isinlistA\_empty - }% - \_ea \_isinlistA #1\_endlistsep#2\_end -} -\_bgroup \_catcode`!=3 \_catcode`?=3 -\_gdef\_replstring #1#2#3{% \replstring #1{stringA}{stringB} - \_long\_def\_replacestringsA##1#2{\_def #1{##1}\_replacestringsB}% - \_long\_def\_replacestringsB##1#2{\_ifx!##1\_relax \_else \_addto #1{#3##1}% - \_ea\_replacestringsB\_fi}% - \_ea\_replacestringsA #1?#2!#2% - \_long\_def\_replacestringsA##1?{\_def #1{##1}}\_ea\_replacestringsA #1} -\_egroup - -\_def\_loggingall{\_tracingcommands=3 \tracingstats=2 \tracingassigns=1 - \tracingpages=1 \tracingoutput=1 \tracinglostchars=1 - \tracingmacros=2 \tracingparagraphs=1 \tracingrestores=1 } -\_def\_tracingall{\tracingonline=1 \loggingall} - -\_public - \bgroup \egroup \nbackslash \sdef \sxdef \slet \adef - \addto \meaningsepare \wlog \empty - \isinlist \replstring \loggingall \tracingall ; - -\_endcode % ------------------------------------- - diff --git a/macros/luatex/optex/basics-macros.opm b/macros/luatex/optex/basics-macros.opm index 368b9bd332..638270d38b 100644 --- a/macros/luatex/optex/basics-macros.opm +++ b/macros/luatex/optex/basics-macros.opm @@ -1,17 +1,16 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \sdef {Basic macros for OpTeX <2019-05-21>} +\_codedecl \sdef {Basic macros for OpTeX <2020-02-14>} \let\_bgroup={ \let\_egroup=} \_bgroup \_lccode`\.=`\\ \_lowercase{\_egroup \_def\_nbackslash {.}} \_edef \_nbb {\_nbackslash\_nbackslash} -\_edef \_pcent{\_xstring\%} +\_edef \_pcent{\_csstring\%} \_def \_empty {} \_def \_space { } \_def \_null {\_hbox{}} \_def \_wlog {\_immediate\_write-1 } % write on log file (only) -\_def \_wterm {\_immediate\_write16 } \_def \_opwarning #1{\_wterm{WARNING: #1.}} \_def \_sdef #1{\_ea\_def \_csname#1\_endcsname} @@ -21,16 +20,6 @@ \_def \_cs #1{\_csname#1\_endcsname} \_long\_def \_addto #1#2{\_ea\_def\_ea#1\_ea{#1#2}} -\_ea\_def \_ea\_meaningsepare \_ea#\_ea1\_string m#2:#3->#4^{{#1}{#3}{#4}} - -\_bgroup \_catcode`!=3 \_catcode`?=3 -\_gdef\_replstring #1#2#3{% \replstring #1{stringA}{stringB} - \_long\_def\_replacestringsA##1#2{\_def #1{##1}\_replacestringsB}% - \_long\_def\_replacestringsB##1#2{\_ifx!##1\_relax \_else \_addto #1{#3##1}% - \_ea\_replacestringsB\_fi}% - \_ea\_replacestringsA #1?#2!#2% - \_long\_def\_replacestringsA##1?{\_def #1{##1}}\_ea\_replacestringsA #1} -\_egroup \_def\_loggingall{\_tracingcommands=3 \tracingstats=2 \tracingassigns=1 \tracingpages=1 \tracingoutput=1 \tracinglostchars=1 @@ -41,10 +30,11 @@ \_def\_remfirstunderscoreA#1#2\_relax#3{\_if _#1\_def#3{#2}\_fi} \_public - \bgroup \egroup \nbackslash \sdef \sxdef \slet \cs \adef - \addto \meaningsepare \wlog \wterm \opwarning + \bgroup \egroup \nbackslash \empty \space \null \nbb \pcent \ncaret - \isinlist \replstring \remfirstunderscore \loggingall \tracingall ; + \sdef \sxdef \slet \cs \adef + \addto \wlog \opwarning + \loggingall \tracingall ; \_endcode % ------------------------------------- diff --git a/macros/luatex/optex/bib-iso690.opm b/macros/luatex/optex/bib-iso690.opm new file mode 100644 index 0000000000..a104e58921 --- /dev/null +++ b/macros/luatex/optex/bib-iso690.opm @@ -0,0 +1,922 @@ +% opmac-bib-iso690 ... the OPmac bib style for reading .bib databases +% Petr Olsak, Apr. 2015 (beta) +% +% The bibliography printing from .bib files by ISO 690 standard is defied here. +% See the end of this file and the file opmac-bib.tex for more information. + +\ifx\opmacbibstyle\undefined \errmessage + {This file can be read by ``\string\usebib/? (simple) bibfiles'' command only} + \endinput \fi + +% misc: + +\def\maybedot{\ifnum\spacefactor=\sfcode`\.\relax\else.\fi} +\tmpnum=\sfcode`\. \advance\tmpnum by-2 \sfcode`\.=\tmpnum \sfcode`\?=\tmpnum \sfcode`\!=\tmpnum +\let\.=\maybedot % prevents from double periods + +\CreateField {option} +\def\isbiboption#1#2{\edef\tmp{\noexpand\isbiboptionA{#1}}\tmp} +\def\isbiboptionA#1{\def\tmp##1 #1 ##2\relax{% + \if^##2^\csname iffalse\expandafter\endcsname \else\csname iftrue\expandafter\endcsname \fi}% + \expandafter\tmp\biboptionsi #1 \relax} +\def\bibopt[#1]#2#3{\isbiboption{#1}\iftrue\def\tmp{#2}\else\def\tmp{#3}\fi\tmp} +\def\biboptionvalue#1#2{\def\tmp##1 #1:##2 ##3\relax{\def#2{##2}}% + \expandafter\tmp\biboptionsi #1: \relax} + +\def\readbiboptions{% + \RetrieveFieldIn{option}\biboptionsi + \toks1=\expandafter{\biboptionsi}% + \ifx\biboptions\undefined \toks2={}\else \toks2=\expandafter{\biboptions}\fi + \edef\biboptionsi{\space \the\toks1 \space \the\toks2 \space}% +} + +% Formating of Author/Editor lists: + +\def\firstauthorformat{% + \upper{\Lastname}\bprintc\Firstname{, *}\bprintc\Von{ *}\bprintc\Junior{, *}% +} +\def\otherauthorformat{% + \bprintc\Firstname{* }\bprintc\Von{* }\upper{\Lastname}\bprintc\Junior{, *}% +} +\def\commonname{% + \ifnum\NameCount=1 + \firstauthorformat + \ifx\dobibmark\undefined \edef\dobibmark{\Lastname}\fi + \else + \ifnum0\namecount=\NameCount + \ifx\maybeetal\empty \bibconjunctionand\else , \fi + \else , \fi + \otherauthorformat + \fi +} +\def\authorname{% + \ifnum\NameCount>0\namecount\relax\else \commonname \fi + \ifnum\NameCount=0\namecount\relax \maybeetal \fi +} +\let\editorname=\authorname + +\def\prepareauedoptions#1{% + \def\mabyetal{}\csname lb@abbreviatefalse\endcsname + \biboptionvalue{#1max}\authormax + \biboptionvalue{#1min}\authormin + \biboptionvalue{#1pre}\authorpre + \biboptionvalue{#1print}\authorprint + \isbiboption{#1etal}\iftrue \def\maybeetal{\Mtext{bib.etal}}\fi + \biboptionvalue{#1trim}\autrim + \let\namecountraw=\namecount + \ifx\authormax\empty \else + \ifnum 0\authormax<0\namecount + \edef\namecount{\ifx\authormin\empty\authormax\else\authormin\fi}% + \def\maybeetal{\Mtext{bib.etal}}% + \fi\fi + \ifx\autrim\empty \def\autrim{10000}\fi + \ifnum\autrim=0 \def\autrim{10000}\fi + \ifnum 0\namecount<\autrim\relax \else \AbbreviateFirstname \fi +} +\def\maybeetal{} + +\ifx\upper\undefined + \ifx\sc\undefined \def\upper{\uppercase\expandafter}\else \def\upper#1{{\sc#1}}\fi +\fi + +% Preparing bib-mark (used when \nonumcitations is set): + +\def\setbibmark{% + \ifx\dobibmark\undefined \def\dobibmark{}\fi + \RetrieveFieldIn{bibmark}\tmp + \ifx\tmp\empty \RetrieveFieldIn{year}\tmp \edef\tmp{\dobibmark, \tmp}\fi + \bibmark=\expandafter{\tmp}% +} + +% Multilinguals: English Czech Slovak + +\mtdef{bib.and} {, and } { a } {} +\mtdef{bib.etal} { et al.} { a~kol.} {} +\mtdef{bib.edition} { ed.} { vyd.} {} +\mtdef{bib.bachthesis} {Bachelor's Thesis} {Bakalářská práce} {Bakalárska práca} +\mtdef{bib.masthesis} {Master's Thesis} {Diplomová práce} {Diplomová práca} +\mtdef{bib.phdthesis} {Ph.D. Thesis} {Disertační práce} {Dizertačná práca} +\mtdef{bib.available} {Available from } {Dostupné na } {} +\mtdef{bib.availablealso} {Available also from } {Dostupné též na } {Dotupné tiež na } +\mtdef{bib.citedate} {cit.~} {vid.~} {} +\mtdef{bib.volume} {Vol.~} {ročník~} {} +\mtdef{bib.number} {No.~} {č.~} {} +\mtdef{bib.prepages} {pp.~} {s.~} {} +\mtdef{bib.postpages} {~p.} {~s.} {} +\mtdef{bib.editor} {,~ed.} {,~editor} {} +\mtdef{bib.editors} {,~eds.} {,~editoři} {,~editori} + + +\def\bibconjunctionand{\Mtext{bib.and}} +\def\preurl{\Mtext{bib.available}} +\let\predoi=\preurl +\def\postedition{\mtext{bib.edition}} +\def\Inclause{In:~} +\def\prevolume{\mtext{bib.volume}} +\def\prenumber{\mtext{bib.number}} +\def\prepages{\mtext{bib.prepages}} +\def\posteditor{\ifnum0\namecountraw>1 \Mtext{bib.editors}\else\Mtext{bib.editor}\fi} + + +\chardef\documentlanguage=\language +\def\Mtext#1{\csname _mt:#1:\csname lan:\the\documentlanguage\endcsname\endcsname} + +\CreateField {lang} +\def\setlang#1{\ifx#1\empty \else + \expandafter \ifx \csname #1Patt\endcsname \relax + \opwarning{The language "#1" used in .bib file is unknown} + \else \language=\csname #1Patt\endcsname + \fi\fi +} +\ifx\USenglish\undefined \chardef\USenglish=0 \fi +\let\enPatt=\USenglish \let\usPatt=\USenglish +\ifx\csPatt \undefined \let\csPatt=\czPatt \else \let\czPatt=\csPatt \fi + +% Non-standard fieldnames: + +\CreateField {ednote} +\CreateField {citedate} +\CreateField {numbering} +\CreateField {isbn} +\CreateField {issn} +\CreateField {doi} +\CreateField {url} +\CreateField {bibmark} + +% Sorting: + +\SortingOrder{name,year}{lfvj} +\SpecialSort {key} + +% Misc: + +\def\bibwarninga{\bibwarning} +\def\bibwarningb{\bibwarning} + +\def\docitedate #1/#2/#3/#4\relax{[\Mtext{bib.citedate}% + \if^#2^#1\else + \if^#3^#1/#2\else + \docitedateA{#1}{#2}{#3}% + \fi\fi ]% +} +\def\docitedateA#1#2#3{% + \ifx\csPatt\undefined \mathchardef\csPatt=10000 \fi + \ifx\skPatt\undefined \mathchardef\skPatt=10000 \fi + \ifnum\documentlanguage=\csPatt \docitedateCS{#1}{#2}{#3}% + \else \ifnum\documentlanguage=\skPatt \docitedateSK{#1}{#2}{#3}% + \else \docitedateEN{#1}{#2}{#3}% + \fi\fi +} +\def\docitedateEN#1#2#3{#1-#2-#3} +\def\docitedateCS#1#2#3{\hbox{\tmpnum=#3 \the\tmpnum. \tmpnum=#2 \the\tmpnum. #1}} +\let\docitedateSK=\docitedateCS + +\def\doyear#1{ + \biboptionvalue{yearprint}\yearprint + \ifx\yearprint\empty#1\else\def\YEAR{#1}\yearprint\fi +} +\def\preparenumbering{% + \def\VOL{\RetrieveField{volume}}% + \def\NO{\RetrieveField{number}}% + \def\PP{\RetrieveField{pages}}% +} +\def\prepareednote{% + \def\EDN{\RetrieveField{edition}}% + \def\ADDR{\RetrieveField{address}}% + \def\PUBL{\RetrieveField{publisher}}% + \def\YEAR{\RetrieveField{year}}% + \def\AU{\bprintb[!author]{\doauthor0{####1}}{}}% + \def\ED{\bprintb[!editor]{\doeditor0{####1}}{}}% + \preparenumbering +} +\def\doedition#1{% + \biboptionvalue{editionprint}\editionprint + \ifx\editionprint\empty#1\postedition\else\def\ED{#1}\editionprint\fi +} +\def\doauthor#1#2{\prepareauedoptions{au}\let\iseditorlist=\undefined + \if1#1\def\AU{#2}\else\let\authorprint=\empty\fi + \ifx\authorprint\empty #2\else \authorprint\fi +} +\def\doeditor#1#2{\prepareauedoptions{ed}\let\firstauthorformat=\otherauthorformat + \if1#1\def\ED{#2}\else\let\authorprint=\empty\fi + \ifx\authorprint\empty #2\posteditor\else \authorprint\fi +} + +% Entry types: + +\sdef{print:BEGIN}{% + \readbiboptions + \biboptionvalue{titlepost}\titlepost + \isbiboption{unpublished}\iftrue \let\bibwarninga=\relax \let\bibwarningb=\relax \fi + \isbiboption{nowarn}\iftrue \let\bibwarning=\relax \fi + \isbiboption{urlalso}\iftrue \def\preurl{\Mtext{bib.availablealso}}\fi + \RetrieveFieldIn{lang}\langentry \setlang\langentry +} +\sdef{print:END}{% + \bprinta [note] {*.}{}% + \setbibmark +} +\def\bookgeneric#1{% + \bprinta [howpublished] {[*].\ }{}% + \bprintb [edition] {\doedition{##1}\.\ }{}% + \bprinta [ednote] {*.\ }{}% + \bprinta [address] {*\bprintv[publisher]{:}{\bprintv[year]{,}{.}}\ }{\bibwarninga}% + \bprinta [publisher] {*\bprintv[year]{,}{.}\ }{\bibwarninga}% + \bprintb [year] {\doyear{##1}\bprintv[citedate]{\bprintv[numbering]{.}{}}{.}\ }{\bibwarning}% + \bprinta [numbering] {\preparenumbering*\bprintv[citedate]{}{\.}\ }{}% + \bprinta [citedate] {\docitedate*///\relax.\ }{}% + #1% + \bprinta [series] {*.\ }{}% + \bprinta [isbn] {ISBN~*.\ }{\bibwarningb}% + \bprinta [issn] {ISSN~*.\ }{}% + \bprintb [doi] {\predoi DOI \ulink[http://dx.doi.org/##1]{##1}.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\sdef{print:book}{% + \bprintb [!author] {\doauthor1{##1}\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\bprintc\titlepost{\.\ *}\bprintv[howpublished]{}{\.}\ }{\bibwarning}% + \bookgeneric{}% +} +\sdef{print:article}{% + \biboptionvalue{journalpost}\journalpost + \bprintb [!author] {\doauthor1{##1}\.\ }{\bibwarning}% + \bprinta [title] {*.\ \bprintc\titlepost{*.\ }}{\bibwarning}% + \bprintb [journal] {{\em##1}\bprintc\journalpost{\.\ *}\bprintv[howpublished]{}{\.}\ }{\bibwarninga}% + \bprinta [howpublished] {[*].\ }{}% + \bprinta [address] {*\bprintb[publisher]{:}{,}\ }{}% + \bprinta [publisher] {*, }{}% + \bprinta [month] {*, }{}% + \bprintb [year] {\doyear{##1}\bprintv[volume,number,pages]{,}{\.}\ }{}% + \bprinta [numbering] {\preparenumbering*\bprintv[citedate]{}{\.}\ } + {\bprinta [volume] {\prevolume*\bprintv[number,pages]{,}{\.}\ }{}% + \bprinta [number] {\prenumber*\bprintv[pages]{,}{\.}\ }{}% + \bprintb [pages] {\prepages\hbox{##1}\bprintv[citedate]{}{\.}\ }{\bibwarninga}}% + \bprinta [citedate] {\docitedate*///\relax.\ }{}% + \bprinta [issn] {ISSN~*.\ }{}% + \bprintb [doi] {\predoi DOI \ulink[http://dx.doi.org/##1]{##1}.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\sdef{print:inbook}{% + \let\bibwarningb=\relax + \bprintb [!author] {\doauthor1{##1}\.\ }{\bibwarning}% + \bprinta [title] {*.\ }{\bibwarning}% + \Inclause + \bprintb [!editor] {\doeditor1{##1}\.\ }{}% + \bprintb [booktitle] {{\em##1}\bprintc\titlepost{\.\ *}\bprintv[howpublished]{}{\.}\ }{\bibwarning}% + \bookgeneric{\bprintb [pages] {\prepages\hbox{##1}. }{}}% +} +\slet{print:inproceedings}{print:inbook} +\slet{print:conference}{print:inbook} + +\sdef{print:thesis}{% + \bprintb [!author] {\doauthor1{##1}\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\bprintc\titlepost{\.\ *}\bprintv[howpublished]{}{\.}\ }{\bibwarning}% + \bprinta [howpublished] {[*].\ }{}% + \bprinta [address] {*\bprintv[school]{:}{\bprintv[year]{,}{.}}\ }{\bibwarning}% + \bprinta [school] {*\bprintv[year]{,}{.}\ }{\bibwarning}% + \bprinta [month] {*, }{}% + \bprintb [year] {\doyear{##1}\bprintv[citedate]{}{.}\ }{\bibwarninga}% + \bprinta [citedate] {\docitedate*///\relax.\ }{}% + \bprinta [type] {*\bprintv[ednote]{,}{.}\ }% + {\ifx\thesistype\undefined\bibwarning\else\thesistype\bprintv[ednote]{,}{.}\ \fi}% + \bprinta [ednote] {*.\ }{}% + \bprintb [doi] {\predoi DOI \ulink[http://dx.doi.org/##1]{##1}.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\sdef{print:phdthesis}{\def\thesistype{\Mtext{bib.phdthesis}}\csname print:thesis\endcsname} +\sdef{print:mastershesis}{\def\thesistype{\Mtext{bib.masthesis}}\csname print:thesis\endcsname} +\sdef{print:bachelorsthesis}{\def\thesistype{\Mtext{bib.bachthesis}}\csname print:thesis\endcsname} + +\sdef{print:generic}{% + \bprintb [!author] {\doauthor1{##1}\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\bprintc\titlepost{\.\ *}\bprintv[howpublished]{}{\.}\ }{\bibwarning}% + \bprinta [howpublished] {[*].\ }{}% + \bprinta [ednote] {\prepareednote*\bprintv[citedate]{}{.}\ }{\bibwarning}% + \bprinta [year] {}{\bibwarning}% + \bprinta [citedate] {\docitedate*///\relax.\ }{}% + \bprintb [doi] {\predoi DOI \ulink[http://dx.doi.org/##1]{##1}.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\slet{print:booklet}{print:generic} +\slet{print:incolleciton}{print:generic} +\slet{print:manual}{print:generic} +\slet{print:proceedings}{print:generic} +\slet{print:techreport}{print:generic} +\slet{print:unpublished}{print:generic} + +\sdef{print:misc}{\let\bibwarning=\relax \csname print:generic\endcsname} + +\endinput + + +opmac-bib-iso690.tex +==================== + +This is the iso690 bibliographic style used by opmac-bib.tex package. + +See op-example.bib for an example of the .bib input. You can try it by: + +\input opmac-bib +\nocite[*] +\usebib/s (iso690) op-example +\end + + +Common rules in .bib files: +-------------------------- + +There are entries of type @FOO{...} in the .bib file. Each entry consists of +fields in the form name = "value", or name = {value}. No matter which form is +used. If the value is pure numeric then you can say simply name = value. +Warning: the comma after each field value is mandatory! If it is missing then the +next field is ignored or bad interpreted. + +The entry names and field names are case insensitive. If there exist a data +field no mentioned here then it is simply ignored. You can use it to store +more information (abstract, for example). + +There are ``standard fields'' used in ancient bibTeX (author, title, editor, edition, +etc., see http://en.wikipedia.org/wiki/BibTeX). The iso690 style introduces +several ``non-standard'' fields: ednote, numbering, isbn, issn, doi, url, +citedate, key, bibmark. They are documented here. + +Moreover, there are two optional special fields: + +lang = language of the entry. The hyphenation plus autogenerated phrases and + abbreviations will be typeset by this language. +option = options by which you can control special printing of vairous fields. + +There can be only one option field per each entry with (may be) more options +separated by spaces. You can declare the global option(s) in your document +applied for each entry by \def\biboptions{...}. + + +The author field +---------------- + +All names in the author list have to be separated by " and ". Each author +can be written by various formats (the ``von'' part is typically missing): + + Firstname(s) von Lastname + or + von Lastname, Firstname(s) + or + von Lastname, After, Firstname(s) + +Only the Lastname part is mandatory. Examples: + + Petr Olšák + or + Olšák, Petr + + Leonardo Piero da Vinci + or + da Vinci, Leonardo Piero + or + da Vinci, painter, Leonardo Piero + +The separator " and " between authors will be converted to comma during +printing, but between semifinal and final author the word "and" (or something +different depending on current language) is printed. + +The first author is printed in reverse order: ``LASTNAME, Firstname(s) von, +After'' and the others author are printed in normal order: ``Firstname(s) +von LASTNAME, After''. This feature follows the ISO 690 norm. The Lastname +is capitalised using uppercase letters, but if the \sc command is defined, +then it is used as an font switcher in the form {\sc Lastname}. You can +declare the ``Caps and small caps'' font here. + +You can specify the option "aumax:". The denotes the +maximum authors to be printed. The rest of authors are ignored and the +"et~al." is appended to the list of printed authors. This text is +printed only if the "aumax" value is less than the real number of authors. +If you have the same number of authors in the .bib file as you need to print +but you want to append "et~al." then you can use "auetal" option. + +There is a "aumin:" option which denotes the definitive number of +printed authors if the author list is not fully printed due to "aumax". +If "aumin" is unused then "aumax" authors is printed in such case. + +All authors are printed if "aumax:" option isn't given. +There is no internal limit. But you can set the global options in +your document by setting the \biboptions macro. For example: + + \def\biboptions {aumax:7 aumin:1} + % if there is 8 or more authors then only first author is printed. + +Examples: + + author = "John Green and Bob Brown and Alice Black", + +output: GREEN, John, Bob BROWN, and Alice BLACK. + + author = "John Green and Bob Brown and Alice Black", + option = "aumax:1", + +output: GREEN, John~et~al. + + author = "John Green and Bob Brown and Alice Black", + option = "aumax:2", + +output: GREEN, John, Bob BROWN~et~al. + + author = "John Green and Bob Brown and Alice Black", + option = "aumax:3", + +output: GREEN, John, Bob BROWN, and Alice BLACK. + + author = "John Green and Bob Brown and Alice Black", + option = "auetal", + +output: GREEN, John, Bob BROWN, Alice BLACK~et~al. + +If you need to add a text before or after authors list, you can use +the "auprint:{}" option. The will be printed instead of the +authors list. The can include \AU macro which expands to the authors +list. Example: + + author = "Robert Calbraith", + option = "auprint:{\AU\space [pseudonym of J. K. Rowling]}", + +output: CALBRAITH Robert [pseudonym of J. K. Rowling]. + +You can use the "autrim:" option. All Firstnames of all authors +are trimmed (i. e. reduced to initials) iff the number of authors in the +author field is greater than or equal to . There is an exception: +"autrim:0" means that no Firstnames are trimmed. This is default behavior. +Another example: "autrim:1" means that all Firstnames are trimmed. + + author = "John Green and Bob Brown and Alice Black", + option = "auetal autrim:1", + +output: GREEN, J., B. BROWN, A. BLACK~et~al. + +If you need to write a team name or institution instead authors, replace all +spaces by \ in this name. Such text is interpreted as Lastname. You +can add the secondary name (interpreted as Firstname) after comma. Example: + + author = "Czech\ Technical\ University\ in\ Prague, Faculty\ of\ Electrical\ Engeneering", + +output: CZECH TECHNICAL UNIVERSITY IN PRAGUE, Faculty of Electrical Engeneering. + + +The editor field +---------------- + +The editor field is used for list of the authors of the collection. The +analogous rules as in author field are used here. It means that the +authors are separated by " and ", the Firstnames, Lastnames etc. are +interpreted and you can use the options "edmax:", "edmin:", +"edetal", "edtrim:" and "edprint:" (with \ED macro). +Example: + + editor = "Jan Tomek and Petr Karas", + option = "edprint:{\ED, editors.} edtrim:1", + +Output: J. TOMEK and P. KARAS, editors. + +If edprint option is not set then {\ED, eds.} or {\ED, ed.} is used +depending on the entry language and on the singular or plural of +the editor(s). + + +The ednote field +---------------- + +The ednote is used as the secondary authors and more editional info. The +value is read as raw data without any interpretation of Lastname, Firstname +etc. + + ednote = "Illustrations by Robert \upper{Agarwal}, edited by Tom \upper{Nowak}", + +output: Illustrations by Robert AGARWAL, edited by Tom NOWAK. + +The \upper command have to be used for Lastnames in ednote field. + + +The title field +--------------- + +This is the title of the work. It will be printed (in common entry types) by +italics. The ISO 690 norm declares, that the title plus optional subtitle +are in italics and they are separated by colon. Next, the optional secondary +title have to be printed in upright font. This can be added by +"titlepost:{}". Example: + + title = "The Simple Title of The Work", +or + title = "Main Title: Subtitle", +or + title = "Main Title: Subtitle", + option = "titlepost:{Secondary title}", + +The output of the last example: + +{\it Main Title: Subtitle}. Secondary title. + + +The edition field +----------------- + +This field is used only for second or more edition of cited work. Write +only the number without the word "edition". The shortcut "ed." (or something +else depending on current language) is added automatically. Examples: + + edition = "Second", + edition = "2nd", + edition = "2$^{\rm nd}$", + edition = "2.", + +Output of the last example: 2. ed. + + edition = "2." + lang = "cs", + +Output: 2. vyd. + +Note, that the example edition = "Second" may cause problems. If you are +using language "cs" then the output is bad: Second vyd. So, you need to +say: + + edition = "Second", + lang = "en", + +You can use "ednprint:{}" option. The the is printed +instead of edition field and shortcut. The edition field must be set. Example: + + edition = "whatever", + option = "ednprint:{Second full revised edition}", + +Output: Second full revised edition. + +You can use \EDN macro in "ednprint" value. This macro is expanded +to the edition value. Example: + + edition = "Second", + option = "ednprint:{\EDN\space full revised edition}", + +or + + edition = "Second full revised edition", + option = "ednprint:{\EDN}", + + +The address, publisher, year fields +----------------------------------- + +This is an anachronism from ancient BibTeX (unfortunately no exclusive) that +the address field includes only the city of the publisher residence. No more +data are here. The publisher field includes the name of the publisher. + + address = "Berlin", + publisher = "Springer Verlag", + year = 2012, + +Output: Berlin: Springer Verlag, 2012. + +Note, that the year needn't to be inserted into quotes because it is pure +numeric. + +The letter a, b etc. are appended to the year automatically, if two or more +subsequent entries in the bibliography list are not distinct by the first +author and year fields. If you needn't this feature, you can use the +"noautoletters" option. + +You can use "yearprint:{}" option. If it is set then the +is used for printing year instead the real field value. The reason: year is +sort sensitive, may be you need to print something else than sorting key. +Example: + + year = 2000, + option = "yearpint:{\copyright 2000}", + +Output: \copyright 2000, sorted by: 2000. + + year = "2012a", + option = "yearprint:{2012}", + +Output: 2012, sorted by: 2012a. + +The address, publisher and year are typically mandatory fields. If they are +missing then the OPmac warning occurs. But you can set "unpublished" +option. Then this warning is suppressed. There is no difference in the +printed output. + + +The url field +------------- + +Use it without \url macro, but with http:// prefix. Example: + + url = "http://petr.olsak.net/opmac.html", + +The ISO 690 norm recommends to add the text ``Available from'' (or +something else if different current language is used) before URL. +It means, that the output of previous example is: + +Available from \url{http://petr.olsak.net/opmac.html}. + +If the "cs" language is the current one than the output is: + +Dostupné z: \url{http://petr.olsak.net/opmac.html}. + +If the "urlalso" option is used, then the added text has the form +``Available also from'' or ``Dostupné také z:'' (if "cs" language is +current). + + +The citedate field +------------------ + +This is the citation date. The field must be in the form year/month/day. It +means, that the two slashes must be written here. The output depends on the +current language. Example: + + citedate = "2004/05/21", + +Output when "en" is current: [cit. 2004-05-21]. +Output when "cs" is current: [vid. 21.~5.~2004]. + + +The howpublished field +---------------------- + +This declares the available medium for cited document if it is not in printed +form. Alternatives: online, CD, DVD, etc. Example: + + howpublished = "online", + +Output: [online]. + + +The volume, number, pages and numbering fields +---------------------------------------------- + +The volume is the ``big mark'' of the journal issue and the number is the +``small mark'' of the journal issue and pages includes the page range of +the cited article in the journal. The volume is prefixed by Vol.~, +the number by No.~ and the pages by pp.~. But these prefixes depends on the +language of the entry. + +Example: + + volume = 31, + number = 3, + pages = "37--42", + +Output: Vol.~31, No.~3, pp.~37--42. + + volume = 31, + number = 3, + pages = "37--42", + lang = "cs", + +Output: ročník~31, č.~3, s.~37--42. + +If you disagree with the default prefixes, you can use the numbering field. +When it is set then it is is used instead of volume, number, pages fields +and instead of any mentioned prefixes. The numbering can include macros \VOL, +\NO, \PP, which are expanded to the respective values of fields. Example: + + volume = 31, + number = 3, + pages = "37--42" + numbering = "Issue~\VOL/\NO, pages~\PP", + +Output: Issue~31/3, pages~37--42 + +Note: The volume, numbers and pages fields are printed without numbering +filed only in the @ARTICLE entry. It means, that if you need to visible them +in the @INBOOK, @INPROCEEDINGS etc. fields, then you must to use numbering field. + + +Common notes about entries +-------------------------- + +The order of the fields in the entry is irrelevant. We use the printed order +in this manual. The exclamation mark (!) denotes the mandatory field. If +such field is missing then the warning occurs during processing. + +If the "unpublished" option is set then the fields address, publisher, year, +isbn and pages are not mandatory. If the "nowarn" option is set then no +warnings about missing mandatory fields occurs. + +If the field is used but not mentioned in the entry documentation below then +it is silently ignored. + +The @BOOK entry +--------------- + +This is used for book-like entries. + +Fields: author(!), title(!), howpublished, edition, ednote, address(!), +publisher(!), year(!), citedate, series, isbn(!), doi, url, note. + +The ednote field here means the secondary authors (illustrator, cover design +etc.). + + +The @ARTICLE entry +------------------ + +This is used for articles published in a journal. + +Fields: author(!), title(!), journal(!), howpublished, address, publisher, +month, year, [numbering or volume, number, pages(!)], citedate, issn, +doi, url, note. + +If the numbering is used then it is used instead volume, number, pages. + + +The @INBOOK entry +----------------- + +This is used for the part of a book. + +Fields: author(!), title(!), booktitle(!), howpublished, edition, ednote, +address(!), publisher(!), year(!), numbering, citedate, series, isbn or +issn, doi, url, note. + +The author field is used for author(s) of the part, the editor field +includes author(s) or editor(s) of whole document. The pages field specifies +the page range of the part. The series field can include more information +about the part (chapter numbers etc.). + +The @INPROCEEDINGS and @CONFERENCE entries are equivalent to @INBOOK entry. + + +The @THESIS entry +----------------- + +This is used for student's thesis. + +Fields: author(!), title(!), howpublished, address(!), school(!), +month, year(!), citedate, type(!), ednote, doi, url, note. + +The type field must include the text "Master's Thesis" or something +similar (depending on the language of the outer document). + +There are nearly equivalent entries: @BACHELORSTHESIS, @MASTERSTHESIS and +@PHDTHESIS. These entries sets the type field to an appropriate value +automatically. The type field is optional in such case. If it is used then +it has a precedence before default setting. + + +The @MISC entry +--------------- + +It is intended for various usage. + +Fields: author, title, howpublished, ednote, citedate, doi, url, note. + +You can use \AU, \ED, \EDN, \VOL, \NO, \PP, \ADDR, \PUBL, \YEAR +macros in ednote field. These macros print authors list, editors list, +edition, volume, number, pages, address, publisher and year field values +respecitively. If they are are missing then the appropriate macro is empty. + +The reason of this entry is to give to you the possibility to set the format of +entry by your own decision. The most of data are concentrated in ednote +field. + + +The @BOOKLET, @INCOLLECION, @MANUAL, @PROCEEDINGS, @TECHREPORT, @UNPUBLISHED entries +------------------------------------------------------------------------------------- + +These entries are equivalent to @MICS entry because we need to save the +simplicity. They are implemented only for (almost) backward compatibility +with the ancient BibTeX. But the ednote is mandatory field here, so you +cannot use these entries from the old databases without warnings and without +some additional work in the .bib file. + + +The cite-marks (bibmark) used when \nonumcitations is set +--------------------------------------------------------- + +When \nonumcitations is set then \cite prints the cite-marks (called +bibmark) instead numbers. This style file autogenerates these marks in the +form "Lastname of the first author, comma, space, the year" if bibmark field +isn't declared. If you need to set an exception from this common format, +then you can use bibmark field. + +The OPmac trick http://petr.olsak.net/opmac-tricks-e.html#bibmark +describes how to redefine the algorithm for bibmark auto-generating when you +need the short form of the type [Au13]. + + +Sorting +------- + +If \usebib/c is used then entries are sorted by citation order in the text. +If \usebib/s is used then entries are sorted by ``Lastname, Firstname(s)'' of +the first author and if more entries have this value equal, then the year is +used (from older to newer). This feature follows the recommendation of the +ISO 690 norm. + +If you have the same authors and the same year, you can control the sorting +by setting years as 2013, 2013a, 2013b, etc. You can print something +different to the list using "yearprint{}" option, see the section about +address, publisher and year above. The real value of year field (ie. not +yearprint value) is also used in citations when \nonumcitations is set. + +If you have some problems with name sorting, you can use the hidden field +"key", which is used for sorting instead of the ``Lastname Firstname(s)'' +of authors. If the "key" field is unset then the ``Lastname Firstname(s)'' +is used for sorting normally. Example: + + author = "Světla Čmejrková", + key = "Czzmejrkova Svetla", + +This entry is now sorted between C and D. + +The norm recommends to place the autocitations to the top of the list of +references. You can do this by setting key = "@", to each entry with your +name because the "@" character is sorted before A. + + +Languages +--------- + +There is the language of the outer document and the languages of each entry. +The ISO 690 norm recommends that the technical notes (the prefix before URL, +the media type, the ``and'' conjunction between semifinal and final author) +may be printed in the language of the outer document. The data of the entry +have to be printed in the entry language (edition ed./vyd., Vol./ročník, +No./č. etc.). Finally there are the phrases independent on the language +(for example In:). Unfortunately, the bibTeX supposes that the entry data +are not fully included in value parts of the fields (see edition, volume +etc. fields) so the automaton have to add some text during processing. +But what language have to be chosen? + +The current value of the \language register at the start of the .bib +processing is decided as the language of the outer document. This language +is used for technical notes regardless of the entry language. Each entry can +have the lang field with the two-letter mark of the entry language. This +language is used for ed./vyd., vol./ročník etc. and it is used for +hyphenation too. If the entry language is not set then the outer document +language is used. + +If the outer document language is know before creating of the .bib file, you +can store some language-dependent phrases into it. On the other hand, if the +main document language is unknown, you can use the \Mtext macro to +create the text multilingual. Example: + + howpublished = "\Mtext{bue-ray}" + +Now, you can set the variants of blue-ray into your macros: + + \mtdef {blue-ray} {Blue-ray disc} {Blue-ray disk} {} + + +Tips for using more languages +----------------------------- + +OPmac prefers English, Czech and Slovak languages. However, you can add +more languages. If you are using csplain, you can download the +hyphen-patterns for many languages, see the hyphen.lan file. For example, +you have had \dePatt and \plPatt downloaded (for German and Polish +languages). Now, you can do + +\sdef{lan:21}{de} \sdef{lan:121}{de} +\sdef{lan:23}{pl} \sdef{lan:123}{pl} +\def\mtdefx#1#2#3{\sdef{_mt:#1:de}{#2}\sdef{_mt:#1:pl}{#3}} + + % German % Polish +\mtdefx {bib.and} { und } { a } +\mtdefx {bib.phdthesis} {Ph.D. Dissertation} {Praca doktorska} +... + + +Summary of non-standard fields +------------------------------ + +This style uses the following fields unkown by bibTeX: + +option ... options separated by spaces +lang ... the language two-letter code of one entry +ednote ... editional info (secondary authors etc.) or + global data in @MISC-like entries +citedate ... the date of the citation in year/month/day format +numbering ... format for volume, number, pages +isbn ... ISBN +issn ... ISSN +doi ... DOI +url ... URL + + +Summary of options +------------------ + +aumax: ... maximum number of printed authors +aumin: ... number of printed authors if aumax exceedes +autrim: ... full Firstnames iff number of authors are less than this +auprint:{} ... text instead auhors list (\AU macro may be used) +edmax, edmin, edtrim ... similar as above for editors list +edprint:{} ... text instead editors list (\ED macro may be used) +titlepost:{} ... text after title +yearprint:{} ... text instead real year (\YEAR macro may be used) +ednprint:{} ... text instead real edition (\EDN macro may be used) +urlalso ... the ``available also from'' is used instead ``available from'' +unpublished ... the publisher etc. fields are not mandatory +nowarn ... no mandatory fields + +Another options in the option field are silently ignored. diff --git a/macros/luatex/optex/bib-simple.opm b/macros/luatex/optex/bib-simple.opm new file mode 100644 index 0000000000..642c6d8482 --- /dev/null +++ b/macros/luatex/optex/bib-simple.opm @@ -0,0 +1,183 @@ +% opmac-bib-simple ... the OPmac bib style for reading .bib databases +% Petr Olsak, version Apr. 2015 (beta) +% See the end of the file opmac-bib.tex for more information. +% You can compare this file with the old Forth-like BibTeX .bst files. +% What seems to be more understandable? + +\ifx\opmacbibstyle\undefined \errmessage + {This file can be read by ``\string\usebib/? (simple) bibfiles'' command only} + \endinput \fi + +% misc: + +\def\maybedot{\ifnum\spacefactor=\sfcode`\.\relax\else.\fi} +\tmpnum=\sfcode`\. \advance\tmpnum by-2 \sfcode`\.=\tmpnum +\sfcode`\?=\tmpnum \sfcode`\!=\tmpnum +\let\.=\maybedot % prevents from double periods + +% Formating of Author/Editor lists: + +\def\authorname{% + \ifnum\NameCount>1 + \ifnum0\namecount=\NameCount \mtext{bib.and}\else , \fi + \else + \ifx\dobibmark\undefined \edef\dobibmark{\Lastname}\fi + \fi + \bprintc\Firstname{* }\bprintc\Von{* }\Lastname\bprintc\Junior{, *}% +} +\let\editorname=\authorname + +% Preparing bib-mark (used when \nonumcitations is set): + +\def\setbibmark{% + \ifx\dobibmark\undefined \def\dobibmark{}\fi + \RetrieveFieldIn{bibmark}\tmp + \ifx\tmp\empty \RetrieveFieldIn{year}\tmp \edef\tmp{\dobibmark, \tmp}\fi + \bibmark=\expandafter{\tmp}% +} + +% Multilinguals: English Czech Slovak + +\mtdef{bib.and} {, and } { a } {} +\mtdef{bib.edition} {edition} {vydání} {vydanie} +\mtdef{bib.masterthesis} {Master's Thesis} {Diplomová práce} {Diplomová práca} +\mtdef{bib.phdthesis} {Ph.D. Thesis} {Disertační práce} {Dizertačná práca} + + +\def\preurl{\hfil\break} + +% Non-standard fieldnames: + +\CreateField {isbn} +\CreateField {doi} +\CreateField {url} +\CreateField {bibmark} + +% Sorting: + +\SortingOrder{name,year}{lfvj} +\SpecialSort {key} + +% Entry types: + +\sdef{print:END}{% + \bprinta [note] {*.}{}% + \setbibmark +} +\sdef{print:book}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}.\ }{\bibwarning}% + \bprinta [edition] {*~\mtext{bib.edition}.\ }{}% + \bprinta [address] {*: }{\bibwarning}% + \bprinta [publisher] {*, }{\bibwarning}% + \bprinta [year] {*.\ }{\bibwarning}% + \bprinta [isbn] {ISBN~*.\ }{\bibwarning}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\sdef{print:article}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprinta [title] {*.\ }{\bibwarning}% + \bprintb [journal] {{\em##1}.\ }{\bibwarning}% + \bprinta [year] {*, }{}% + \bprinta [volume] {* }{}% + \bprinta [number] {(*), }{}% + \bprinta [pages] {*.\ }{}% + \bprintb [doi] {DOI~\ulink[http://dx.doi.org/##1]{##1}.\ }{}% +} +\sdef{print:inbook}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1.}\ }{\bibwarning}% + In:~% + \bprinta [!editor] {*,~eds.\ }{}% + \bprintb [booktitle] {{\em##1}.\ }{\bibwarning}% + \bprinta [address] {*: }{\bibwarning}% + \bprinta [publisher] {*, }{\bibwarning}% + \bprinta [year] {*.\ }{\bibwarning}% + \bprinta [chapter] {*.\ }{% + \bprinta [pages] {*.\ }{}}% + \bprinta [isbn] {ISBN~*.\ }{\bibwarning}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\slet{print:inproceedings}{print:inbook} + +\sdef{print:incolection}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}.\ }{\bibwarning}% + \bprinta [crossreff] {In~\cite[*]. }{% + \bprinta [booktitle] {*. }{\bibwarning}% + \bprinta [!editor] {*,~eds.\ }{\bibwarning}% + \bprinta [edition] {*~\mtext{bib.edition}.\ }{\bibwarning}% + \bprinta [address] {*: }{\bibwarning}% + \bprinta [publisher] {*, }{\bibwarning}% + \bprinta [year] {*.\ }{\bibwarning}% + \bprinta [pages] {*.\ }{}% + \bprintb [url] {\preurl\url{####1}. }{}}% +} +\sdef{print:conference}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\.\ }{\bibwarning}% + \bprinta [edition] {*~\mtext{bib.edition}.\ }{}% + \bprinta [address] {*: }{\bibwarning}% + \bprinta [publisher] {*, }{\bibwarning}% + \bprinta [year] {*.\ }{\bibwarning}% + \bprinta [isbn] {ISBN~*.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\sdef{print:phdthesis}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\.\ }{\bibwarning}% + \mtext{bib.phdthesis}, % + \bprinta [school] {*.\ }{}% + \bprinta [address] {*, }{}% + \bprinta [year] {*.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\sdef{print:mastersthesis}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\.\ }{\bibwarning}% + \mtext{bib.masterthesis}, % + \bprinta [school] {*.\ }{}% + \bprinta [address] {*, }{}% + \bprinta [year] {*.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\sdef{print:proceedings}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\.\ }{\bibwarning}% + \bprinta [publisher] {*.\ }{% + \bprinta [organization] {*.\ }{\bibwarning}}% +} +\sdef{print:techreport}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\.\ }{\bibwarning}% + \mtext{bib.techreport}. + \bprinta [institution] {*.\ }{}% +} +\sdef{print:booklet}{% + \bprinta [!author] {*\.\ }{\bibwarning}% + \bprintb [title] {{\em##1}\.\ }{\bibwarning}% + \bprinta [howpublished] {*.\ }{\bibwarning}% +} +\sdef{print:manual}{% + \bprinta [!author] {*\.\ }{}% + \bprintb [title] {{\em##1}\.\ }{\bibwarning}% + \bprinta [year] {*.\ }{}% + \bprinta [institution] {*.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} +\sdef{print:misc}{% + \bprinta [!author] {*\.\ }{}% + \bprintb [title] {{\em##1}\.\ }{}% + \bprinta [howpublished] {*.\ }{}% + \bprinta [institution] {*.\ }{}% + \bprinta [series] {*.\ }{}% + \bprinta [year] {*.\ }{}% + \bprintb [url] {\preurl\url{##1}. }{}% +} + +%%% end of the style file + +\endinput + +You can copy this file to opmac-bib-yourname.tex and modify it by your +needs... diff --git a/macros/luatex/optex/catcodes.opm b/macros/luatex/optex/catcodes.opm deleted file mode 100644 index d675e482be..0000000000 --- a/macros/luatex/optex/catcodes.opm +++ /dev/null @@ -1,137 +0,0 @@ -%% This is part of OpTeX project, see http://petr.olsak.net/optex - -\_codedecl \setcatcode {Initialization category codes <2020-01-23>} - -\_def \_optexcatcodes {% - \_setcatcode `\\=0 % backlslash starts control sequences - \_setcatcode `\{=1 % left brace is begin-group character - \_setcatcode `\}=2 % right brace is end-group character - \_setcatcode `\$=3 % dollar sign is math shift - \_setcatcode `\&=4 % ampersand is alignment tab - \_setcatcode `\^^M=5 % ascii return is end-line - \_setcatcode `\#=6 % hash mark is macro parameter character - \_setcatcode `\^=7 - \_setcatcode `\^^K=7 % circumflex and uparrow are for superscripts - \_setcatcode `\^^A=8 % downarrow is for subscripts - \_setcatcode `\ =10 % ascii space is blank space - \_setcatcode `\^^I=10 % ascii tab is a blank space - \_setcatcode `\_=11 % underline can be used in control sequences - \_setcatcode `\~=13 % tilde is active - \_setcatcode `\%=14 % percent sign is comment character - \_setcatcode 127=12 % normal character -} -\_let \_setcatcode =\catcode \_optexcatcodes % catcode initialization - -\_def \_normalasciicatcodes {% - \_setcatcodes 33-34: 12 - \_setcatcodes 39-64: 12 - \_setcatcodes 65-90: 11 - \_setcatcode `\[=12 - \_setcatcode `\]=12 - \_setcatcode `\`=12 - \_setcatcodes 97-122: 11 - \_setcatcode `\|=12 - \_optexcatcodes -} -\_def \_setcatcodes #1-#2: #3 {% - \_tmpnum=#1 - \_loop - \_setcatcode \_the\_tmpnum =#3 - \_advance \_tmpnum by1 - \_unless \_ifnum \_tmpnum >#2 \_repeat -} -\_def \_setcatcode #1=#2 {% - \_ifx \_setcatcode \_empty \_errmessage {Use \_noexpand\savecatcode before \_noexpand\setcatcode}\_fi - \_unless \_ifnum \_catcode #1=#2 - \_ea \_setcatcodeA \_catcodelist \_end {#1}% - \_catcode #1=#2 - \_fi -} -\_def \_setcatcodeA #1#2\_end #3{\_edef \_catcodelist{{#1}\_catcode #3=\_the\_catcode #3 #2}} -\_def \_savecatcodes {\_edef\_catcodelist {{\_catcodelist}}} -\_def \_restorecatcodes {\_ea\_def \_ea\_catcodelist \_catcodelist} -\_def \_catcodelist{{}} - -\_chardef\_active=13 \_catcode`\~=\_active % tilde is active -%\catcode`\^^L=\active \outer\def^^L{\par} % ascii form-feed is "\outer\par", obsolete - -\public - \optexcatcodes \normalasciicatcodes \setcatcodes \setcatcode - \savecatcodes \restorecatcodes \active ; - -\_endcode % ---------------------------------------- - -Basic category codes inspired by plain \TeX/ are set here. The only -difference is underline: it can be used in control sequences in \SpTeX/, so -its category code is 11. But plain \TeX/ sets it to 8 for subscripts. We'll -define `_` subscript only in math mode, see `math-basics.spm`. - -Second differnece from plain \TeX/ is `\catcode127`, which is set to invalid -character in plain \TeX/ but we set it as normal character. - -`\normalasciicatodes` sets catcodes of all ascii visible characters to its -"normal" values used in \SpTeX/. - -We implement catcodes stack by three macros: `\savecatcodes`, `\setcatcode` -and `\restorecatcodes` which bahaves with catcode values like -`\begingroup`, `\catcode` and `\endgroup` but it does not -open/close any \TeX/ group. You can use it for eaxample - -\begtt -\savecatcodes \normalasciicatcodes \input macrofile.tex \restorecatcodes -\endtt -% -and you are sure that - -\begitems -* `macrofile.tex` is read with normal catodes, -* previous catcode setting is restored after the `macrofile.tex` is read. -\enditems - -The catcodes stack cannot be crossed by \TeX/ groups. But it is not -problem to re-implement it to global setting if you want. - -You can use `\setcatcodes -: ` to set a range of characters. -This macro uses `\setcatcode` repeatedly. - - -\sec Implemetation details: - -First, we define `\_plaintexcatcodes` and use it macro with -`\_let\_setcatcode=\catcode`. This code sets the "normal" catcodes. - -The main idea of catcode stack implementation is that the macro -`\_setcatcode` does nothing if previus catcode value is the same as desired -value. Else it saves previous value into `\_catcodelist` and sets desired -value. Finally `\_restorecatcodes` restores values from the `\_catcodelist`. - -We need to support stack behavior, it means that nested pairs -`\_savecatcodes` and `\_restorecatcodes` work well. This is a reason why the -current value of the `\_catcodelist` looks like this: - -\begtt -{data actual before last \_savecatcodes} currently generated data -\endtt -% -Then `\_restorecatcodes` does - -\begtt -\_def \_catcodelist {data actual before savecatcodes} apply currently generated data -\endtt - -We need to apply currently generated data in reverse order. This is done by -the macro `\setcatcodeA` (invoked by the `\setcatcode`) which inserts new -data HERE-NEW: - -\begtt -{data actual before last savecatdodes} HERE-NEW currently generated data -\endtt - -One record of data is in the form `\catode char-code=previous-value`, so we -need simply to "run" the currently generated data in order to restore -values. - -Notice: the `\_codedecl` and `\_endcode` macros are redefined and explained in basic.opm - - - diff --git a/macros/luatex/optex/demo.tex b/macros/luatex/optex/demo.tex deleted file mode 100644 index 458f44257a..0000000000 --- a/macros/luatex/optex/demo.tex +++ /dev/null @@ -1,125 +0,0 @@ -\fontfam[LMfonts] - -\margins/1 a5 (1,1,1,1.4)cm % A5 paper + 1cm margins -\typosize[9/10.5] % 9pt font / 10.5pt baselineskip -\parindent=10pt % typesetting parameters -\hyperlinks \Blue\Blue % active hyperlinks -\activettchar` % in-text verbatim by `...` -\def\intthook{\localcolor\Red} % in-text verbatim Red - -\tit Demonstration - -\nonum\notoc\sec Contents - -\maketoc % Table of Contents is auto-generated here - -\sec Lists - -The lists have to be surrounded by `\begitems` -and `\enditems` sequences. - -\begitems -* First item. -* Second item. - \begitems \style i - * Nested item list, - * numbered by roman numerals. - \enditems -* Last item. -\enditems - -\secc Title of Subsection - -The subsection text\dots - -\sec References - -There is a numbered equation. -The number is auto-generated by `\eqmark` sequence. -$$\label[my-eq] - a^2 + b^2 = c^2 \eqmark -$$ -We can refer to Equation~\ref[my-eq] -on page~\pgref[my-eq]. -We can refer to Table~\ref[my-tab] in -Section~\ref[tab-sec] too. And Figure~\ref[my-pic] -is on page~\pgref[my-pic]. - -\sec Hyperlinks - -You can refer to \url{http://petr.olsak.net} using `\url`. -Or use `\ulink` if the raw URL needs to be hidden: -\ulink[http://petr.olsak.net/optex]{\OpTeX/ page}. -The parameter text is colorized and it becomes -an active link if the `\hyperlinks` sequence -is used at the beginning of the document. -Internal links are activated too. - -\label[tab-sec] -\sec Tables - -The `\table` sequence can be used -instead of ``low level'' `\halign`. -The following table is framed by `\frame` sequence -in order to get a double frame. - -\label[my-tab] -\medskip -\caption/t Testing table. -\smallskip\nobreak -\centerline{% - \frame{\table{|r|c|l|}{\crl - \bf Title A & \bf Title B & \bf Title C \crll - first & second & third \cr - next & text & last \crl }}} - -\sec Images - -The images (PDF, JPG, PNG, TIFF) can be inserted -by `\inspic` sequence. The `\label` and `\caption/f` -can be added if you need to refer to a figure. - -\centerline {\picwidth=2.7cm \inspic ring.png } -\label[my-pic] -\nobreak -\caption/f The nonempty ideal of a simple ring -- - the ring itself. - -\sec Verbatim - -In-text verbatim is surrounded by the character declared -by `\activettchar` sequence. The listing can be surrounded -by `\begtt` and `\endtt` sequences -\begtt -This is verbatim. - All characters are printed $$, \, # etc. -\endtt -or it can be included by `\verbinput` from external file. - -\verbinput (95-97) demo.tex - -\sec Math - -The Math alphabets -`\mit`, `\cal`, `\script`, `\frak`, `\bbchar`, `\bi` -are provided. For example: -$$ - {\bi A} = \pmatrix {\cal C & \script C \cr - \frak M & \bbchar R }. -$$ -Hundreds of AMS symbols are available: -$\sphericalangle, \Finv, \boxplus, \Cup, \Cap, \ldots$ - -\sec Others - -The `\typosize` or `\typoscale` sequences set the size -and baselineskip of used fonts (including math fonts). -The `\fnote` generates a footnote\fnote{Like this} and -`\mnote` generates a margin note. -The `\margins` sets margins and paper dimensions. -The `\cite` sequence can be used for bibliographic citations. -The `\bib` sequence creates one bibliography record. Or -you can use `\usebib` for direct access to the {\tt.bib} files. -The list of features does not end here\dots - -\bye diff --git a/macros/luatex/optex/doc/optex-doc.pdf b/macros/luatex/optex/doc/optex-doc.pdf new file mode 100644 index 0000000000..93a6d13eb3 Binary files /dev/null and b/macros/luatex/optex/doc/optex-doc.pdf differ diff --git a/macros/luatex/optex/doc/optex-doc.tex b/macros/luatex/optex/doc/optex-doc.tex new file mode 100644 index 0000000000..514a322dd7 --- /dev/null +++ b/macros/luatex/optex/doc/optex-doc.tex @@ -0,0 +1,1546 @@ + +\fontfam[LMfonts] +\typosize[11/13] +\enlang + +\localcolor +\catcode`<=13 +\def<#1>{\hbox{$\langle$\it#1\/$\rangle$}} +\intthook={\catcode`\<=13} +\tthook=\intthook +\chardef\"="201C + +\def\new{\mnote{\Red$\blacktriangleleft$}} +\fixmnotes\right + +\activettchar` + +\hyperlinks{\Blue}{\Green} +\insertoutline{CONTENTS} \outlines{0} + + +\tit \OpTeX/\nl Format Based on Plain \TeX/ and OPmac\fnotemark1 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\hfill Version Alpha 0.03 + +\centerline{\it Petr Olšák, 2020} + +\bigskip +\centerline{\url{http://petr.olsak.net/optex}} + + +\fnotetext {The OPmac package is a set of simple additional macros to plain\TeX{}. It +enables users to take advantage of basic \LaTeX/ functionality but keeps +plain \TeX/ simplicity. See +\url{http://petr.olsak.net/opmac-e.html} for more information about it. +For OPmac users: the red triangle {\Red$\blacktriangleleft$} in the right margin +means that there is a difference from standard OPmac features.} + +\notoc\nonum \sec Contents +\maketoc + +\nonum \sec Introduction +%%%%%%%%%%%% + +\OpTeX/ is \LuaTeX/ format with plain \TeX/ and OPmac. Only \LuaTeX/ engine +is supported. The main goal of \OpTeX/ is: + +\begitems +* \OpTeX/ keeps the simplicity (like in plain \TeX/ and OPmac macros). +* There is no old obscurities concerning with various 8-bit encodings and + various engines. +* \OpTeX/ provides a powerful font selection system (for Unicode font + families, of course). +* \OpTeX/ supports hyphenations of all languages installed in your \TeX/ system. +* All features from OPmac macros are copied (for example, you can see + opmac-prospectus.pdf) +* Macros are documented in the same place where code is (macros for printing + this documentation will come in the future). +* User name space of control sequences is separated from internal name space + of OpTeX and primitives (`\foo` versus `\_foo`). +\enditems + +\OpTeX/ should be a modern plain \TeX/ with power from OPmac (fonts selection +system, colors, external graphics, references, hyperlinks...) with unicode +fonts. + +\OpTeX/ (like OPmac) offers a markup language for authors of texts (like \LaTeX), +i.e. the fixed set of tags to define the structure of the document. This +markup is different from the \LaTeX{} markup. It may offer to write the +source text of the document somewhat clearer and more attractive. + +\new +{\bf Disclaimer:} This software is under construction. +It is possible that some features documented here will be changed in future. + + +\sec Using \OpTeX/ +%%%%%%%%%%%%%%%%%% + +\new +\OpTeX/ is compiled as a format for \LuaTeX/. Maybe there is a command +`optex` in your \TeX/ distribution. Then you can write into command line + +\begtt +optex document +\endtt +% +You can try to process `optex demo` or `optex optex-doc`. + +If there is no `optex` command, see more information about installation +\OpTeX/ at \url{http://petr.olsak.net/optex}. + +A minimal document should be + +\begtt +\fontfam[LMfonts] +Hello World! \bye +\endtt + +The first line `\fontfam[LMfonts]` tells that Unicode Latin Modern +fonts (derived from Computer Modern) are used. If you omit this line then +preloaded Latin Modern fonts are used but preloaded fonts cannot be in +Unicode\fnote +{This is technical limitations of \LuaTeX/ for fonts in formats: +only 8bit fonts can be preloaded.}. +So the sentence `Hello World` will be OK without the first line, but you +cannot print such sentence in another languges (like `Ahoj světe!`) +where Unicode fonts are needed +because of the characters like `ě` are not mapped correctly in preloaded +font. + +A somewhat larger example with common settings shoud be: + +\begtt +\fontfam[Termes] % selecting Unicode font family Termes +\typosize[11/13] % setting the basic font size and the baselineskip +\margins/1 a4 (1,1,1,1)in % setting 1in margins for A4 paper +\cslang % Czech hyphenation patterns + +Tady je text. +\bye +\endtt +% +You can look at `demo.tex` file for more examples. + + +\sec Compatibility with Plain \TeX/ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +All macros of plain \TeX/ are re-written in \OpTeX/. Common macros should be +work in the same sense as in original plain \TeX. Internal control sequences +\new +like `\p@` or `\f@@t` are removed and mostly replaced by control sequences +prefixed by `_` (like `\_this`). All primitives and common macros have two +control sequences in prefixed and unprefixed form with the same +meaning. For example `\hbox` is equal to `\_hbox`. +Internal macros of \OpTeX/ have and use only prefixed form. User should use +unprefixed forms, but prefixed forms are accessibe too, bacause the `_` is +set as a letter globally (in macro files and in users document too). User +should re-define unprefixed forms of control sequences with no worries that +something internal will be broken (only the sequence `\par` cannot be +re-defined without internal change of \TeX/ behavior because it is +hard-coded in \TeX/s tokenization processor). + +\new +The Latin Modern 8bit fonts instead Computer Modern 7bit fonts are +preloaded in the format, but only few ones. The full family set is ready to +use after the command `\fontfam[LMfonts]` which reads the fonts in OTF +format. + +\new +The `\tenrm`, `\tenbf` etc. selectors are not defined. There are internal +selectors `\_tenrm`, `\_tenbf` etc. instead them. Don't use them directly +until you understand the \OpTeX/ font selection system from +internal point of view. + +\new +The accents macros like `\'`, `\v` are undefined in \OpTeX/. Use real +letters like ř, ž in your soucre document instead these old accents macros. +If you really want to use them, you can initialize them by `\oldaccents` +command. + +\new +The paper size is not set as letter with 1\,in margins but as a4 with 2\,cm +marins. You can change it by `\margins/1 letter (1,1,1,1)in` (this example +sets the classical plainTeX parameters). + +\new +The origin for typographical area is not at top left 1\,in 1\,in coordinates +but at top left paper corner exactly. For example, `\hoffset` includes directly left +margin. + + +\sec Selection of font family +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +You can select the font family by `\fontfam[]`. +The argument is case insensitive and spaces are ignored. So, +`\fontfam[LM Fonts]` is equal to `\fontfam[LMfonts]` and it is equal +to `\fontfam[lmfonts]`. Several aliases are prepared, thus +`\fontfam[Latin Modern]` can be used for loading Latin Modern family too. + +If you write `\fontfam[?]` then all font families registered in \OpTeX/ +are listed on the terminal and in the log file. + +If you write `\fontfam[catalog]` then a catalogue of all fonts registered in +\OpTeX/ and available in your \TeX/ system is printed. And the instructions +how to register your own font family is appedned in such catalogue. + +If the family is loaded then {\em font modifiers} applicable in such font family +are listed on the terminal: (`\caps`, `\cond` for example). +And there are four basic {\em varinat selectors} (`\rm`, `\bf`, `\it`, `\bi`). +The font modifiers of basic variants (`\caps`, `\cond` for example) can +be used immediately before a basic variant selector and they +can be (independently) combined: `\caps\it` or `\cond\caps\bf`. The +modifiers keeps their internal setting until group ends or until another +modifier which negates the previous feature is used. So +`\caps \rm... \it...` uses normal and italics in Caps and SmallCaps. + +\new +There is one special variant selector `\currvar` which does not change the +selected variant but reloads the font in respect of tne (maybe newly +specified) font slector(s). + +\new Most declared font families are configured with recommended Unicode +Math font. This font is automaticlally loaded unless you specify +`\noloadmath` before first `\fontfam` command. See log file for more +information about loading Text font family and UnicodeMath fonts. If you +prefer another Unicode Math font, specify it by `\loadmath{[]}` +or `\loadmath{font_name}` before first `\loadfam` command. + +The `\em` macro acts as `\it` if the current font is `\rm`, acts as `\rm` if +the current font is `\it`, acts as `\bi` if the current font is `\bf` and +acts as `\bf` if the current font is `\bi`. The `\/` spaces are inserted +automatically. Example: + +\begtt +This is {\em important} text. % = This is {\it important\/} text. +\it This is {\em important} text. % = This is\/ {\rm important} text. +\bf This is {\em important} text. % = This is {\bi important\/} text. +\bi This is {\em important} text. % = This is\/ {\bf important} text. +\endtt + +\new +More about the \OpTeX/ font selection system is written the file +`fonts-select.opm`. You can mix more font families in your document, you can +declare your variant selectors o modifiers etc. + +\new +The `\boldify` macro can be used for titles. It sets `\it` to `\bi` and +`\rm` to `\bf`. It means that user can write `{\it something}` in the title +and the result is the same as `{\bi something}`. Math formulae are in bold +variant too. The `\boldify` macro has local validity like others font +modifiers. Example: + +\begtt +{\boldify\typosize[14/16] Title in {\it bold}\par} +\endtt + + +\sec Font sizes +%%%%%%%%%%%%%%% + +The commands for font size setting described below, for variant selectors and +modifiers desribed above have local validity. If you put them into a group, +the font features are selected locally. + +The command `\typosize[/]` sets the font size of text and +math fonts and baselineskip. If one of these two parameters is empty, the +corresponding feature stays unchanged. Don't write the unit of these +parameters. The unit is internally set to `\ptunit` which is 1pt by default. +You can change the unit by the command `\ptunit=`, +for instance `\ptunit=1mm` enlages all font sizes declared by `\typosize`. +Examples: + +\begtt +\typosize[10/12] % default of plainTeX +\typosize[11/12.5] % font 11pt, baseline 12.5pt +\typosize[8/] % font 8pt, baseline unchanged +\endtt + +The command +`\typoscale[/]` +sets the text and math fonts +size and baselineskip as a multiple of the current fonts size and +baselineskip. The factor is written in \"scaled"-like way, it means that 1000 +means factor one. The empty parameter is equal to the parameter 1000, +i.e. the value stays unchanged. Examples: + +\begtt +\typoscale[800/800] % fonts and baselineskip re-size to 80 % +\typoscale[\magstep2/] % fonts bigger 1,44times +\endtt + +First usage of `\typosize` or `\typoscale` macro in your document sets so +called {\em main values}, i.\ e. main font size and main baselineskip. They are internally +saved in registers `\mainfosize` and `\mainbaselineskip`. + +\new +The `\typoscale` comand does scaling in respect to current values by default. +If you want to do it in respect to main values, type `\scalemain` immediately +before `\typoscale` command. + +\begtt +\typosize[12/14.4] % first usage in document, sets main values internally +\typosize[15/18] % bigger font +\scalemain \typoscale[800/800] % reduces from main values, no from current. +\endtt + +The size of the current font can be changed by the command +`\thefontsize[]` or can be rescaled by +`\thefontscale[]`. These macros don't change math fonts sizes nor +baselineskip. + +\new +There is `\setfontsize{}` command which behaves like other +font modifiers. For example `\setfontsize{at15pt}\currvar`. + +More information about resizing of fonts is documented in `fonts-resize.opm` +file. + + +\sec Parts of the document +%%%%%%%%%%%%%%%%%%%%%%%%%% + +The document can be divided into chapters, sections and subsections and titled +by `\tit` command. The parameters are separed by the end of current line (no +braces are used): + +\begtt +\tit Document title +\chap Chapter title +\sec Section title +\secc Subsection title +\endtt + +The chapters are numbered by one number, sections by two numbers +(chapter.section) and subsections by three numbers. If there are no chapters +then section have only one number and subsection two. + +The implicit design of the titles of chapter etc.\ are implemented in the +macros `\printchap`, `\printsec` and `\printsecc`. User can simply change +these macros if he/she needs another behavior. + +The first paragraph after the title of chapter, section and subsection is +not indented but you can type `\let\firstnoindent=\relax` if you need all +paragraphs indented. + +If a title is so long then it breaks to more lines. It is better to hint the +breakpoints because \TeX/ does not interpret the meaning of the title. +User can put the `\nl` (it means newline) macro to the breakpoints. + +The chapter, section or subsection isn't numbered if the `\nonum` precedes. +And the chapter, section or subsection isn't delivered to the table of +contents if `\notoc` precedes. + + +\sec Another numbered objects +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +Apart from chapters, sections and subsections, there are another +automatically numbered objects: equations and captions for tables and +figures. + +If user write the `\eqmark` as the last element of the display mode then +this equation is numbered. The format is one number in brackets. This number +is reset in each section. + +If the `\eqalignno` is used, then user can put `\eqmark` to the last column +before `\cr`. For example: + +\begtt +\eqalignno{ + a^2+b^2 &= c^2 \cr + c &= \sqrt{a^2+b^2} & \eqmark \cr} +\endtt + +The next numbered object is caption which is tagged by `\caption/t` for +tables and `\caption/f` for figures. Example: + +\begtt +\hfil\table{rl}{ + age & value \crl\noalign{\smallskip} + 0--1 & unmeasured \cr + 1--6 & observable \cr + 6--12 & significant \cr + 12--20 & extremal \cr + 20--40 & normal \cr + 40--60 & various \cr + 60--$\infty$ & moderate} +\par\nobreak\medskip +\caption/t The dependency of the computer-dependency on the age. +\endtt + +This example produces: + +\bigskip +{\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} +\hfil\table{rl}{age & value \crl\noalign{\smallskip} + 0--1 & unmeasured \cr + 1--6 & observable \cr + 6--12 & significant \cr + 12--20 & extremal \cr + 20--40 & normal \cr + 40--60 & various \cr + 60--$\infty$ & moderate} +\par\nobreak\medskip +{ \leftskip=\parindent plus1fil + \rightskip=\parindent plus-1fil + \parfillskip=0pt plus2fil \noindent +{\bf Table 2.3} The dependency of the com\-puter-dependency on the age.\par} +} +\bigskip + +The word \"Table" followed by a number is added by the macro +`\caption/t`. + +The macro `\caption/f` creates the word figure. +The caption text is centered. If it occupies more lines then the +last line is centered. + +The added word (table, figure) depends on the actual number of the +`\language` register. \OpTeX/ implements the mapping from `\language` +numbers to the languages and the mapping from languages to the generated +words. + +If you wish to make the table or figure as floating object, you need to use +plain \TeX/ macros `\midinsert`, `\topinsert` and `\endinsert`. + +Each automatically numbered object can be referenced, if the +`\label[