From 87cddce361c3b477029d13b27bdaa57190b2d74b Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 15 Mar 2020 03:01:24 +0000 Subject: CTAN sync 202003150301 --- macros/luatex/optex/doc/op-ring.png | Bin 0 -> 421951 bytes macros/luatex/optex/doc/optex-doc.pdf | Bin 150405 -> 156310 bytes macros/luatex/optex/doc/optex-doc.tex | 1549 +++++++++++++++++---------------- 3 files changed, 817 insertions(+), 732 deletions(-) create mode 100644 macros/luatex/optex/doc/op-ring.png (limited to 'macros/luatex/optex/doc') diff --git a/macros/luatex/optex/doc/op-ring.png b/macros/luatex/optex/doc/op-ring.png new file mode 100644 index 0000000000..8c8cb5976a Binary files /dev/null and b/macros/luatex/optex/doc/op-ring.png differ diff --git a/macros/luatex/optex/doc/optex-doc.pdf b/macros/luatex/optex/doc/optex-doc.pdf index 7f161eaeb0..66f676f54e 100644 Binary files a/macros/luatex/optex/doc/optex-doc.pdf 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 index 7b0f6ff286..155499cba4 100644 --- a/macros/luatex/optex/doc/optex-doc.tex +++ b/macros/luatex/optex/doc/optex-doc.tex @@ -2,12 +2,12 @@ \fontfam[LMfonts] \typosize[11/13] \enlang +\margins/1 a4 (2,2,2,2)cm -\localcolor \catcode`<=13 \def<#1>{\hbox{$\langle$\it#1\/$\rangle$}} -\intthook={\catcode`\<=13} -\tthook=\intthook +\everyintt={\catcode`\<=13} +\everytt=\everyintt \chardef\"="201C \def\new{\mnote{\Red$\blacktriangleleft$}} @@ -19,11 +19,10 @@ \insertoutline{CONTENTS} \outlines{0} - \tit \OpTeX/\nl Format Based on Plain \TeX/ and OPmac\fnotemark1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\hfill Version Alpha 0.05 +\hfill Version 0.06 \centerline{\it Petr Olšák, 2020} @@ -85,8 +84,8 @@ large part of original OPmac macros included in \OpTeX/ which waits to its re-implementation at current state of development. -\sec Using \OpTeX/ -%%%%%%%%%%%%%%%%%% +\sec Starting with \OpTeX/ +%%%%%%%%%%%%%%%%%%%%%%%%% \new \OpTeX/ is compiled as a format for \LuaTeX/. Maybe there is a command @@ -135,56 +134,170 @@ Tady je text. You can look at `op-demo.tex` file for more examples. -\sec Compatibility with Plain \TeX/ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\sec Page layout +%%%%%%%%%%%%%%%% -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 accessible too, because the `_` is -set as a letter category code 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). +\secc Setting the margins +%%%%%%%%%%%%%%%%%%%%%%%% -\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. +\OpTeX/ declares paper formats a4, a4l (landscape~a4), a5, a5l, b5, letter and +user can declare another own format by `\sdef`: -\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. +\begtt +\sdef{pgs:b5l}{(250,176)mm} +\sdef{pgs:letterl}{(11,8.5)in} +\endtt -\new -The accents macros like `\'`, `\v` are undefined in \OpTeX/. Use real -letters like á, ř, ž in your source document instead these old accents macros. -If you really want to use them, you can initialize them by `\oldaccents` -command. +The `\margins` command declares margins of the document. This command have +the following parameters: -\new -The paper size is not set as letter with 1\,in margins but as a4 with 2\,cm -margins. You can change it by `\margins/1 letter (1,1,1,1)in` (this example -sets the classical plain TeX parameters). +\begtt +\margins/ (,,,) + example: +\margins/1 a4 (2.5,2.5,2,2)cm +\endtt -\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. +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 +mirrored in such case, it means that is replaced by and vice +versa. + +The `` can be 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. -\sec Font families and fonts +\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 +page number in the center by default. You can set the `\footline` to empty +using `\nopagenumbers` macro. + +The margins declared by `\margins` macro is concerned to the page body, +i.e.\ the `\headline` and `\fooline` are placed to the top and bottom +margins. + +The distance between `\headline` and the top of page body is given by +`\hedalinedist` register. The distance between bottom of page body and `\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 \hedaline 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), real text and footnotes. Typicaly only real text is here. + +The `\pgbackground` tokens list is empty by default but it ca 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 by `\typoscale[800]`. +User can redefine fotnote 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). When the box is finished you can use `\fnotetext{}`. This +macro puts the to the footnote. The after `\fnotemark` +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. + +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. 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 is at the same height as +the invisible mark created by `\mnote` in the current paragraph. The +exceptions are possible by `\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 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 @@ -231,8 +344,7 @@ 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 or modifiers etc. - -\sec Font sizes +\secc Font sizes %%%%%%%%%%%%%%% The command `\typosize[/]` sets the font size of text and @@ -298,8 +410,57 @@ For example `\setfontsize{at15pt}\currvar`. More information about resizing of fonts is documented in `fonts-resize.opm` file. +\secc Typesetting math +%%%%%%%%%%%%%%%%%%%%% + +\OpTeX/ preloads a collection of 7bit Computer Modern and AMS fonts. +You can use them in any size and in the `\boldmath` variant. +% +\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 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 accesible. +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 regardless +current text font family. + +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 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\sec Parts of the document +\secc[chap] Chapters and sections %%%%%%%%%%%%%%%%%%%%%%%%%% The document can be divided into chapters, sections and subsections and titled @@ -333,8 +494,7 @@ 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 +\secc[cap] Another numbered objects %%%%%%%%%%%%%%%%%%%%%%%%%%%%% Apart from chapters, sections and subsections, there are another @@ -355,9 +515,15 @@ before `\cr`. For example: \endtt The next numbered object is caption which is tagged by `\caption/t` for -tables and `\caption/f` for figures. Example: +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). It is irrelevant, if caption or object is first. +The `\cskip` creates appropriate vertical space between them. Example: \begtt +\caption/t The dependency of the computer-dependency on the age. +\cskip \hfil\table{rl}{ age & value \crl\noalign{\smallskip} 0--1 & unmeasured \cr @@ -367,14 +533,13 @@ tables and `\caption/f` for figures. Example: 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}} +\medskip +\caption/t The dependency of the computer-dependency on the age. +\cskip \hfil\table{rl}{age & value \crl\noalign{\smallskip} 0--1 & unmeasured \cr 1--6 & observable \cr @@ -383,46 +548,47 @@ This example produces: 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 +\medskip -The word \"Table" followed by a number is added by the macro +You can see that 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. +The macro `\caption/f` behaves like `\caption/t` but it is intended for +figure captions. +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`, `\topinsert` and `\endinsert`. +plain \TeX/ macros `\midinsert` or `\topinsert` terminated by `\endinsert`. + +\secc References +%%%%%%%%%%%%%%% -Each automatically numbered object can be referenced, if the -`\label[