From ab92e63936783c8aaee1aa7d8b665db287565e96 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 11 Apr 2020 21:25:25 +0000 Subject: optex, with move to doc/luatex/optex git-svn-id: svn://tug.org/texlive/trunk@54650 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/luatex/optex/README | 42 + Master/texmf-dist/doc/luatex/optex/op-demo.tex | 127 ++ Master/texmf-dist/doc/luatex/optex/op-letter.tex | 41 + Master/texmf-dist/doc/luatex/optex/op-ring.png | Bin 0 -> 512984 bytes Master/texmf-dist/doc/luatex/optex/op-slides.tex | 288 ++++ Master/texmf-dist/doc/luatex/optex/optex-doc.pdf | Bin 0 -> 172562 bytes Master/texmf-dist/doc/luatex/optex/optex-doc.tex | 1824 ++++++++++++++++++++++ Master/texmf-dist/doc/luatex/optex/slides-bg.png | Bin 0 -> 62385 bytes 8 files changed, 2322 insertions(+) create mode 100644 Master/texmf-dist/doc/luatex/optex/README create mode 100644 Master/texmf-dist/doc/luatex/optex/op-demo.tex create mode 100644 Master/texmf-dist/doc/luatex/optex/op-letter.tex create mode 100644 Master/texmf-dist/doc/luatex/optex/op-ring.png create mode 100644 Master/texmf-dist/doc/luatex/optex/op-slides.tex create mode 100644 Master/texmf-dist/doc/luatex/optex/optex-doc.pdf create mode 100644 Master/texmf-dist/doc/luatex/optex/optex-doc.tex create mode 100644 Master/texmf-dist/doc/luatex/optex/slides-bg.png (limited to 'Master/texmf-dist/doc/luatex') diff --git a/Master/texmf-dist/doc/luatex/optex/README b/Master/texmf-dist/doc/luatex/optex/README new file mode 100644 index 00000000000..2c8fa6652c3 --- /dev/null +++ b/Master/texmf-dist/doc/luatex/optex/README @@ -0,0 +1,42 @@ +OpTeX: the LuaTeX format based on Plain TeX and OPmac + +Author: Petr Olsak, + +This software is in public domain. + +See http://petr.olsak.net/optex + +History: + +<0.08> \numberedpar implmented. \emergencystretch=20pt added as default. + \inoval, \incircle, \clipinoval, \clipincircle imlemented. + \puttext, \putpic x,y instead -y,x (incompatible change!) + footnotes have separated color stack now. + \fnotelinks implemented. + Lists by \begitems...\enditems improved (\novspaces \_vspacehalf, \ilevel). +<0.07> demos: op-letter.tex and op-slides.tex added. + \inkinspic, \transformbox, \slides added. + documentation improved and updated. +<0.06> tables re-implemented, opmac-rest removed. + footnotes, marginal notes reimplemented. + sections.opm, graphics.opm, colors.opm, languages re-implemented + Cite-bib re-implemented. + Index, sorting re-implemented. +<0.05> \boldmath reimplemented + \fontcolor, \letterspacing implemented + font catalogue improved +<0.04> references.opl, hyperlinks.opl re-implemented. + \fontfam, f-* rewritten: no usage of boundary "..." in \_fontnamegen + \fnote{...} corrected: (parameter is not really parameter) + verbatim.opl re-implemented + doc added + file-ref.opl implemented (new \_Xrefversion{3}) + bugfixing +<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/Master/texmf-dist/doc/luatex/optex/op-demo.tex b/Master/texmf-dist/doc/luatex/optex/op-demo.tex new file mode 100644 index 00000000000..ea1dd5b65df --- /dev/null +++ b/Master/texmf-dist/doc/luatex/optex/op-demo.tex @@ -0,0 +1,127 @@ +%% This is part of OpTeX project, see http://petr.olsak.net/optex + +\fontfam[LMfonts] % Default font family: Latin Modern + +\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 `...` +\everyintt={\Red} % in-text verbatim Red +\enquotes % use \"text" for English quotation + +\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\nl 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. + +\sec[tab-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. + +\bigskip +\caption/t [my-tab] Testing table. +\cskip +\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 `\caption` +can be added if you need to refer to a figure. + +\label[my-pic] +\centerline {\picwidth=2.7cm \inspic{op-ring.png}} +\cskip +\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 (98-100) op-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, \boxplus, \Cup, \Cap, \ldots$ + +\sec Others + +The `\fontfam` command selects a desired family of fonts. +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/Master/texmf-dist/doc/luatex/optex/op-letter.tex b/Master/texmf-dist/doc/luatex/optex/op-letter.tex new file mode 100644 index 00000000000..3c86405e9a9 --- /dev/null +++ b/Master/texmf-dist/doc/luatex/optex/op-letter.tex @@ -0,0 +1,41 @@ +%% This is part of OpTeX project, see http://petr.olsak.net/optex + +\letter % \letter OpTeX style activated +\fontfam[bonum] +\cslang + +\address + Vážený pan + Mgr. Bořek Byrokrat + ředitel Ústavu pro další možnosti + Úřední 789 + 123 45 Praha 1 + +\hfill V Praze dne \today + +\subject Žádost o možnost další možnosti + +Vážený pane řediteli + +na základě Vašeho dopisu č.j.~123456/78-dat a elektronické výzvy si dovoluji +Vás požádat o prozkoumání mé možnosti další možnosti. +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do +eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim +veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea +commodo consequat. + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do +eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim +veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea +commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit +esse cillum dolore eu fugiat nulla pariatur. + +S úctou + +\hfill \address + {\it Petr Olšák} + specialista na \TeX/ + Ulice 12345 + Praha 13 + +\bye diff --git a/Master/texmf-dist/doc/luatex/optex/op-ring.png b/Master/texmf-dist/doc/luatex/optex/op-ring.png new file mode 100644 index 00000000000..de7811df83e Binary files /dev/null and b/Master/texmf-dist/doc/luatex/optex/op-ring.png differ diff --git a/Master/texmf-dist/doc/luatex/optex/op-slides.tex b/Master/texmf-dist/doc/luatex/optex/op-slides.tex new file mode 100644 index 00000000000..1787cf3aff4 --- /dev/null +++ b/Master/texmf-dist/doc/luatex/optex/op-slides.tex @@ -0,0 +1,288 @@ +%% This is part of OpTeX project, see http://petr.olsak.net/optex + +\slides % OpTeX slides style activated + +\catcode`<=13 % special printing of +\def<#1>{\hbox{$\langle$\it#1\/$\rangle$}} +\everyintt={\catcode`\<=13} + +\hyperlinks\Blue\Blue % hyperlinks are used in the title page +\backgroundpic{slides-bg.png} % background picture + +\activettchar` % inline verbatim +\enquotes % English quotes \"..." + +\slideshow %------------------------------------------------------------ + + +\tit \OpTeX/ slides + +\subtit Petr Olšák\nl petr@olsak.net + +\subtit\rm \url{http://petr.olsak.net/optex} + +\pg; %------------------------------------------------------------------ + +\sec Basics + +* The the simple document looks like: + +\begtt +\slides % style initialized +%\wideformat % 16:9 +\slideshow % partially uncovering ideas + +\sec First slide +text +\pg; + +\sec Second slide +text +\pg. +\endtt + +* If `\slideshow` is missing or commented out then + \"partially uncovering ideas" (see later) are deactivated. It is useful + for printing. +* The `\slideshow` must be the last command in the declaration part of the + document. +* By default, the slides have A5 landscape format. + You can declare `\wideformat`. Then the height is the same + but width is 263\,mm, i.\,e.~the ratio width:height is 16:9. + +\pg; %------------------------------------------------------------------ + +\sec Title slide + +* Title of the document (used at the first slide) is created + by `\tit Title` (terminated by end of line). +* The `\subtit Author name etc.`\ (terminated by end of line) + can be used after `\tit` at the first slide. +* You can use `\nl` for new line in paragraphs or titles. + +\sec Default design + +* The paragraph texts are ragged right. +* Titles, subtitles and section titles are centered. +* The `\sec` and `\secc` are printed without numbers. +* Paragraph indentation is zero. There is a little vertical space between + paragraphs. +* The Heros font family (aka Helvetica) is initialized as default.\nl + Sans-serif FiraMath font for math typesetting is used. +* The items in lists are started by blue square (`\type X` and `\type x` ). + +\pg; %------------------------------------------------------------------ + +\sec One slide (one page) + +* Top level item list is activated by default. The asterisk `*` opens + new item at the top level list. +* Nested items lists (second and more level) should be created in + the `\begitems`\dots`\enditems` environments. +* Each slide (page) must be terminated by `\pg;` command. +* Lats slide must be terminated by `\pg.` command or by `\bye`. + +\begtt +\sec My ideas + +* First idea +* Second idea + \begitems + * First sub-idea + * Second sub-idea + \enditems +* Final idea +\endtt + +* Note: each page is processed in a group, so: put your own definitions + (if~exist) before `\slideshow` or use `\global` assignment. + +\pg; %------------------------------------------------------------------ + +\sec Partially uncovering ideas + +* The control sequence `\pg` must be followed by:\pg+ +\begitems +* the character `;` -- normal next page,\pg+ +* the character `.` -- the end of the document,\pg+ +* the character `+` -- next page keeps the same text + and a next text is added (usable for partially uncovering of ideas).\pg+ +\enditems + +* Summary: +\begtt +\pg; ... next page +\pg. ... the end of the document +\pg+ ... uncover next text at the same page +\endtt +\pg+ + +* When `\slideshow` is not declared then `\pg+` is deactivated.\pg+ +* The `\pg+` creates a new \"virtual page", so the current paragraph is + terminated. + +\pg; %------------------------------------------------------------------ + +\sec Example with partially uncovering ideas + +The previous page was created by: + +\begtt +\sec Partially uncovering ideas + +* The control sequence `\pg` must be followed by:\pg+ + +\begitems +* the character `.` -- normal next page,\pg+ +* the character `;` -- the end of the document,\pg+ +* the character `+` -- next ... \pg+ +\enditems + +* Summary +... +* When `\slideshow` is not declared + then `\pg+` is deactivated.\pg+ +* The `\pg+` creates a new \"virtual page", + so the current paragraph is terminated. +\pg; +\endtt + +\pg; %------------------------------------------------------------------ + +\sec Notes + +* When `\slideshow` is active then you cannot reference sections by + hyperlinked `\ref`. Only `\pgref` works (and goes to the last layer + of the referenced page). +* If the text overfull the page (slide) then it follows to the next page without + saying explicitly `\pg;`. But `\slideshow` cannot work in such case.\pg+ + +\sec More about design + +* You can use `\backgroundpic{}` for putting an image to the backgroud. +* You can re-declare `\footline` or re-define internal macros for design as + you wish. +* You can put the images or text wherever using `\putimege` or `\puttext` + macros... + +\pg; %------------------------------------------------------------------ + +\sec Putting images and texts wherever + +* `\puttext {}` puts a to the desired place: + It moves the current point and , puts the and returns + back, so the typesetting continues from previous position. The parameters + and are dimensions. For example + +\begtt +\puttext 0mm 50mm {\Red HELLO} +\endtt + + \puttext 0mm 50mm {\Red HELLO} + prints red HELLO, as shown here.\pg+ + +* `\putpic {}` + puts the image with desired and at the position like + `\puttext` puts the text. + + \putpic .8\hsize 20mm 30mm \nospec {op-ring.png} +* The ring above is the result of + +\begtt +\putpic .8\hsize 20mm 30mm \nospec {op-ring.png} +\endtt + % + used at beginning of this paragraph.\pg+ +* Use `\nospec` for or of the image if you don't want to specify both + dimensions (because you don't want to change the image aspect ratio). + +\pg; %------------------------------------------------------------------ + +\sec Limits of the \code{\\pg+} sequence + +* The \code{\\pg+} sequence (partially uncovering ideas) cannot be used inside + a~group. +* The exception is the nested environment `\begitems...\enditems`. +* The `\pg+` always finalizes the current paragraph. + It is impossible to hide only a part of horizontal mode.\pg+ + +\sec The \code{\\layers}\,...\code{\\endlayers} environment + +If you really need something unsupported by `\pg+` then you can use + +\begtt \catcode`\<=13 +\layers + +\endlayers +\endtt + +* The should include conditions like + `\ifnum\layernum...` or `\ifcase\layernum`. + It is printed times to more slide pages (layers) with the same + surrounding text. See next page... + +\pg; %------------------------------------------------------------------ + +\sec Example of \code{\\layers} environment + +The `\slides` style provides a shortcut `\use` and a macro `\pshow` (means +partially show): + +\begtt +\def\use#1#2{\ifnum\layernum#1\relax#2\fi} +\def\pshow#1{\use{=#1}\Red \use{<#1}\Transparent \ignorespaces} +\endtt + +The `{\pshow }` prints in Red when current layer is equal +to or it prints normally when current layers is greater than . +The transparent (invisible) font is used in other cases. + +The following dance: +\layers 3 +{\pshow2 Second text.} {\pshow3 Third text.} {\pshow1 First text.} +\endlayers +\pg+ + +was generated by + +\begtt +\layers 3 +{\pshow2 Second text.} {\pshow3 Third text.} {\pshow1 First text.} +\endlayers +\endtt + +\pg+ +* The is treated as macro parameter. So, you cannot use verbatim + nor `\sec` titles here. Maximal one `\layers` environment can be per one + page (terminated by `\pg+` or `\pg;` or `\pg.` + +\pg; %------------------------------------------------------------------ + +\sec Comparison \OpTeX/ slides with Beamer\fnote{\url{http://www.ctan.org/pkg/beamer}} + +The \LaTeX{} package {\bf\Blue Beamer} gives much more features and many themes +are prepared for Beamer, {\bf\Red but} +\pg+ +* the user of Beamer is forced to {\em program} his/her document using + dozens of \code{\\begin{foo}} and \code{\\end{foo}} and many another + programming constructions,\pg+ +* plain \TeX{} gives you a possibility to simply + {\em write} your document with minimal markup. The result is more compact. + You can concentrate to the contents of your document, not to the + programming syntax.\pg+ +* User needs to read 250 pages of doc for understanding Beamer,\pg+ +* on the other hand, you need to read only ten + slides\fnote{this eleventh slide isn't counted} + and you are ready to use {\bf\Blue\OpTeX/ slides}. + +\pg; %------------------------------------------------------------------ + +\null +\vskip2cm +\centerline{\typosize[35/40]\bf Thanks for your attention}\pg+ + +\vskip2cm +\centerline{\Blue\typosize[60/70]\bf Questions?} + +\pg. %----------------------------- THE END ---------------------------- + diff --git a/Master/texmf-dist/doc/luatex/optex/optex-doc.pdf b/Master/texmf-dist/doc/luatex/optex/optex-doc.pdf new file mode 100644 index 00000000000..b366233d9f4 Binary files /dev/null and b/Master/texmf-dist/doc/luatex/optex/optex-doc.pdf differ diff --git a/Master/texmf-dist/doc/luatex/optex/optex-doc.tex b/Master/texmf-dist/doc/luatex/optex/optex-doc.tex new file mode 100644 index 00000000000..0a1b6b5d8af --- /dev/null +++ b/Master/texmf-dist/doc/luatex/optex/optex-doc.tex @@ -0,0 +1,1824 @@ + +\fontfam[LMfonts] +\typosize[11/13] +\enlang +\margins/1 a4 (2,2,2,2)cm + +\catcode`<=13 +\def<#1>{\hbox{$\langle$\it#1\/$\rangle$}} +\everyintt={\catcode`\<=13} +\everytt=\everyintt +\enquotes + +\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 0.08 + +\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. +* Macros are documented in the same place where code is (macros for printing + such 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, indexing, +bibliography, ...) with preferred Unicode fonts. + +If you need to customize your document or you need to use something +very specific, then you can copy relevant parts of \OpTeX/ macros into your macro +file and do changes of these macros here. This is significant difference from +\LaTeX/ or ConTeXt, which are an attempt to create a new user level with a +plenty of non-primitive parameters and syntax hiding \TeX/ internals. +The macros from \OpTeX/ are simple and straightforward because they solve only +what is explicitly needed, they does not create a new user level for +controlling your document over \TeX/. +And you can use \OpTeX/ macros, understand them an modify them. + +\OpTeX/ 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. + +This manual desribes \OpTeX/ features only. We suppose that user knows \TeX/ +basic principles. They are described in many books. You can see a short +document \ulink[http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf] +{\TeX/ in nutshell} too. + + +\sec Starting with \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 op-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 a technical limitation of \LuaTeX/ for fonts downloaded 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 languages (for example `Ahoj světe!`) +where Unicode fonts are needed +because of the characters like `ě` are not mapped correctly in preloaded +fonts. + +A somewhat larger example with common settings should be: + +\begtt \catcode`!=0 +\fontfam[Termes] % selecting Unicode font family Termes (section !ref[fontfam]) +\typosize[11/13] % setting the basic font size and the baselineskip (sec. !ref[sizes]) +\margins/1 a4 (1,1,1,1)in % setting 1in margins for A4 paper (section !ref[marg]) +\cslang % Czech hyphenation patterns (section !ref[lang]) + +Tady je text. +\bye +\endtt +% +You can look at `op-demo.tex` file for more examples. + + +\sec Page layout +%%%%%%%%%%%%%%%% + +\secc[marg] Setting the margins +%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\OpTeX/ declares paper formats a4, a4l (landscape~a4), a5, a5l, b5, letter and +user can declare another own format by `\sdef`: + +\begtt +\sdef{_pgs:b5l}{(250,176)mm} +\sdef{_pgs:letterl}{(11,8.5)in} +\endtt + +The `\margins` command declares margins of the document. This command have +the following parameters: + +\begtt +\margins/ (,,,) + example: +\margins/1 a4 (2.5,2.5,2,2)cm +\endtt + +Parameters are: + +\begitems +* \dots\ `1` or `2` specifies one-page or two-pages design. +* \dots\ paper format (a4, a4l, a5, letter, etc. or user defined). +* , , , \dots\ gives the amount of left, right, + top and bottom margins. +* \dots\ unit used for values , , , . +\enditems + +Each of the parameters , , , can be empty. +If both and are nonempty then `\hsize` is set. Else `\hsize` +is unchanged. If both and are empty then typesetting area is +centered in the paper format. The analogical rule works when or +parameter is empty (`\vsize` instead `\hsize` is used). Examples: + +\begtt +\margins/1 a4 (,,,)mm % \hsize, \vsize untouched, + % typesetting area centered +\margins/1 a4 (,2,,)cm % right margin set to 2cm + % \hsize, \vsize untouched, vertically centered +\endtt + +If `=1` then all pages have the same margins. If `=2` then the +declared margins are true for odd pages. The margins at the even pages are +automaticaly mirrored in such case, it means that is replaced by + and vice versa. + +The `` can be also in the form `(,)` where `` is +optional. If it is missing then `` after margins specification is +used. For example: + +\begtt +\margins/1 (100,200) (7,7,7,7)mm +\endtt +% +declares the paper 100$\times$200\,mm with all four margins 7\,mm. The spaces +before and after parameter are necessary. + +The command `\magscale[]` scales the whole typesetting area. +\new The fixed point of such scaling is the upper left corner of the paper sheet. +Typesetting (breakpoints etc.) is unchanged. All units are relative after +such scaling. Only paper formats dimensions stays unscaled. Example: + +\begtt +\margins/2 a5 (22,17,19,21)mm +\magscale[1414] \margins/1 a4 (,,,)mm +\endtt +% +The first line sets the `\hsize` and `\vsize` and margins for final +printing at a5 format. The setting on the second line centers the scaled +typesetting area to the true a4 paper while breaking points for paragraphs +and pages are unchanged. It may be usable for +review printing. After review is done, the second line can be commented out. + +\secc Concept of default page +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\OpTeX/ uses for page design very similar \"output routine" like Plain +\TeX/. There is `\headline` followed by \"page body" followed by +`\footline`. The `\headline` is empty by default and it can be used +for running headers repeated on each page. The `\footline` prints +centered page number by default. You can set the `\footline` to empty +using `\nopagenumbers` macro. + +The margins declared by `\margins` macro (documented in the previous +section~\ref[marg]) is concerned to the page body, +i.e.\ the `\headline` and `\footline` are placed to the top and bottom +margins. + +The distance between the `\headline` and the top of the page body is given by +`\headlinedist` register. The distance between bottom of the page body and +the `\footline` is given by `\footlinedist`. The default values are: + +\begtt +\headline = {} +\footline = {\_hss\_rmfixed \_folio \_hss} % \folio expands to page number +\headlinedist = 14pt % from baseline of \headline to top of page body +\footlinedist = 24pt % from last line in pagebody to baseline of footline +\endtt + +The page body should be divided to top insertions (floating tables and +figures) followed by a real text and followed by footnotes. +Typically, only real text is here. + +The `\pgbackground` tokens list is empty by default but it can be used for +creating background of each page (colors, picture, watermark for example). +The macro `\draft` uses this register and puts big text DRAFT as watermark +to each page. You can try it. + +More about the page layout is documented in files `parameters.opm` and +`output.opm`. + +\secc Footnotes and marginal notes +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The Plain \TeX/'s macro `\footnote` can be used as usual. But a new macro +`\fnote{}` is defined. The footnote mark is added automatically and it +is numbered +\new +on each chapter from one\fnote +{You can declare `\fnotenumglobal` if you want footnotes numbered in whole +document from one or `\fnotenumpages` if you want footnotes numbered at each +page from one. Default setting is `\fnotenumchapters`}. +The is scaled to 80 \%. +User can redefine footnote mark or scaling, as shown in the file +`fnotes.opm`. + +The `\fnote` macro is fully applicable only in \"normal outer" paragraph. +It doesn't work inside boxes (tables for example). If you are solving such +case you can use `\fnotemark` inside the box: only the +footnote mark is generated here. When the box is finished you can use +`\fnotetext{}`. This macro puts the to the footnote. +The have to be `1` if only one such command is in the box. +Second `\fnotemark` inside the same box have to have the parameter `2` etc. +The same number of `\fnotetext`s have to be written +after the box as the number of `\fnotemark`s inserted inside the box. +Example: + +\begtt +Text in a paragraph\fnote{First notice}... % a "normal" footnote +\table{...}{...\fnotemark1...\fnotemark2...} % two footnotes in a box +\fnotetext{Second notice} +\fnotetext{Third notice} +... +\table{...}{...\fnotemark1...} % one footnote in a box +\fnotetext{Fourth notice} +\endtt + +The marginal note can be printed by the `\mnote{}` macro. The +is placed to the right margin on the odd pages and it is placed to the left +margin on the even pages. This is done after second \TeX{} run because the +relevant information is stored in an external file and read from it again. +If you need to place the notes only to the fixed margin write +`\fixmnotes\right` or `\fixmnotes\left`. + +The is formatted as a little paragraph with the maximal width +`\mnotesize` ragged left on the left margins or ragged right on the right +margins. The first line of this little paragraph has its vertical position +given by the position of `\mnote` in the text. The exceptions are possible +by setting the `\mnoteskip` register. You can implement such exceptions to +each `\mnote` manually in final printing in order to margin notes do not +overlap. The positive value of `\mnoteskip` shifts the note up and negative +value shifts it down. For example `\mnoteskip=2\baselineskip \mnote{}` +shifts this (and only this) note two lines up. + + +\sec Fonts +%%%%%%%%%% + +\secc[fontfam] Font families +%%%%%%%%%%%%%%%%%%%%%%% + +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 catalog of all fonts registered in +\OpTeX/ and available in your \TeX/ system is printed. The instructions +how to register your own font family is appended in such catalog. + +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 variant selectors} (`\rm`, `\bf`, `\it`, `\bi`). +The usage of variant selectors is the same as in Plain \TeX: +`{\it italics text}`, `{\bf bold text}` etc. + +The font modifiers (`\caps`, `\cond` for example) can +be used 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 text \it text` 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 due to the (maybe newly +specified) font modifier(s). + +The context between variants `\rm`--`\it` and `\bf`--`\bi` is kept by the `\em` +macro (emphasize text). +It switches from current `\rm` to `\it`, from current `\it` to `\rm`, from +current `\bf` to `\bi` and from current `\bi` to `\bf`. +The italics correction `\/` is 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 own variant selectors or modifiers etc. + +\secc[sizes] Font sizes +%%%%%%%%%%%%%%%%%%%%% + +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` enlarges all font sizes declared by `\typosize`. +Examples: + +\begtt +\typosize[10/12] % default of Plain TeX +\typosize[11/12.5] % font 11pt, baseline 12.5pt +\typosize[8/] % font 8pt, baseline unchanged +\endtt + +The commands for font size setting described in this section +have local validity. If you put them into a group, +the settings are lost when the group is finished. If you set +something relevant with paragraph shape (baselineskip given by +`\typosize` for example) then you must first finalize the +paragraph and second to close the group: +`{\typosize[12/14] ...... \par}`. + +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 (\magstep2 expands to 1440) +\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` command 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 \"low level" `\setfontsize{}` command which behaves like +a font modifier and sets given font size used by next variant selectors. +For example `\setfontsize{at15pt}\currvar` sets current variant to 15pt. + +If you are using a font family with \"optical sizes feature" (i.\,e.\ there +are more recommended sizes of the same font which are not scaled +linearly; good example is Computer Modern aka Latin Modern fonts) +then the recommended size is selected by all mentioned commands automatically. + +More information about resizing of fonts is documented in `fonts-resize.opm` +file. + +\secc Typesetting math +%%%%%%%%%%%%%%%%%%%%% + +\OpTeX/ preloads a collection of 7bit Computer Modern math fonts +and AMS fonts in its format. You can use them in any size and in the +`\boldmath` variant. +% +\new +Most declared text font families (see `\fontfam` in the section~\ref[fontfam]) +are configured with recommended Unicode +math font. This font is automaticlaly loaded unless you specify +`\noloadmath` before first `\fontfam` command. See log file for more +information about loading text font family and Unicode math fonts. If you +prefer another Unicode math font, specify it by `\loadmath{[]}` +or `\loadmath{font-name}` before first `\loadfam` command. + +Hundreds math symbols and operators like in AMS\TeX/ are accessible. +For example `\alpha` $\alpha$, `\geq`~$\geq$, `\sum` $\sum$, +`\sphericalangle` $\sphericalangle$, `\bumpeq`, $\bumpeq$. See AMS\TeX/ +manual for complete list of symbols. + +The following math alphabets are available: + +\begtt \catcode`\$=3 \catcode`/=0 \medmuskip=0mu \adef{ }{ } +\mit % mathematical variables $abc-xyz,ABC-XYZ$ +\it % text italics $/it abc-xyz,ABC-XYZ$ +\rm % text roman $/rm abc-xyz,ABC-XYZ$ +\cal % normal calligraphics $/cal ABC-XYZ$ +\script % script $/script ABC-XYZ$ +\frak % fracture $/frak abc-xyz,ABC-XYZ$ +\bbchar % double stroked letters $/bbchar ABC-XYZ$ +\bf % sans serif bold $/bf abc-xyz,ABC-XYZ$ +\bi % sans serif bold slanted $/bi abc-xyz,ABC-XYZ$ +\endtt + +The last two selectors `\bf` and `\bi` select the sans serif fonts in math regardless +the current text font family. This is common notation for vectors and +matrices. You can re-declare it, see the file `unimath-codes.opm` where math +variants of `\bf` and `\bi` selectors are defined. + +The math fonts can be scaled by `\typosize` and `\typoscale` macros. +Two math fonts collections are prepared: `\normalmath` for normal weight +and `\boldmath` for bold. The first one is set by default. + +\new +You can use `\mathbox{}` inside math mode. It behaves as `{\hbox{}}` +(i.e. the is printed in horizontal non-math mode) +but the size of the is adapted to the context of math size (text or script or +scriptscript). + + +\sec Typical elements of document +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\secc[chap] Chapters and sections +%%%%%%%%%%%%%%%%%%%%%%%%%% + +The document can be divided into chapters, sections and subsections and titled +by `\tit` command. The parameters are separated by the end of current line (no +braces are used): + +\begtt +\tit Document title +\chap Chapter title +\sec Section title +\secc Subsection title +\endtt + +If you want to write a title to more lines in your source file then you can +use percent character before . Such is not +scanned and reading of the title continues at next line. + +The chapters are automatically 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`. A designer 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. + +\secc[cap] Another numbered objects +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +Apart from chapters, sections and subsections, there are another +automatically numbered objects: equations, captions for tables and +figures. The user can declare more numbered object. + +If the user writes the `\eqmark` as the last element of the display mode then +this equation is numbered. The equation number is printed in brackets. This number +resets in each section by default. + +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 automatically numbered objects are captions which is tagged by `\caption/t` for +tables and `\caption/f` for figures. +The caption text follows. +The `\cskip` can be used between `\caption` text and the real object (table +or figure). You can use two orders: `\cskip ` or +`\cskip `. +The `\cskip` creates appropriate vertical space between them. Example: + +\begtt +\caption/t The dependency of the computer-dependency on the age. +\cskip +\noindent\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} +\endtt + +This example produces: + +\medskip +\caption/t The dependency of the computer-dependency on the age. +\cskip +\noindent\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} +\medskip + +You can see that the word \"Table" followed by a number is added by the macro +`\caption/t`. +The caption text is centered. If it occupies more lines then the +last line is centered. + +The macro `\caption/f` behaves like `\caption/t` but it is intended for +figure captions with independent numbering. +The word (Table, Figure) depends on the actual selected language (see +section~\ref[lang] about languages). + +If you wish to make the table or figure as floating object, you need to use +Plain \TeX/ macros `\midinsert` or `\topinsert` terminated by `\endinsert`. +Example: + +\begtt +\topinsert % table and its caption is printed at the top of the current page + +\endinsert +\endtt + +\new +There are five prepared counters `A`, `B`, `C`, `D` and `E`. +They are reset in each chapter and section\fnote +{This feature can be changed, see the `sections.opm` in the technical documentation.}. +They can be used in context of `\numberedpar {}` +macro. For example: +\begtt +\def\theorem {\numberedpar A{Theorem}} +\def\corollary {\numberedpar A{Corollary}} +\def\definition {\numberedpar B{Definition}} +\def\example {\numberedpar C{Example}} +\endtt +% +Three independent numbers are used in this example. One for Theorems and Corollaries +second for Definitions and third for Examples. The user can write +`\theorem Let $M$ be...` and the new paragraph is started with the text: +{\bf Theorem 2.3.1.} Let $M$ be... +You can add an optional parameter in brackets. For example, +`\theorem [(L'Hôpital's rule)] Let $f$, $g$ be...` +is printed like {\bf Theorem 2.4.2 (L'Hôpital's rule).} Let $f$, $g$ be... + + +\secc References +%%%%%%%%%%%%%%% + +Each automatically numbered object documented in +sections \ref[chap] and \ref[cap] can be referenced +\new +if optional parameter +`[