From 3e43bc594a14e8c4fc21d6a71f22a23dd78fe252 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 21 Mar 2020 03:01:37 +0000 Subject: CTAN sync 202003210301 --- macros/luatex/optex/doc/op-ring.png | Bin 421951 -> 0 bytes macros/luatex/optex/doc/optex-doc.pdf | Bin 156310 -> 163979 bytes macros/luatex/optex/doc/optex-doc.tex | 609 ++++++++++++++++++---------------- 3 files changed, 322 insertions(+), 287 deletions(-) delete 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 deleted file mode 100644 index 8c8cb5976a..0000000000 Binary files a/macros/luatex/optex/doc/op-ring.png and /dev/null differ diff --git a/macros/luatex/optex/doc/optex-doc.pdf b/macros/luatex/optex/doc/optex-doc.pdf index 66f676f54e..8ce027841f 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 155499cba4..7035a0866f 100644 --- a/macros/luatex/optex/doc/optex-doc.tex +++ b/macros/luatex/optex/doc/optex-doc.tex @@ -8,7 +8,7 @@ \def<#1>{\hbox{$\langle$\it#1\/$\rangle$}} \everyintt={\catcode`\<=13} \everytt=\everyintt -\chardef\"="201C +\enquotes \def\new{\mnote{\Red$\blacktriangleleft$}} \fixmnotes\right @@ -22,16 +22,16 @@ \tit \OpTeX/\nl Format Based on Plain \TeX/ and OPmac\fnotemark1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\hfill Version 0.06 +\hfill Version 0.07 \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 +\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 +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.} @@ -42,11 +42,11 @@ means that there is a difference from standard OPmac features.} \nonum \sec Introduction %%%%%%%%%%%% -\OpTeX/ is \LuaTeX/ format with plain \TeX/ and OPmac. Only \LuaTeX/ engine +\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). +* \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 @@ -54,12 +54,12 @@ is supported. The main goal of \OpTeX/ is: * \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 - this documentation will come in the future). + 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`). + of \OpTeX/ and primitives (`\foo` versus `\_foo`). \enditems -\OpTeX/ should be a modern plain \TeX/ with power from OPmac (fonts selection +\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. @@ -67,21 +67,25 @@ 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 hidding \TeX/ internals. -The macros from \OpTeX/ are simple and straightforward because they solves only -what is excplicitly needed, they does not create a new user level over \TeX/. -And you can use them, understand them an modify them. +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 +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. There exists a -large part of original OPmac macros included in \OpTeX/ which waits to its -re-implementation at current state of development. +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/ @@ -111,7 +115,7 @@ 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 downloaded in formats: +{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!`) @@ -121,11 +125,11 @@ fonts. A somewhat larger example with common settings should 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 +\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 @@ -137,15 +141,15 @@ You can look at `op-demo.tex` file for more examples. \sec Page layout %%%%%%%%%%%%%%%% -\secc Setting the margins -%%%%%%%%%%%%%%%%%%%%%%%% +\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} +\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 @@ -182,10 +186,10 @@ parameter is empty (`\vsize` instead `\hsize` is used). Examples: 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. +automaticaly mirrored in such case, it means that is replaced by + and vice versa. -The `` can be in the form `(,)` where `` is +The `` can be also in the form `(,)` where `` is optional. If it is missing then `` after margins specification is used. For example: @@ -215,32 +219,34 @@ 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 +\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 +centered page number 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 +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 `\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: +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 \hedaline to top of page body +\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), real text and footnotes. Typicaly only real text is here. +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 ca be used for +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. @@ -251,7 +257,7 @@ More about the page layout is documented in files `parameters.opm` and \secc Footnotes and marginal notes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -The plain \TeX/'s macro `\footnote` can be used as usual. But a new macro +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 @@ -259,44 +265,54 @@ 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 +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). 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. +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. If you need to place the -notes only to the fixed margin write `\fixmnotes\right` or -`\fixmnotes\left`. +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 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. +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 Font families -%%%%%%%%%%%%%%%%%%% +\secc[fontfam] Font families +%%%%%%%%%%%%%%%%%%%%%%% You can select the font family by `\fontfam[]`. The argument is case insensitive and spaces are ignored. So, @@ -306,16 +322,18 @@ to `\fontfam[lmfonts]`. Several aliases are prepared, thus 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. And the instructions +\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 immediately before a basic variant selector and they +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 @@ -323,14 +341,14 @@ modifier which negates the previous feature is used. So \new There is one special variant selector `\currvar` which does not change the -selected variant but reloads the font in respect of the (maybe newly -specified) font modifiers(s). +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 needed italics correction `\/` is inserted automatically. Example: +The italics correction `\/` is inserted automatically. Example: \begtt This is {\em important} text. % = This is {\it important\/} text. @@ -342,10 +360,10 @@ This is {\em important} text. % = This is {\it important\/} text. \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 or modifiers etc. +declare your own variant selectors or modifiers etc. -\secc Font sizes -%%%%%%%%%%%%%%% +\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 @@ -356,7 +374,7 @@ for instance `\ptunit=1mm` enlarges all font sizes declared by `\typosize`. Examples: \begtt -\typosize[10/12] % default of plainTeX +\typosize[10/12] % default of Plain TeX \typosize[11/12.5] % font 11pt, baseline 12.5pt \typosize[8/] % font 8pt, baseline unchanged \endtt @@ -379,15 +397,15 @@ i.e. the value stays unchanged. Examples: \begtt \typoscale[800/800] % fonts and baselineskip re-size to 80 % -\typoscale[\magstep2/] % fonts bigger 1,44times +\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 +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. +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. @@ -403,9 +421,14 @@ The size of the current font can be changed by the command baselineskip. \new -There is `\setfontsize{}` command which behaves like -font modifiers and sets given font size o fonts loaded by next variant selectors. -For example `\setfontsize{at15pt}\currvar`. +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. @@ -413,18 +436,20 @@ 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. +\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 font families are configured with recommended Unicode -math font. This font is automaticlally loaded unless you specify +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 accesible. +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. @@ -443,8 +468,10 @@ The following math alphabets are available: \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 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 @@ -474,16 +501,20 @@ braces are used): \secc Subsection title \endtt -The chapters are numbered by one number, sections by two numbers +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`. User can simply change +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 +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 @@ -501,9 +532,9 @@ 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 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: @@ -514,11 +545,12 @@ before `\cr`. For example: c &= \sqrt{a^2+b^2} & \eqmark \cr} \endtt -The next numbered object is caption which is tagged by `\caption/t` for +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). It is irrelevant, if caption or object is first. +or figure). You can use two orders: `\cskip ` or +`\cskip `. The `\cskip` creates appropriate vertical space between them. Example: \begtt @@ -556,12 +588,19 @@ 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. +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`. +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 \secc References %%%%%%%%%%%%%%% @@ -573,7 +612,7 @@ if optional parameter `[