diff options
author | Karl Berry <karl@freefriends.org> | 2020-06-15 20:43:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-06-15 20:43:56 +0000 |
commit | 56cd0df67df77a677bd72b01d10d2cd5d4581a54 (patch) | |
tree | f6fa19e934db7c0539e137131413a62547cd740b /Master/texmf-dist/doc/luatex/optex | |
parent | 2c3a20ef9f039b8b2d912828fbdb45f5392b0d5d (diff) |
optex (15jun20)
git-svn-id: svn://tug.org/texlive/trunk@55562 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/luatex/optex')
-rw-r--r-- | Master/texmf-dist/doc/luatex/optex/README | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/optex/optex-doc.pdf | bin | 1206961 -> 1242219 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/luatex/optex/optex-doc.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/optex/optex-math.tex | 1610 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/optex/optex-techdoc.tex | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/optex/optex-userdoc.tex | 168 |
6 files changed, 1713 insertions, 81 deletions
diff --git a/Master/texmf-dist/doc/luatex/optex/README b/Master/texmf-dist/doc/luatex/optex/README index caba16dda0a..c88eb1f9290 100644 --- a/Master/texmf-dist/doc/luatex/optex/README +++ b/Master/texmf-dist/doc/luatex/optex/README @@ -19,6 +19,11 @@ doc/ ... PDF version of the OpTeX documentation and sources. History: +<0.14> Typeseting Math with OpTeX: new document added. + Math macros corrected. + In-line verbatim in section titles allowed. + \eqbox implemented. + "\mnote up", "\displaylines to" (new features implemented) <0.13> \table have more features: \tabskip, \table to, \table pxto, \vspan The \eqalign reimplemented to be more flexible. The boundary character ":" introduced in the \table. diff --git a/Master/texmf-dist/doc/luatex/optex/optex-doc.pdf b/Master/texmf-dist/doc/luatex/optex/optex-doc.pdf Binary files differindex 41b0be5572d..4c931616991 100644 --- a/Master/texmf-dist/doc/luatex/optex/optex-doc.pdf +++ b/Master/texmf-dist/doc/luatex/optex/optex-doc.pdf diff --git a/Master/texmf-dist/doc/luatex/optex/optex-doc.tex b/Master/texmf-dist/doc/luatex/optex/optex-doc.tex index d1952e201f2..d72b177bf68 100644 --- a/Master/texmf-dist/doc/luatex/optex/optex-doc.tex +++ b/Master/texmf-dist/doc/luatex/optex/optex-doc.tex @@ -20,7 +20,7 @@ \tit Format Based on Plain \TeX/ and OPmac\fnotemark1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\hfill Version 0.13 +\hfill Version 0.14 \centerline{\it Petr Olšák, 2020} diff --git a/Master/texmf-dist/doc/luatex/optex/optex-math.tex b/Master/texmf-dist/doc/luatex/optex/optex-math.tex new file mode 100644 index 00000000000..80557fec821 --- /dev/null +++ b/Master/texmf-dist/doc/luatex/optex/optex-math.tex @@ -0,0 +1,1610 @@ +%% This is part of OpTeX project, see http://petr.olsak.net/optex + +% Run optex optex-math (two times) to generate this document +% or look at PDF here: http://petr.olsak.net/ftp/olsak/optex/optex-math.pdf + +\fontfam[lmfonts] + +\font\ttlib=[LiberationMono-Regular] +\def\ttspec{\let\_ttfont=\ttlib} + +\report + +\def\new #1 {\mnote{\Red$\blacktriangleleft$\,\sans\setfontsize{at9pt}\rm#1}} +\fixmnotes\right +\enquotes +\activettchar` +\catcode`\<=13 +\def<#1>{$\langle\hbox{\it#1\/}\rangle$} +\everyintt={\catcode`\<=13 } +\def\ss#1{$\vrule height3pt#1\vrule height3pt$} + +\addto\_secfont\Blue \addto\_seccfont\Blue +\_def\_printsec#1{\_par + \_abovetitle{\_penalty-400}\_bigskip + {\_secfont \_noindent \_raggedright \llap{\_printrefnum[@\_quad]}#1\_nbpar}\_insertmark{#1}% + \_nobreak \_belowtitle{\_medskip}% + \_firstnoindent +} +\_def\_printsecc#1{\_par + \_abovetitle{\_penalty-200}\_medskip + {\_seccfont \_noindent \_raggedright \llap{\_printrefnum[@\_quad]}#1\_nbpar}% + \_nobreak \_belowtitle{\_medskip}% + \_firstnoindent +} + +\hyperlinks\Green\Green + +\insertoutline{MATH} +\outlines{0} + + + +\tit Typesetting Math with \OpTeX/ + +\vskip-\baselineskip \hfill Version 01 + +\author Petr Olšák + + + +This document is a brief summary about typesetting math. It describes \TeX/, +Plain \TeX/ and \OpTeX/ features concerned to math. The first two types of +features are documented in \TeX/book in chapters 16, 17 and 18, but it is +summarized here in short again in order to give a complete guide about math +typesetting for \OpTeX/ users. + +\new {} +The \OpTeX/ features which differs from standard \TeX/ or Plain \TeX/ are +documented with the red triangle at the margin (like in this paragraph). +Reader can simply distinguish between \"standard" features (given by +\TeX/ or Plain \TeX/) and new \OpTeX/ features. + +There are more types of extensions: e\TeX, lua\TeX/, Unicode math and +\OpTeX/ macros. The appropriate label (e\TeX, Lua\TeX/, Unicode, \OpTeX/) +is appended to the red triangle to inform you about the extension type. +Nevertheless, \OpTeX/ user doesn't have to worry about it, all extensions +are available if Unicode Math font is loaded (e.g., by the command +`\fonfam[lmfonts]`). See section 1.3.3 in \OpTeX/ documentation about +loading Unicode math fonts. + +{\iindent=2em +\bigskip +\maketoc } +\vfil\break + +\sec Basics structure of math formulas + +\secc General rules and terminology + +The in-line math (in the paragraph) is created by `$<math list>$`. The +display math (standalone line between paragraphs) is created by `$$<math list>$$`. +More than one line can be here if appropriate macro is used. In-line math is +processed in a \TeX/ group in {\em in-line math mode}. The display math is +processed in a \TeX/ group in {\em display math mode}. Spaces are +ignored in math modes. + +The <math list> is a sequence of {\em math atoms} and {\em other materials}. +The math atoms are {\em single math objects} or composed math atoms. + +\begitems +* The single math object is a single character to be printed in math mode + like `x`, `+`, `\int`. +* The math atom is constructed in genereal by `{<mat list 1>}^{<math list 2>}_{<math list 3>}`. + It consists from {\em nucleus} <math list 1>, exponent <math list 2> and subscript + <math list 3>. Each part of the atom should be empty. If the mentioned <math list> + consist only from a single math object then we need not to use brackets, for example + `x^2` is a math atom with `x` in nucleus, `2` in exponent and with empty subscript. + Or `a_{i,j}` is a math atom with `a` in nucleus, empty exponent and `i,j` in subscript. + The constructors for exponent `^` and for subscript `_` can be used in arbitrary order + followed by the nucleus, for example `z_1^{x+y}` it the same math atom as + `z^{x+y}_1`. The single math objects not followed by `^` nor `_` are + considered as math atoms with this object in nucleus and with empty + exponent and subscript (this is very common case). + \TeX/ assigns the {\em class} for each math atom, see section~\ref[class]. +* Other material can be \TeX/ box or glue (space) or `\kern` or `\vrule` etc. +\enditems + +Example: The `Z = \int``_\Omega x^{2y} + z\, dx` generates +$Z = \int_\Omega x^{2y} + z\, dx$ and it is <math list> which consists from: + +\begitems +* `Z` is math atom with empty exponent and subscript, class: Ord, +* `=` is math atom with empty exponent and subscript, class: Rel, +* `\int``_\Omega` is math atom with empty exponent and with subscript `\Omega`, class: Op, +* `x^{2y}` is math atom with exponent `2y` and empty subscript, class: Ord, + \begitems \let\_bullet=\circ + * `2` is math atom with empty exponent and subscript, class: Ord, + * `y` is math atom with empty exponent and subscript, class: Ord, + \enditems +* `+` is math atom with empty exponent and subscript, class: Bin, +* `z` is math atom with empty exponent and subscript, class: Ord, +* `\,` is other material, the glue (space) in this case, +* `d` is math atom with empty exponent and subscript, class: Ord, +* `x`is math atom with empty exponent and subscript, class: Ord. +\enditems + +\secc[class] Classes of math atoms + +\TeX/ assigns {\em a class} for each math atom.\fnote +{Using terminology of \TeX/book, each single math object has its {\em class} but the + math atom has its {\em kind} derived from this class. I use only one word + for both meanings in this document.} +This data type is used when +\TeX/ decides about horizontal spaces between atoms in the output. (Note +that spaces in the input are ignored.) For example, +`$xy$` prints two atoms without space between them but `$x+y$` is printed with +small spaces around the `+` binary operator. Compare: $xy$ and $x+y$. + +The class is assigned depending on the nucleus of the atom. If the nucleus is +not single math object, i.e. it is constructed by `{<math list>}` with braces +then the atom has its class Ord. If the nucleus is single math object constructed +without braces then the class of the atom depends on this single math +object. Each single math object must be declared in \TeX/ with its default +class. The following table lists the classes with typical examples. +Full set of all math objects used in math typesetting +is listed in the section~\ref[objects] with their default classes. + +\bigskip +\noindent\hfil\table{llll}{ + & Class & Meaning & Example \crl + 0 & Ord & ordinary object & variables, digits, $x, {\bbchar R}, \Gamma, 0, 1$ \cr + 1 & Op & big opertator & $\sum, \int, \bigcup$ \cr + 2 & Bin & binary operator & $+, \times, -, \pm, \cup$ \cr + 3 & Rel & reations & $=, \ne, \leq, \supseteq, \succsim$ \cr + 4 & Open & opening bracket & $\{, (, [, \langle$ \cr + 5 & Close & closing bracket & $\}, ), ], \rangle$ \cr + 6 & Punct & punctuation & comma \cr + & Inner & left-right & \code{\\left...\\right} outputs, see section~\ref[delims] +} +\bigskip + +There are three space types used by the algorithm for horizontal spacing in the +math formulas. + +\begitems +* Thin space: `\thinmuskip` primitive register, `\,` macro. Used around Op atoms. +* Medium space: `\medmuskip` primitive register, `\>` macro. Used around Bin atoms. +* Thick space: `\thickmusip` primitive register, `\;` macro. Used around Rel atoms. +\enditems + +\puttext 7.8cm -3.7cm {\rotbox{90}{Left atom}} +\puttext 11.5cm -.5cm {Right atom} +\puttext 8.2cm -4.4cm {\typosize[9/11] +\thistable{\def\_enspace{ }}% +\table {l|8c|} { + \omit & Ord & Op & Bin & Rel & Open & Close & Punct & \omit \hfil Inner \crlp{2-9} + Ord & 0 & 1 & 2 & 3 & 0 & 0 & 0 & 1 \cr + Op & 1 & 1 & & 3 & 0 & 0 & 0 & 1 \cr + Bin & 2 & 2 & & & 2 & & & 2 \cr + Rel & 3 & 3 & & 0 & 3 & 0 & 0 & 3 \cr + Open & 0 & 0 & & 0 & 0 & 0 & 0 & 0 \cr + Close & 0 & 1 & 2 & 3 & 0 & 0 & 0 & 1 \cr + Punct & 1 & 1 & & 1 & 1 & 1 & 1 & 1 \cr + Inner & 1 & 1 & 2 & 3 & 1 & 0 & 1 & 1 \crlp{2-9} +}} + +\hangindent=-8.7cm \hangafter=0 +Ord atoms are printed without spaces between them. The spaces are not +cummulated, so the rules about spaces mentioned above is only rough idea. +The exact rule for horizontal spaces is given for each pairs of atoms +in the table here. The symbol 0 means no space, 1 thin space, 2 medium space +and 3 means thick space. + +\hangindent=-8.7cm \hangafter-2 +The Bin atom is automaticaly transformed to the +Ord atom if no atom precedes or if Op, Bin, Rel, Open or Punct atom +precedes. And it is transformed to the Ord atom if Rel, Close or Punct atom +follows. This corresponds to the empty cells in the table. +Why such behavior? Compare \"\hbox{$0-1$}" and \"$-1$". The Bin atom in +the second case behaves like Ord atom because it is {\em unary minus}. +There is no space between unary minus and one. + +All medium spaces and thick spaces and some thin spaces from this table are +omitted if the <math list> is processed in script or scriptscript styles +(smaller size). See section~\ref[styles] about math styles. + +You can overwrite the default class derived from the nucleus of the atom by +\TeX/ primitives `\mathord`, `\mathop`, `\mathbin`, `\mathrel`, `\mathopen`, +`\mathclose`, `\mathpunct` and `\mathinner`. They can precede a nucleus of +the atom and they set the class of the atom. +For example, `x \mathrel+ y` behaves like `x = y` in spacing point of view but + +is printed. Another example: `\mathop{\rm lim} z` creates the atom `lim` in +roman font of class Op. So, the thin space is inserted between lim and $z$. + +There are more special kinds of math atoms: fractions, math accents, +radicals. They are constructed by special way (see next sections) but they behaves +like Ord atom in the horizontal spacing algorithm. + +\secc[styles] Math styles + +When a formula (or a sub-formula) is processed by \TeX/ then one from four +styles is active: display style ($D$), text style ($T$), script style ($S$) or +scriptscript style ($SS$). + +The $T$ style is started in in-line math mode `$...$` and the $D$ +style is started in display math mode `$$...$$`. The first level of exponents or +subscripts is processed in $S$ style and the second and more levels of +exponents or indexes are processed in $SS$ style. +There are special rules for math styles when fractions are constructed, see +section~\ref[frac]. + +The $D$ and $T$ style uses basic font size, $S$ uses smaller font size (typically +70~\%) and $SS$ style uses more smaller font size (typically 50~\%). Next +levels of \"more smaller fonts" are not used due to classical typographic rules. + +The nucleus of Op atoms (big operators, $\sum$, $\int$, etc.) have typically bigger versions +of the character shape for $D$ style than for $T$ style. +So, there are four sizes for such math +objects: one size for each math style. All other math objects (with non Op +class) are printed only in three sizes: The sizes for $T$ and $D$ styles are equal. + +The Op atom puts its exponent and subscript above and below the nucleus in $D$ +style but right to the nucleus in other styles: +$$ + `\sum``_{i=1}^\infty` \quad \hbox{gives}\quad \sum_{i=1}^\infty \hbox{ in $D$ style and} + \quad \textstyle \sum_{i=1}^\infty \hbox{ in $T$ style}. +$$ +This default behavior of the Op atom +can be modified by placing `\limits` or `\nolimits` or +`\displaylimits` \TeX/ primitive just after the Op nucleus before the constructors +of exponent and/or index. The `\nolimits` puts exponent and subscript right +to the nucleus (regardless of the current style) and `\limits` puts these +objects above and below the nucleus (regardless of the current style). There +can be more such primitives in a queue (due to a macro expansion, for +instance). Then the last primitive in the queue wins. +If the last primitive is `\displaylimits` then +default behavior is processed regardless there are `\limits` or `\nolimits` +before it. +$$ + `\sum\nolimits``_{i=1}^\infty` \quad \hbox{gives}\quad \sum\nolimits_{i=1}^\infty + \hbox{ in $D$ style and}\quad \textstyle\sum\nolimits_{i=1}^\infty + \hbox{ in $T$ style}. +$$ +Atoms of all other classes have their exponents and/or subscripts only right +to their nucleus without any exception. + +The primitives `\displaystyle`, `\textstyle`, `\scriptstyle` and +`\scriptscriptstyle` set the given style regardless the default rules. For +example, you can create a formula in in-line math mode and in $D$ style by +`$\displaystyle <fomula>$` or a formula in display mode and $T$ style can be printed +by `$$\textstyle <fomrula>$$`. + +If the subformula is placed below something (below a rule from root symbol, +below a fraction rule), then the processed style $D, T, S$ or $SS$ is {\em cramped}. +The exponents are positioned slightly lower than in non-cramped style. + +Several macros need to know what math style is currently processed (for +example they need to draw something in an appropriate size). But it +not possible simply due to the syntax of fractions (section~\ref[frac]). +This syntax requires to process all math lists in two steps: the first step +expands all macros and creates structured data of processed math list. The +second step reads the output of the first step, switches between math +styles and creates definitive output. So, macros (working in first step) +cannot know the current math +style because it is set only in the second step. \TeX/ supports the primitive +`\matchchioce{<D>}{<T>}{<S>}{<SS>}` which prepares four math lists in the +first step and only one of these four lists are used in the second step. We +can put different macros into each of the four parameters of `\mathchoice`. +Plain \TeX/ supports the macro `\mathpalette` which gives a more comfortable +interface of `\mathchoice` to macro programmer. + +\new \OpTeX/ +We describe another interface for creating macros depending on current +style. You can use `\mathstyles{<math list>}`. It +behaves like `{<math list>}`, moreover, you can use following commands inside such +<math list>: +\begitems +* The macro `\currstyle`. It expands to + `\displaystyle`, `\textstyle`, + `\scriptstyle` or `\scriptscriptstyle` depending on the current math style + when the `\mathstyles` was opened. +* The `\dobystyle{<D>}{<T>}{<S>}{<SS>}` is expandable macro. It expands its + parameter `<D>`, `<T>`, `<S>` or `<SS>` depending on the current math style + when `\mathstyles` was opened. +* The value of the `\stylenum` register is 0, 1, 2 or 3 + depending on the current math style when `\mathstyles` was opened. +\enditems +% +Example of usage of `\mathstyles`: +\def\mysymbol{\mathbin\mathstyles + {\kern1pt\vrule height\mysymbolA width\mysymbolA\kern1pt}} +\def\mysymbolA{\dobystyle{5pt}{5pt}{3.5pt}{2.5pt}} +\begtt +\def\mysymbol{\mathbin\mathstyles + {\kern1pt\vrule height\mysymbolA width\mysymbolA\kern1pt}} +\def\mysymbolA{\dobystyle{5pt}{5pt}{3.5pt}{2.5pt}} +Test: $a\mysymbol b_{c \mysymbol d}$ or $a\mysymbol b\over c$. +\endtt +This example gives Test: $a\mysymbol b_{c \mysymbol d}$ or $a\mysymbol b\over c$. + +The `\mathstyles` macro mentioned above uses \TeX/ primitive `\mathchoice`, so it +creates four math lists and only one is used. It may take more +computer time in special cases. +\new Lua\TeX/ +Lua\TeX/ supports the `\mathstyle` primitive +(no \"`s`" at the end of this control sequence) which +expands to values 0 to 7 depending on the current style: +$D, D', T, T', S, S', SS, SS'$ +(where $X'$ means cramped variant of the style). This primitive does +not use `\mathchoice` but it simply ignores the fraction syntax, so +`$a\mysymbol b\over c$` cannot work if `\mysymbol` is defined using the `\mathstyle` +primitive. See section 7.3.1 of Lua\TeX/ documentation for more information. + + +\secc[frac] Fractions + +The fraction can be constructed by `{<numerator>\over<denominator>}`. If the +fraction is only single object in the whole math mode (between dollars), +you need not to use the outer braces, so you can write `$1\over2$` to get $1\over2$. + +The <numerator> and <denominator> are printed in \"smaller" math style than +current math style. More exactly the following schema is used. +$D$: $T\over T$., $T$: $S\over S$, $S$: $SS\over SS$, $SS$: $SS\over SS$. +For example +$$ + `{a+b \over c}` \quad \hbox{is printed as } + {a+b\over c} \hbox{ in $D$ style and as } + \textstyle {a+b\over c} \hbox{ in $T$ style}. +$$ + +The \LaTeX/ macro `\frac{<numerator>}{<denominator>}` is not supported in +Plain \TeX/ nor in \OpTeX/ but you can define such macro if you want. + +The syntax with `\over` is more preferred because it is more human readable +notation. You can write the fraction in the same manner as you can read it. +You can compare: `$1\over2$` (one over two) with `$\frac12$` (frac twelve). + +Besides the `\over` primitive, there are analogical \TeX/ primitives which +create \"generalized" fractions. The result is similar as `{<above>\over <below>}` +but there is something extra: + +\begitems +* `{<above>\atop <below>}` does `{<above>\over<below>}` but + without the fractional rule. +* `{<above>\above<dimen><below>}` creates fractional rule with <dimen> thickness. +* `{<above>\overwithdelims<delim-l><delim-r><below>}` adds the <delim-l> left to + the fraction and the <delim-r> right to the fraction. +* `{<above>\atopwithdelims<delim-l><delim-r><below>}` is analogical to + `\overwithdelims` but without fractional rule. +* `{<above>\abovewithdelims<delim-l><delim-r><dimen><below>}` behaves as + `\overwithdelims` but the fractional rule has <dimen> thickness. +\enditems +% +The `\...withdelims` variants read <delim-l> and <delim-r>, they must be +declared as {\em math delimiter} in \TeX. They are vertically scalable +math objects, typically brackets. See section~\ref[delims] for more +information about math delimiters. Example: +$$ + `{n \atopwithdelims() k}`\quad \hbox{ creates } + {n \choose k} \hbox{ in $D$ style and } + \textstyle {n \choose k} \hbox{ in $T$ style}. +$$ +The `\choose` macro is defined by `\def\choose{\atopwithdelims()}`, so the +user can write `{n\choose k}` in order to get binomial coefficients. + + +\secc[delims] Vertically scalable objects: math delimiters + +The vertically scalable objects are called {\em delimiters}. For example, +all types of brackets are declared as delimiters. +This means that you can use a bracket in arbitrary +vertical size.\fnote{ +This is not exactly true, because traditional typography says that they +cannot be scaled continuously but by visible steps. This means that there is +a sequence of increasing brackets in the font, reader must see a difference +between each two sizes of brackets.} + +The following objects are declared as delimiters (i.e.\ vertically scalable): + +\bigskip +{\tt \adef!{\bslash} +\table{l 14c}{ + \rm source: & ( & ) & [ & ] & \code{\\\{} & \code{\\\}} & / + & !backslash & !langle & !rangle + & | & \code{\\|} & \cr + \rm output: &$($&$)$&$[$&$]$& $\{$ & $\}$ & $/$ + & $\backslash$ & $\langle$ & $\rangle$ + & $|$ & $\|$ +} +\medskip +\table{l 14c}{ + \rm source: & !lfloor & !rfloor & !lceil & !rceil \cr + \rm output: & $\lfloor$ & $\rfloor$ & $\lceil$ & $\rceil$ +} +\medskip +\table{l 14c}{ + \rm source: & !uparrow & !Uparrow & !dowarrow & !Downarrow + & !updownarrow & !Updownarrow \cr + \rm output: & $\uparrow$ & $\Uparrow$ & $\downarrow$ & $\Downarrow$ + & $\updownarrow$ & $\Updownarrow$ +}} +\bigskip +\noindent \new Unicode +If you are able to produce the characters $\langle$, $\rangle$,\fnote + {Do not confuse $\string<, >$ and $\langle, \rangle$. The first pair are Rel atoms + with meaning \"less than" or \"greater than", but the second pair are special + types of brackets. They are not directly available at computer keyboards without + using a keyboard macro.} +$\lfloor$, $\rfloor$, ... $\updownarrow$, $\Updownarrow$ +directly in your text editor then you can use these Unicode characters in your source instead of control +sequences `\langle`, `\rangle`, `\lfloor`, `\rfloor` ... `\updownarrow`, `\Updownarrow`. +For many users (including me), there is more simple to type `\lfloor` than to find +how to create the $\lfloor$ character in my text editor. Note that there exist +text editors (Emacs, for example) +enabling you to type `\lfloor` and this control sequence is immediately +converted to the $\lfloor$ Unicode character. +Your source looks pretty and you can use classical \TeX/ sequences. + +\new Unicode +There are more delimiters, but it heavily depends on loaded Unicode Math +font. For example, this document is printed in `latinmodern-math` font and +there are six more delimiters `\lBrack`~$\lBrack$, `\rBrack`~$\rBrack$, +`\lAngle` $\lAngle$, `\rAngle` $\rAngle$, `\lgroup` $\lgroup$, `\rgroup` $\rgroup$. +See section~\ref[objects] for table of all Unicode symbols for math typesetting. + +Arbitrary tall formula can be surrounded by a pair of delimiters using +`\left` and `\right` \TeX/ primitives: `\left<delim> <formula> \right<delim>`. +The delimiters are scaled to the height and depth of the <formula> +and vertically centered to the {\em math axis}.\fnote +{Math axis is a horizontal line passing through the center of symbols $+$ + and $-$. All vertically scalable objects are vertically centered with + respect to this axis.} +Example: +$$ + `+ \left\{ \sum_{i=1}^\infty x_i \right)` \quad \hbox{ gives } + + \left\{ \sum_{i=1}^\infty x_i \right). +$$ +The pair `\left<delim> <formula> \right<delim>` creates the formula in a +\TeX/ group. Such group can be nested with another groups. +Each `\left` must have its `\right` counterpart at the same group level. +If you don't want to create visible delimiter, use dot instead <delim>. +Example: +$$ + `\left. \int``_0^t e^{x^2}\,dx\, \right|_{t=42}` \quad \hbox{ gives } + \left. \int_0^t e^{x^2} \,dx\, \right|_{t=42} +$$ + +\new e\TeX/ +You can use `\middle<delim>` inside the <formula> which is surrounded by +`\left...\right`. Then the given <delim> is scaled to the same size like +their `\left` and `\right` counterparts. + +When a delimiter is used without `\left` nor `\right` prefix, then it is the +Open, Close, Ord or Bin atom by its natural meaning: +$(, [, \{, \ldots, \lfloor, \lceil$ are Open atoms, +$], ], \}, \ldots, \rfloor, \rceil$ are Close atoms, +$/, \backslash, |, \|$ are Ord atoms and +$\uparrow, \Uparrow, \ldots, \Updownarrow$ are Bin atoms. You can overwrite +this default setting, for example `\mathclose(`. If delimiters are used with +`\left` and `\right` prefixes then `\left<delim>` behaves like Open atom, +`\right<delim>` behaves like Close atom and the math list +`\left<delim><formula>\right<delim>` is encapsulated as a single Inner atom. +The `\middle<delim>` behaves like Open atom at its left side and like Close +atom at its right side. + +The sequence of increasing delimiters can be printed by the following +macros: +$$ + `(` \to (,\quad `\big(` \to \big(,\quad `\Big(` \to \Big(,\quad + `\bigg(` \to \bigg(, \quad `\Bigg(` \to \Bigg(. +$$ +The `\Bigg<delim>` is not maximal size of the bracket. Try +`\left(\vbox to5cm{}\right.`, for example. You can see that the font +\"cheats" from certain sizes, because there are not all infinity number of +sizes of brackets drawn in the font, of course. + +The `\big<delim>` creates Ord atom. We need to create Open atom +for opening bracket and Close atom for closing bracket more often. +Then we can use macros +`\bigl<delim>`, +`\Bigl<delim>`, +`\biggl<delim>`, +`\Biggl<delim>` for creating Open atoms and +`\bigr<delim>`, +`\Bigr<delim>`, +`\biggr<delim>`, +`\Biggr<delim>` for creating Close atoms. Unfortunately, the source is not +too attractive when more sizes of brackets are used, but typographic +traditions say that we have to distinguish brackets by the size in math +mode if they are in equal types: +$$ + `\Bigl( f\bigl( 2(x+y) + z\bigr) \Bigr)'` \quad \hbox{gives } + \Bigl(f\bigl(2(x+y)+z\bigr)\Bigr)'. +$$ + +\secc Horizontally scalable objects: math accents + +Arbitrary wide formula can be covered by {\em scalable math accent}. +Example: +$$ + `\overrightarrow {a+b+c+d+e+f}` \quad \hbox{gives } \overrightarrow {a+b+c+d+e+f}. +$$ +The usage is: control sequence of selected math accent followed by `{<math list>}`. + +Standard scalable math accents are: +`\overline` $\overline{abc}$, +`\overbrace` $\overbrace{abc}$, +`\overrightarrow` $\overrightarrow{abc}$, +`\overleftarrow`~$\overleftarrow{abc}$, +`\underline` $\underline{abc}$, +`\underbrace` $\underbrace{abc}$. + +A Op atom is created. The exponents and subscripts are centered above +and below the nucleus of this atom (regardless of the current style). Example: +$$ + `\overbrace {b\cdot b\cdot b \cdots b}^{k\times}` \quad \hbox{gives } + \overbrace {b\cdot b\cdot b \cdots b}^{k\times} +$$ +There are scalable accents with limited maximum width: +`\widehat` $\widehat{abc}$ and `\widetilde` $\widetilde{abc}$. If the +formula is wider than the font is able to cover then widest variant from the +font is used and it is horizontally centered. + +\new Unicode +There are more scalable accents in Unicode math fonts: +`\overparen` $\overparen{abc}$, `\underparen` $\underparen{abc}$, +`\overbracket` $\overbracket{abc}$, `\underbracket` $\underbracket{abc}$, +`\overleftrightarrow` $\overleftrightarrow{abc}$, +`\overleftharpoon` $\overleftharpoon{abc}$, +`\overrightharpoon` $\overrightharpoon{abc}$, + + +\secc Fixed math accents + +Fixed math accents can be applied to single math object or to the `{<math list>}`. +The accent is centered (with respect of slanting axis) and the result is a +nucleus of Ord +atom. For example `\dot x` gives $\dot x$. The list of fixed math accents +follows: `\acute x` $\acute x$, `\bar x` $\bar x$, +`\breve x` $\breve x$, `\check x` $\check x$, +`\dot x` $\dot x$, `\ddot x` $\ddot x$, +`\grave x` $\grave x$, `\hat x` $\hat x$, +`\vec x` $\vec x$, `\tilde x` $\tilde x$. + +\new Unicode +The additional fixed accents depends on used Unicode math font. The +`latinmodern-math` supports: +`\ovhook x` $\ovhook x$, `\ocirc x` $\ocirc x$, +`\leftharpoonaccent x` $\leftharpoonaccent x$, `\rightharpoonaccent x` $\rightharpoonaccent x$, +`\dddot x` $\dddot x$, `\ddddot x` $\ddddot x$, +`\widebridgeabove x` $\widebridgeabove x$, `\asteraccent x` $\asteraccent x$. + +There exist one special math accent `'` (single quote, ASCII 39) +which can be appended after a symbol like this: `f'` +and it creates $f'$ (typical meaning is the +derivation of the given function). You can put more such accents, for +example `g'''` gives $g'''$. + +\secc Roots + +There is a macro `\sqrt{<math list>}` to create square root. For example: +$$ + `\sqrt{\sqrt{\sqrt{x+1}+1}+1}` \quad \hbox{gives } + \sqrt{\sqrt{\sqrt{x+1}+1}+1} +$$ +The $n$-th root is created by the macro `\root <n>\of{<math list>}`. For +example `\root k+1\of x` gives $\root k+1\of x$. + +\secc Math alphabets + +Letters $a\dots z$, $A\dots Z$ and $\alpha$\dots$\omega$ are printed in italic +in math mode. This follows the traditional typographic rule. +All other math symbols, digits and uppercase Greek letters must be +upright.\fnote +{French typographic convention says that uppercase Greek letters have to be + in italic too. Use `\_itGreek` declaration in this case.} +These rules are independent of the current variant of surrounding text font. + +If we want to use the letters or digits +in another than this default shape, then we can use +{\em math alphabet selectors}: `\mit`, `\rm`, `\it`, `\bf`, `\cal`. +\new \OpTeX/ +\OpTeX/ supports more such selectors `\script`, `\frak`, `\bbchar`, `\bi`, see +section 1.3.3 in the \OpTeX/ documentation. The math selectors have local +validity in the group. + +The control sequences `\rm`, `\it`, `\bf`, and `\bi` act as variant selectors +of fonts in non-math mode (text mode) and they act +as math alphabet selectors in math mode. This \"overlaying" concept +is given by Plain \TeX/. Example: math operators lim, sin, cos, +log, etc.\ must be printed unslanted. We are using `\lim`, `\sin`, `\cos`, +`\log` etc.\ in math mode in order to comply this typographic convention. For +example `\sin` is defined as: +\begtt +\def\sin {\mathop{\rm sin}\nolimits} +\endtt +The `\rm` is used here as math alphabet selector, no variant selector of +text fonts. + +The list of all predefined `\rm`-like math operators follows: `\arccos`, +`\arcsin`, `\arctan`, `\arg`, `\cos`, `\cosh`, `\cot`, `\coth`, `\deg`. +`\det`, `\dim`, `\exp`, `\gcd`, `\hom`, `\inf`, `\ker`, `\lg`, `\lim`, +`\liminf`, `\limsup`, `\ln`, `\log`, `\max`, `\min`, `\Pr`, `\scs`, `\sin`, +`\sinh`, `\sup`, `\tan`, `\tanh`, You can define another such operator +analogically. + +\new Unicode +Unicode font can include the following math alphabets: +\begtt \typosize[9/11] +\_rmvariables % upright letters A-Z, a-z +\_bfvariables % bold letters A-Z, a-z +\_itvariables % italic letters A-Z, a-z +\_bivariables % bold italic letters A-Z, a-z +\_calvariables % calligraphic letters A-Z, a-z +\_bcalvariables % calligraphic letters A-Z, a-z +\_frakvariables % fraktur A-Z, a-z +\_bfrakvariables % bold fraktur A-Z, a-z +\_sansvaraibales % sans serif letters A-Z, a-z +\_bsansvaraibales % bold sans serif letters A-Z, a-z +\_isansvaraibales % slanted sans serif letters A-Z, a-z +\_bisansvaraibales % bold slanted sans serif letters A-Z, a-z +\_ttvariables % monospace, typewriter letters A-Z, a-z +\_bbvariables % double struck A-Z, a-z +\_rmdigits % upright digits 0..9 +\_bfdigits % bold digits 0..9 +\_sansdigits % sans serif digits 0..9 +\_bsansdigits % bold sans serif digits 0..9 +\_ttdigits % monospace typewriter digits 0..9 +\_bbdigits % double-struck digits 0..9 +\_rmgreek % upright Greek letters \alpha-\omega +\_itgreek % slanted Greek letters \alpha-\omega +\_bfgreek % bold Greek letters \alpha-\omega +\_bigreek % bold italic Greek letters \alpha-\omega +\_bsansgreek % bold sans serif Greek letters \alpha-\omega +\_bisansgreek % bold slanted snas serif Greek letters \alpha-\omega +\_itGreek % slanted Greek letters \Alpha-\Omega +\_bfGreek % bold Greek letters \Alpha-\Omega +\_biGreek % bold italic Greek letters \Alpha-\Omega +\_bsansGreek % bold sans serif Greek letters \Alpha-\Omega +\_bisansGreek % bold slanted snas serif Greek letters \Alpha-\Omega +\endtt +% +Not all Unicode math fonts include all math alphabets listed here. Typically, +the lowercase letters of calligraphic shape and all letters of +bold calligraphic shape are missing. + +\new \OpTeX/ +\OpTeX/ defines internal math alphabet selectors as mentioned in the +previous listing of math alphabets and sets as default: +\begtt \typosize[10/12] +\_itvariables \_rmdigits \_itgreek \_rmGreek +\endtt +% +Moreover, it defines the alphabet selectors at user level (see section 1.3.3 +of the \OpTeX/ manual). For example +\begtt \typosize[10/12] +\def\rm {\_tryload\_tenrm \_inmath{\_rmavariables \_rmdigits}} +\endtt +% +The first part +\new \OpTeX/ +`\_tryload\_tenrm` is applicable for text fonts and the +`\_inmath` part is processed only in math mode and sets the math alphabets. +You can see the file `unimath-codes.opm` where all user level selectors are +defined. You can redefine them. For example, \OpTeX/ defines `\bf` as a math +alphabet selector which selects sans serif bold in math. This is common +notation for vectors, tensors and matrices. If you dislike this, then you can define: +\begtt \typosize[10/12] +\def\bf {\_tryloadbf\_tenbf \_inmath{\_bfvariables\_bfdigits\_bfgreek\_bfGreek}} +\endtt + + +\secc[objects] List of single math objects + +\new Unicode +All single math objects is listed in the `unimath-table.opm` or +`unicode-math-table.tex` file. You can +look into this file. The codes, \TeX/ sequences, classes and comments +for all possible math codes are here. Maybe, your Unicode math font which is loaded, +does not support all these codes. +\new \OpTeX/ +You can try all codes of currently loaded font by +\begtt +\input print-unimath.opm +\endtt +The `unimath-table` is printed with characters available in loaded font. +\new \OpTeX/ +If the character is unsupported by the font then the slot is empty and only +\TeX/ sequence and the class of the code is printed in the table. +For example, this document loads `latimodern-math.otf` font. +And the result from `\input print-unimath.opm` looks like the following ten +pages. + +\bigskip +\input print-unimath.opm +\bigskip + +It isn't very comfortable to find something in the previous table +if you know the shape. You can try the online web tool +\ulink[https://detexify.kirelabs.org/classify.html]{Detexify}. +You can draw the symbol here and the suggestion of \TeX/ sequence is +printed. + +\def\g#1{{\tt\string#1}~$#1$} + +The generic \TeX/ sequences for the Greek letters can be used: +\g\alpha, \g\beta, \g\gamma, \g\delta, \g\varepsilon, \g\zeta, \g\eta, +\g\theta, \g\iota, \g\kappa, \g\lambda, \g\mu, \g\nu, \g\xi, +\g\omicron, \g\pi, \g\rho, \g\varsigma, \g\sigma, \g\tau, \g\upsilon, +\g\varphi, \g\chi, \g\psi, \g\omega, \g\vardelta, \g\epsilon, \g\vartheta, +\g\varkappa, \g\phi, \g\varrho, \g\varpi\ +and +\g\Alpha, \g\Beta, \g\Gamma, \g\Delta, \g\Epsilon, \g\Zeta, \g\Eta, \g\Theta, +\g\Iota, \g\Kappa, \g\Lambda, \g\Mu, \g\Nu, \g\Xi, \g\Omicron, \g\Pi, \g\Rho, +\g\Sigma, \g\Tau, \g\Upsilon, \g\Phi, \g\Chi, \g\Psi, \g\Omega. + +\new \OpTeX/ +The variant of Greek letters in the output +(upright, italic, bold, bold sans serif, etc.) +written by the sequences `\alpha`, `\beta` etc. depends on the math alphabet +selected by `\_itgreek`, `\_rmgreek`, etc. selectors. The user-level +selectors `\bf` and `\bi` set `\_bsansgreek` and `\_bisansgreek`, so +`{\bi\delta}` produces $\bi\delta$. + +\new Unicode +All characters available in the math font can be accessed by \TeX/ control +sequence or by direct using the Unicode character in the document source. +Example: +\begtt \adef/{} +$$ + \sum/_{k=0}^\infty e^{(\alpha+i\beta/_k)} = + e^\alpha \sum/_{k=0}^\infty e^{i\beta/_k} = + e^\alpha \sum/_{k=0}^\infty (\cos\beta/_k + i\sin\beta/_k). +$$ +\endtt +or +\begtt \ttspec +$$ + ∑_{k=0}^∞ e^{(α + iβ_k)} = e^α ∑_{k=0}^∞ e^{iβ_k} + = e^α ∑_{k=0}^∞ (\cos β_k + i\sin β_k). +$$ +\endtt +both gives the same result: +$$ + ∑_{k=0}^∞ e^{(α + iβ_k)} = e^α ∑_{k=0}^∞ e^{iβ_k} + = e^α ∑_{k=0}^∞ (\cos β_k + i\sin β_k). +$$ +\medskip + + +\sec Other specialities + +\secc The `\not` prefix + +You can apply `\not` to the following math object. +The slash $/$ is overprinted such math object, for example +`$a \not= b$` gives $a \not= b$. + +\new \OpTeX/ +If there exist a direct Unicode character for negation of a relation symbol +(for example `\ne` creates $\ne$ directly as a character U+2260) +then `\not<char>` expands to appropriate Unicode character. +For example `\not=` expands to `\ne` or `\not\in` expands to `\notin`. +If such character does not exist then +the centered $/$ is overprinted over the next character. + + +\secc The `\bulidrel` macro: text over relation + +The macro `\buildrel <text>\over <relation>` creates a new atom Rel with the +<relation> and with the smaller <text> above this <relation>. Example: +`$M \buildrel\rm def\over= X\cup Y$` gives $M\buildrel\rm def\over= X\cup Y$. + + +\secc Spaces + +Spaces between atoms are created automatically as were mentioned in +section~\ref[class]. But sometimes you have to help \TeX/ to create +appropriate space. You can use following macros: + +\begitems +* `\,` is {\em thin space} used around Op atoms, after comma, etc.: \ss\,, +* `\!` is negative thin space, +* `\>` is {\em medium space} used around Bin atoms: \ss\>, +* `\;` is {\em thick space} used around Rel atoms: \ss\;, +* `\quad` is {\em em space}: \ss\quad, +* `\qquad` is {\em double em space}: \ss\qquad. +\enditems +% +Of course, you can use {\em direct space} {\visiblesp`\ `} which is \TeX/ primitive +and gives interword space: \ss\ \ +or you can use `\hskip <value>` to put arbitrary space. + +The space size of `\,`, `\!` resp. `\>`, resp. `\;` is given by +`\thinmuskip`, resp. `\medmuskip`, resp. `\thickmuskip` values. You can see +in the `plain.tex` file that these default values differ very little in their basic +size but there is no stretchability/shrinkability in the `\,` space, there is small +stretchability in the `\>` space and more stretchability in the `\;` space. + +The registers `\thinmuskip`, `\medmuskip` and `\thickmuskip` store so called +{\em mu values} given by math unit `mu`. It is 1/18 em and this unit depends +on the current font size used in the math formula ($S$ or $SS$ styles use +smaller font size, the `mu` unit is smaller here). You can use `\muskip` +instead `\hskip` or `\mukern` instead `\kern` if you want to use this +special mu unit. It is allowed only in math mode. + +The `\quad` and `\qquad` spaces have fixed width and they can be used in text +mode too. (\OpTeX/ allows to use `\,` in text mode too). +Use `\quad` or `\qquad` if you want to separate more formulas created in +single math mode. Examples of typical usage of spaces: + +\begtt \adef/{} \typosize[10/12] +$$ \alpha\,(x+y), \qquad \int/_a^b \!\! f(x)\,{\rm d}x, \qquad \Gamma/_{\!i}. $$ +\endtt +$$ \alpha\,(x+y), \qquad \int_a^b \!\! f(x)\,{\rm d}x, \qquad \Gamma_{\!i}. $$ + + +\secc Texts in math mode + +If you write `$Hello world!$` (i.e.\ Hello world in math mode), then you get +$Hello world!$. It is interpreted as product of variables $H$ and $e$ and +$l^2$ and $o$ etc., followed by the symbol ! used for factorial. +The non-ASCII letters (with accents) don't work at all because they are +never used as symbols for variables. Spaces are ignored. + +If you want to write a short text in the math mode, then you can use +`\hbox{<text>}`. The `\hbox` primitive initializes text mode regardless of +the \"outer mode". Example: + +\begtt \adef/{} \typosize[10/12] +$$ \sum/_{n=0}^\infty (-1)^n a_n \hbox{ converges, if $a_n\searrow 0$.} $$ +\endtt +$$ \sum_{n=0}^\infty (-1)^n a_n \hbox{ converges, if $a_n\searrow 0$.} $$ +% +Note the space before the word \"converges". The space before `\hbox` is +irrelevant. Second notice: the example shows the text mode inside math mode +and the in-line math mode inside this text mode. The same result can be +produced by: + +\begtt \adef/{} \typosize[10/12] +$$ \sum/_{n=0}^\infty (-1)^n a_n \hbox{ converges, if } a_n\searrow 0. $$ +\endtt +% +The difference can be visible if the formula $a_n\searrow 0$ includes a +fraction, for example ${1\over2}a_n\searrow 0$. The first example prints the +fraction in the text style and the second example prints it the display style. + +The disadvantage of `\hbox` is that it starts in the text mode independently +of the current style, but we want to use smaller font in $S$ or $SS$ styles. +\new \OpTeX/ +You can use `\mathbox{<text>}` in such situations. This macro behaves like +`\hbox` but the text is appropriately smaller in $S$ and $SS$ styles. +Example: +$$ + `{\mathbox{cena}\over\mathbox{výkon}}` \quad \hbox{gives } + {\mathbox{cena}\over\mathbox{výkon}} \hbox{ in $D$ style and } + \textstyle {\mathbox{cena}\over\mathbox{výkon}} \hbox{ in $T$ style.} +$$ +Note that $\mathbox{cena}\over\mathbox{výkon}$ means $\rm price\over performance$ +and you can write `$\rm price\over performance$` when you are using only +words without spaces and accented letters. But phrases with spaces or accented letters +should be printed in text mode using `\hbox` or `\mathbox`. + +\secc `\vcenter` + +The `\vcenter` primitive behaves like `\vbox`, but it can be used only in +math mode and its result is vertically centered to the math axis. +For example, matrices, are created by tables in `\vcenter`. + +All big objects in math formula is centered to math axis and the baseline is +ignored. In the following example we create a new big math operator by +`\vcenter`: +\begtt +$$ + \def\myop#1{\mathop{\vcenter{\frame{\vbox to2em{\vss\hbox{ $#1$ }\vss}}}}} + F(x) = \myop{x(i)}_{i=1}^\infty +$$ +\endtt +\vskip-2em +$$ + \def\myop#1{\mathop{\vcenter{\frame{\vbox to2em{\vss\hbox{ $#1$ }\vss}}}}} + F(x) = \myop{x(i)}_{i=1}^\infty +$$ + + +\secc Three dots + +You can write `$1,2,\dots,n$` to get $1,2,\dots,n$. The `\dots` macro puts +thin space between dots and after the last dot, so the five object: comma, +dots, comma are exactly equidistant. + +Typographic conventions say that you have to use the repeating symbol +before and after three dots (comma in previous example) and the three dots +should be at baseline, if the repeating symbol is at baseline. Or they should be +at math axis, if the repeating symbol is at math axis. We have to use `\cdots` instead +`\dots` in second case. Example: +$$ + `a_1, a_2, \dots, a_n, \quad a_1 + a_2 + \cdots + a_n` \qquad + a_1, a_2, \dots, a_n, \quad a_1 + a_2 + \cdots + a_n +$$ +\vskip-.7em +There are `\vdots` $\vdots$, `\ddots` $\ddots$ and `\adots` $\adots$ which +can be used in matrices. + +\new Unicode +Three dots like the output of the `\dots` macro are present as a single +character in fonts too. This character is called ellipsis. Font designers +typically suggest this character with smaller spaces between dots than we +need in math mode. So the rule about equidistant \"comma, three dots, comma" +is not met when this character is used. You can try `$1,2,\unicodeellipsis, n$` +and `$1+2+\unicodecdots + n$`. You get $1,2,\unicodeellipsis, n$ and +$1+2+\unicodecdots + n$. If you feel that this is better, then you can set: +`\let\dots=\unicodeellipsis \let\cdots=\unicodecdots`. + +The Unicode fonts includes compact variants `\unicodevdots` $\unicodevdots$, +`\unicodeddots` $\unicodeddots$ and `\unicodeadots` $\unicodeadots$ too. + + +\secc Phantoms and `\smash` + +The `\phantom{<math list>}` macro creates an invisible subformula equal to +the formula generated by <math list>. It has its size, so it can +interfere with surrounding visible subformulas. This macro is very useful for +aligning with special requirements. Examples are shown in +sections~\ref[matrix] and~\ref[elines]. + +The `\vphantom{<math list>}` has only its vertical size (i.e.\ its height +and depth), the width is zero. The `\hphantom{<math list>}` has only its +width. + +The `\smash{<math list>}` is the opposite of `\vphantom`. It creates visible +subformula but it has only its width. Its height and depth are zero. + +The result of these macros is the nucleus of an Ord atom. You can use `\mathop`, +`\mathbin`, etc. primitives to change this class. For example +`$a\mathrel{\phantom{=}}b$` creates the same formula as $a=b$ with the same +distance from $a$ to $b$ but without the equal sign: +$a\mathrel{\phantom{=}}b$. + +These macros work in the text mode too. Then their argument is +the <horizontal list>. + + +\sec Structured objects + +\secc[matrix] Matrices + +The macro `\matrix{<data>}` creates a vertically centered table of items. +The <data> includes <items> separated by `&` and rows are separated by +`\cr`. The number of columns and rows are unlimited. Columns are printed centered +and separated by the `\quad` space. The vertically scalable +brackets around the table are not printed. You can use `\pmatrix{<data>}` +instead `\matrix{<data>}`: the vertically scalable parentheses () are inserted +around the table. Examples: + +\begtt +$$ + {\bf A} = \pmatrix{a_{1,1} & a_{1,2} & \cdots & a_{1,n} \cr + a_{2,1} & a_{2,2} & \cdots & a_{2,n} \cr + \vdots & \vdots & \ddots & \vdots \cr + a_{m,1} & a_{m,2} & \cdots & a_{m,n} }, +$$ +\endtt +$$ + {\bf A} = \pmatrix{a_{1,1} & a_{1,2} & \cdots & a_{1,n} \cr + a_{2,1} & a_{2,2} & \cdots & a_{2,n} \cr + \vdots & \vdots & \ddots & \vdots \cr + a_{m,1} & a_{m,2} & \cdots & a_{m,n} }, +$$ +or: + +\begtt +\def\qmatrix[#1]{\left[\matrix{#1}\right]} +$$ + \qmatrix[a&b&c\cr d&e&f\cr g&h&i] \cdot \qmatrix[x_1\cr x_2\cr x_3] + = \qmatrix[b_1\cr b_2\cr b_3]. +$$ +\endtt +$$ + \def\qmatrix[#1]{\left[\matrix{#1}\right]} + \qmatrix[a&b&c\cr d&e&f\cr g&h&i] \cdot \qmatrix[x_1\cr x_2\cr x_3] + = \qmatrix[b_1\cr b_2\cr b_3]. +$$ + +If you need to aling the columns by another way than to center, then you can +use phantom. Compare: + +\begtt +$$ + \pmatrix{ 1 & -1 & 0 \cr + 0 & 2 & 13 \cr + -3 & 0 & 5 } \quad \hbox{or} \quad + \def\0{\phantom0} \def\+{\phantom+} + \pmatrix { \+1 & -1 & \00 \cr + \+0 & \+2 & 13 \cr + -3 & \+0 & \05 } +$$ +\endtt +$$ + \pmatrix{ 1 & -1 & 0 \cr + 0 & 2 & 13 \cr + -3 & 0 & 5 } \quad \hbox{or} \quad + \def\0{\phantom0} \def\+{\phantom+} + \pmatrix { \+1 & -1 & \00 \cr + \+0 & \+2 & 13 \cr + -3 & \+0 & \05 } +$$ + +\new\OpTeX/ +Another option to set right aligned matrix is setting the `\lmfil`: +Its value is used at left side in each `\matrix` item. The right side is +set directly to `\hfil`. +\begtt +$$ + \lmfil={\hfill} % left matrix filler = \hfill + \pmatrix{ 1 & -1 & 0 \cr 0 & 2 & 13 \cr -3 & 0 & 5 } +$$ +\endtt + +\new \OpTeX/ +If you want to draw a vertical line inside the matrix, you can use `\adef|` +as in the following example: +\begtt +$$ + \adef|{\kern-.2em&\strut\vrule&\kern-.2em} + \def\+{\phantom+} + \pmatrix{1 & 2 & 3 | 0 \cr 4 & 5 & 6 | 1 \cr 7 & 8 & 9 | 2 } \sim + \pmatrix{1 & \+2 & \+3 | 0 \cr 0 & -3 & -6 | 1 \cr 0 & -6 & -12 | 2} \sim + \pmatrix{1 & 2 & 3 | 0 \cr 0 & 1 & 2 | -1/3 \cr 0 & 0 & 0 | 1 } +$$ +\endtt +$$ + \adef|{\kern-.2em&\strut\vrule&\kern-.2em} + \def\+{\phantom+} + \pmatrix{1 & 2 & 3 | 0 \cr 4 & 5 & 6 | 1 \cr 7 & 8 & 9 | 2 } \sim + \pmatrix{1 & \+2 & \+3 | 0 \cr 0 & -3 & -6 | 1 \cr 0 & -6 & -12 | 2} \sim + \pmatrix{1 & 2 & 3 | 0 \cr 0 & 1 & 2 | -1/3 \cr 0 & 0 & 0 | 1 } +$$ + +If you want to put something before opening bracket in the matrix, you can +use another `\matrix`. Example: + +\begtt +$$ + \adef|{\kern-.2em&\strut\vrule&\kern-.2em} + \def\+{\phantom+} + \def\r{{\bf r}} + \pmatrix{1 & 2 & 3 | 0 \cr 4 & 5 & 6 | 1 \cr 7 & 8 & 9 | 2 } \ \sim \ + \matrix{\cr 2.\r - 4\cdot 1.\r: \cr 3.\r -7\cdot 1.\r: } + \pmatrix{1 & \+2 & \+3 | 0 \cr 0 & -3 & -6 | 1 \cr 0 & -6 & -12 | 2} +$$ +\endtt +$$ + \adef|{\kern-.2em&\strut\vrule&\kern-.2em} + \def\+{\phantom+} + \def\r{{\bf r}} + \pmatrix{1 & 2 & 3 | 0 \cr 4 & 5 & 6 | 1 \cr 7 & 8 & 9 | 2 } \ \sim \ + \matrix{\cr 2.\r - 4\cdot 1.\r: \cr 3.\r -7\cdot 1.\r: } + \pmatrix{1 & \+2 & \+3 | 0 \cr 0 & -3 & -6 | 1 \cr 0 & -6 & -12 | 2} +$$ + +Plain \TeX/ defines the `\bordermatrix` macro which allows you to create a +top row above the brackets and left column before the opening bracket. +\TeX/book shows the following example: + +\begtt +$$ + M = \bordermatrix{ &C&I&C'\cr + C&1&0&0 \cr I&1-b&0 \cr C'&0&a&1-a } +$$ +\endtt +$$ + M = \bordermatrix{ &C&I&C'\cr + C&1&0&0 \cr I&1-b&0 \cr C'&0&a&1-a } +$$ + +The `\matrix` macro used in $D$ style creates all its items in $T$ style. +\new \OpTeX/ +If you are using the `\matrix` macro in $T$ style or $S$ style (but not in +fractions nor another matrices) then the resulting table is appropriately +smaller and all its items are processed in $S$ style. +If you are using `\matrix` in $SS$ style then the items are in $SS$ style too. +The following example shows one-column matrix in script style: +$$ + `\sum``_{\matrix{i\in M\cr j\in N\cr k\in P}} x_{i,j,k}` \ \hbox{ creates: } + \sum_{\matrix{i\in M\cr j\in N\cr k\in P}} x_{i,j,k} +$$ + + +\secc Cases + +The `\cases` macro can be used as in the following example: + +\begtt +$$ + f(x) = \cases{ 1 & for $x\le 0$, \cr + 100-x\over 100 & when $0 < x \le 100$, \cr + 0 & in other cases. } +$$ +\endtt +$$ + f(x) = \cases{ 1 & for $x\le 0$, \cr + 100-x\over 100 & when $0\string< x\le 100$, \cr + 0 & in other cases. } +$$ + +The `\cases` macro behaves like a special `\matrix` with two left aligned +columns and with left vertically scaled brace $\{$. +First column is processed in math mode and $T$ style, second column +is processed in text mode. We have to use `$...$` in the second column if +there is a math material. + + +\sec Lines in display mode + +\secc General principles + +The `$$<formula>$$` finalizes previous paragraph, prints centered <formula> on +single line with a vertical space above and below and opens next paragraph +with no indentation. + +From \TeX/'s point of view, the text above plus `$$<formula>$$` plus text +below is single paragraph interrupted by display <formula>. If there is no +text above (i.e. the opening `$$` are in vertical mode), then the internal +`\noindent` is processed first and empty line above <formula> is created. +Thus, it is definitely bad idea to open display mode in vertical mode: never +put empty line before `$$<formula>$$`. On the other hand, the empty line +just after `$$<formula>$$` says that the paragraph is finalized by the +<formula> and the next text (after the empty line) opens next paragraph with +indentation. Summary: + +\begitems +* \"Text above `$$<formula>$$` text below": the <formula> interrupts the + paragraph with \"Text above" and \"text below". The \"text below" is + without indentation. +* \"Text above `$$<formula>$$` empty line Text below": the \"Text below" + opens new paragraph with indentation. +* \"Empty line `$$<formula>$$`" is bad practice. +\enditems + +In contrast with the paragraph breaking, there is no built-in algorithm for +breaking display <formula> to more lines. If the <formula> is too wide then +overfull `\hbox` occurs and human must decide about splitting the <formula> +to more lines. The macros `\displaylines` and `\eqalign` are intended to +such task, see sections~\ref[dlines] and~\ref[elines]. + +On the other hand, the in-line math <formula>, i.e.\ the `$<formula>$` in a +paragraph, can be broken after a Bin atom (with penalty `\binoppenalty`) or +after a Rel atom (with penalty `\relpenalty`). If you don't want to break +such formula at a specific place then use `\nobreak`, for example +`$a+\nobreak b$`. If you want never to break such formulas then you can set +`\binoppenalty=10000`, `\relpenalty=10000`. (Default values are 700 and 500.) + + +\secc References to display lines + +The `$$<formula>\eqno<mark>$$` prints centered <formula> and the <mark> at +right margin. The `$$<formula>\leqno<mark>$$` prints centered <formula> and +the <mark> at left margin. Examples: + +\begtt +$$ a^2 + b^2 = c^2 \eqno (1) $$ +\endtt +$$ + a^2 + b^2 = c^2 \eqno (1) +$$ +\begtt \aftergroup\nobreak +$$ a^2 + b^2 = c^2 \leqno \rm Py $$ +\endtt +$$\predisplaypenalty=10000 + a^2 + b^2 = c^2 \leqno \rm Py +$$ +The <mark> is processed in math mode and $T$ style. If you want to put a +text here then you have to use `\rm <text>` or `\hbox{<text>}`. + +\new \OpTeX/ +The auto-generated <mark> can be created by `$$<formula>\eqmark$$`. The +<label> previously declared by `\label[<label>]` can be used. +Then it is associated to such +auto-generated <mark> and you can write a reference in the form +`see equation~\ref[<label>]`. You can write `\eqmark[<label>]` instead of +`\label[<label>]...\eqmark`. See the \OpTeX/ manual, section~1.4.3. + +\secc[dlines] The `\displaylines` macro + +This macro creates more horizontally centered formulas in one display mode. +The syntax is +\begtt \catcode`\<=13 +$$ \displaylines{ + <formula> \cr + <formula> \cr + ... \cr + <formula> +} $$ +\endtt +Usage of `\displaylines` is more +prefered than doing more display modes just behind each other. +Example: +\begtt +$$ \displaylines{ + (3x^3 + 4x^2 + 5x + 6) \cdot (x^6 + x^2 + 5) = \cr + = 3x^9 + 4x^8 + 5x^7 + 6x^6 + 3x^5 + 4x^4 + 20x^3 + 26x^2 + 25x + 30. +} $$ +\endtt +$$ \displaylines{ + (3x^3 + 4x^2 + 5x + 6) \cdot (x^6 + x^2 + 5) = \cr + = 3x^9 + 4x^8 + 5x^7 + 6x^6 + 3x^5 + 4x^4 + 20x^3 + 26x^2 + 25x + 30. +} $$ + +The output from `\displaylines` macro is breakable to more pages because +the lines are not encapsulated in one box. The macro uses a special feature of +`\halign` primitive. The disadvantage is that you cannot use `\eqno` nor +`\leqno` nor `\eqmark`. + +\new \OpTeX/ +\OpTeX/ provides alternative form: `\displaylines to<dimen> {<data>}`. +Then the centered formulas are encapsulated in a `\vcenter` box of width <dimen> and +usage of `\eqno` or `\leqno` or `\eqmark` is allowed. +The individual lines have the form `\hbox to<dimen>` and formulas are centered using +`\hss` from both sides. This means that you can set arbitrary <dimen> +without visual change of the formulas. Use smaller <dimen> value than +`\hsize` (or `\displaywidth`\fnote +{`\displaywith` = `\hsize` in most cases but it is +real display width when `\parshape` or `\hangindent` is used.}) +if you want to center formulas with `\eqno` appended. +The internal \TeX/ rule says: the formula with `\eqno` (or `\leqno`) is centered +if its width is less or equal `\displaywidth-4<mark-width>`. So +\begtt \catcode`\<=13 +$$ \displaylines to\hsize-8em {<formula>\cr<formula>}\eqno (1) $$ +\endtt +does global centering, because size of `(1)` is less than 2\,em. +You can do more experiments with this example, +for example `\diplaylines to\hsize{...}` +puts the `\eqno` mark to the next line in the display environment. Read +\TeX/book or \TeX/book naruby, where the precise explanation about such +positioning is. + +\new \OpTeX/ +You can use \"`\displaylines to<dimen>`" for more applications. For example, +you can put more +\"`\displaylines to<dimen>`" in single display mode, one next to second in order +to creating more centered columns with formulas; the width of such columns +are controlled by the <dimen> parameter. +Or, you can give an exception for first and last formula: + +\begtt \catcode`\<=13 +$$\displaylines to 10cm {<formula>\hfill \cr + <formula>\cr + <formula>\cr + \hfill <formula>} +$$ +\endtt +The example above gives similar result as the \LaTeX/ `multline` environment: +$$\displaylines to \hsize { + (3x^3 + 4x^2 + 5x + 6) \cdot (x^6 + x^2 + 5) = \hfill \cr + = 3x^9 + 3x^5 + 15x^3 + 4x^8 + 4x^4 + 20x^2 + 5x^7 + 5x^3 + 25x + + 6x^6 + 6x^2 + 30 = \cr + \hfill = 3x^9 + 4x^8 + 5x^7 + 6x^6 + 3x^5 + 4x^4 + 20x^3 + 26x^2 + 25x + 30. } +$$ + + +\secc[elines] The `\eqalign` macro + +The usage is: +\begtt \catcode`\<=13 +$$ \eqalign { <left-side> & <right-side> \cr + <left-side> & <right-side> \cr + ... \cr + <left-side> & <right-side> +} $$ +\endtt +The `\vcenter` box is created with two columns, left column is right aligned +and right column is left aligned. Example: + +\vbox{ +\begtt +$$ \eqalign{ + x + 2y + 3z &= 600 \cr + 12x + y - 3z &= 7 \cr + 4x - y + 5z &= -5 \cr +} $$ +\endtt +\vskip-5.7\baselineskip +{\hsize=1.35\hsize +$$ \eqalign{ + x + 2y + 3z &= 600 \cr + 12x + y - 3z &= 7 \cr + 4x - y + 5z &= -5 \cr +} $$}} + +\bigskip\noindent +The tab \"`&`" should be used just before a relation, i.e. `&=` is right, `=&` +is wrong. All lines are aligned to the used tab. + +Maybe you want more precise alignment in the example above. You can use +`\phantom`: + +\par\nobreak\vbox{ +\begtt +$$ \def\1{\phantom1} \def\+{\phantom+} + \eqalign{ + x + 2y + 3z &= 600 \cr + 12x + \1y - 3z &= \+7 \cr + 4x - \1y + 5z &= -5 \cr +} $$ +\endtt +\vskip-5.7\baselineskip +{\hsize=1.35\hsize +$$ \def\1{\phantom1} \def\+{\phantom+} + \eqalign{ + x + 2y + 3z &= 600 \cr + 12x + \1y - 3z &= \+7 \cr + 4x - \1y + 5z &= -5 +} $$}} +\bigskip +Another typical usage of the `\eqalign` macro: + +\begtt \typosize[10/12] +$$ \eqalign{ + p(x)\,q(x) &= (3x^3 + 4x^2 + 5x + 6) \cdot (x^6 + x^2 + 5) = \cr + &= 3x^9 + 4x^8 + 5x^7 + 6x^6 + 3x^5 + 4x^4 + 20x^3 + 26x^2 + 25x + 30. +} $$ +\endtt +$$ \eqalign{ + p(x)\,q(x) &= (3x^3 + 4x^2 + 5x + 6) \cdot (x^6 + x^2 + 5) = \cr + &= 3x^9 + 4x^8 + 5x^7 + 6x^6 + 3x^5 + 4x^4 + 20x^3 + 26x^2 + 25x + 30. +} $$ + +In \OpTeX/, \new\OpTeX/ +the `\eqalign` macro is more flexible. You can set the +`\baselineskip` value by the `\eqlines` parameter and math style +by the `\eqstyle` parameter. +For example, you need to put the system of \"equations" as an subscript of sum +operator: +\begtt \typosize[10/12] \adef/{} +$$ + \sum/_{\eqlines{\baselineskip=.7\baselineskip}\eqstyle{\scriptstyle}\eqalign{ + i &\in A \cr + \quad j &\in B\cup C \cr + m &\in C }} + i + j + m +$$ +\endtt +$$ + \sum_{\eqlines{\baselineskip=.7\baselineskip}\eqstyle{\scriptstyle}\eqalign{ + i &\in A \cr + \quad j &\in B\cup C \cr + m &\in C }} + i + j + m +$$ + +\indent \new\OpTeX/ +You can write more equation systems one next second: +\begtt +$$\eqalign{ + x + y + z &= 1 && a + b + c &= -1 \cr + u + v &= 20 && f + g &= -20 \cr + i &= j +}$$ +\endtt +You can use the third column for centered equations +without aligning point. For example: +\begtt \catcode`\<=13 +$$ \left( \eqspace=0pt \eqalign{&& <first equation>\cr + && <second equation>} \right) $$ +\endtt +The `\eqspace` is additional space used in the third column to separate +equation systems one next second. + +\new \OpTeX/ +\OpTeX/ extensions summary: +\begitems +* `\eqlines` and `\eqstyle` set baselineskip and math style of the formulas. +* `\eqalign` allows more than two columns: + First column is right aligned (no space). Second is left aligned (no space). + Third column (if used) + is centered with `\eqspace/2` at left and right boundary of the column. + Fourth is the same as first. Fifth is the same as second etc. The number + of columns which can be used in `\eqalign` is unlimited. +\enditems + +\secc The `\eqalign` macro with references + +You can give common mark to whole equation system by +`$$\eqalign{<data>}\eqno <mark>$$`. If you want to give marks to individual +lines of the equation system, then you can use another macro: +`\eqalignno`. The usage is similar as `\eqalign` but the +third column (if used) is intended to the equation mark. Example: + +\begtt +$$ \eqalignno{ + x + 2y + 3z &= 600 & \rm(A) \cr + 12x + y - 3z &= 7 & \rm(B) \cr + 4x - y + 5z &= -5 & \rm(C) \cr +} $$ +\endtt +\vskip-\baselineskip +$$ \eqalignno{ + x + 2y + 3z &= 600 & \rm(A) \cr + 12x + y - 3z &= 7 & \rm(B) \cr + 4x - y + 5z &= -5 & \rm(C) \cr +} $$ + +The `\leqalignno` macro is similar as `\eqalignno` but the marks are at the left +margin. The \OpTeX/ extensions of `\eqalign` are not available in +`\eqalignno` nor `\leqalignno` macros. + +\new \OpTeX/ +You can use auto-generated marks by `\eqmark` macro: +`$$\eqalign{<data>}\eqmark$$` or: +\begtt +$$ \eqalignno{ + x + 2y + 3z &= 600 & \eqmark[A] \cr + 12x + y - 3z &= 7 & \eqmark[B] \cr + 4x - y + 5z &= -5 & \eqmark[C] \cr +} $$ +\endtt + + +\sec Concept of loading math fonts + +\secc[fams] Math families + +\TeX/ is able to use more than one math font in math mode. This was a +necessity in old days when only 128-characters fonts existed. +Each math font used in math mode has its {\em math family} represented by a number. +Math family is a collection of three (almost) equal fonts in three sizes: +first for `\textstyle` and `\displaystyle`, second for `\scriptstyle` +and third for `\scriptscriptstyle`. + +\new Unicode +When Unicode math font is loaded then it includes all three optical sizes and +all characters needed for typeseting math formula. +Theoretically, we can use only one math family with this single font. But more math families +(i.e.\ more fonts in math mode) is still possible. You can combine +characters from more fonts (Unicode fonts and old TFM fonts together) in one math formula. + +\new \OpTeX/ +\OpTeX/ loads the specified Unicode math font into math family 1. The math +families 2 and 3 are reserved for specific \TeX/nical reasons, family 4 is +used for `\script` font and families 5, 6, 7, etc. can be used by user for +loading more fonts. The default macro for loading math fonts looks like: + +\begtt \typosize[10/12] +\_def\_normalunimath{% + \_loadumathfamily 1 {\_unimathfont}{} % Base Unicode math font + \_loadmathfamily 4 rsfs % \script (old TFM font) + \_setunimathdimens % set dimen parameters used in math formulas internally +}% +\let\_normalmath=\_normalunimath % this is done when Unicode math is initialized +\endtt +% +Whenever \OpTeX/ needs to resize math fonts (for example in footnotes or +titles), it calls the `\_normalmath` macro in order to reload all math +families to desired size. If you want to add a next font, you can add +`\_loadunimathfamily <family> {<Unicode-font>}{<features>}` or +`\_loadmathfamily <family> <TFM-font>` into the `\_normalmath` macro. +The example in section~\ref[newfam] shows how to do it. + +\secc Two variants of math fonts: normal and bold + +All math formulas in the whole document need only one Unicode font (or only one collection +of math fonts as mentioned in section~\ref[fams]). But this +is not really true if titles are in bold font. If a math formula is present in +such a bold title then all characters of this formula must be bolder. +For example \"normal" variables must be in bold italic in titles, symbols +like `+` `=` must be bold and \"normal bold" letters +(e.g., indicating vectors in math formula) must be extra bold in titles. +It means that all fonts from collection of math fonts must be bolder. +We need second collection of math fonts with bolder +shape. Unfortunately, it is not always available. + +\new \OpTeX/ +If you have bold variant of used Unicode math font, then you can use +`\loadboldmath` command, for example: +\begtt +\loadmath {[xitsmath-regular]} +\loadboldmath {[xitsmath-bold]} \to {[xitsmath-regular]} +\endtt +% +\OpTeX/ uses `\_normalmath` macro for loading collection of math fonts in +\"normal" cases and `\_boldmath` macro for bold titles. The font declared by +`\loadboldmath` is used in second case. But if the bold variant of the font is +not available (this is unfortunately more typical), then \OpTeX/ uses faked +bold of basic Unicode math font (the `embolden` internal font feature is +used). So, the default `\_boldmath` macro defined by \OpTeX/ looks like: + +\begtt \typosize[10/12] +\_def\_boldunimath{% + \_ifx\_unimathboldfont \_undefined + \_loadumathfamily 1 {\_unimathfont}{embolden=1.7;} % Base faked bold + \_else + \_loadumathfamily 1 {\_unimathboldfont}{} % Base real bold font + \_fi + \_loadmathfamily 4 rsfs % rsfs in not in bold, unfortunately + \_setunimathdimens +}% +\let\_boldmath=\_boldunimath % this is done when Unicode math is initialized +\endtt + +\secc[newfam] Example of using additional math font + +The font `bbold10.tfm` includes double stroked characters, for example +double stroked plus, double stroked Greek letters and digits. +Try to run `pdftex testfont`, then answer to the question about name of the +font: `bbold10` and then type command `\table\end`. The `testfont.pdf` is +printed with the table of characters of this font. +Most of these characters cannot be found in Unicode math fonts. + +\new \OpTeX/ +We show an example how to add this font to the collection of used math fonts. +We can re-define the `\_normalmath` macro by: +\begtt \typosize[10/12] +\addto\_normalmath {\_loadmathfamily 5 bbold } + +\_regtfm bbold 0 bbold5 5.5 bbold6 6.5 bbold7 7.5 bbold8 8.5 bbold9 + 9.5 bbold10 11.1 bbold12 15 bbold17 * % using all bbold*.tfm +\_normalmath % reload the math fonts collection +\endtt +% +The string \"`bbold`" is declared by `\_regtfm` as a collection of all +`bbold*.tfm` fonts, the optical sizes are supported. + +\addto\_normalmath {\_loadmathfamily 5 bbold } +\_regtfm bbold 0 bbold5 5.5 bbold6 6.5 bbold7 7.5 bbold8 8.5 bbold9 + 9.5 bbold10 11.1 bbold12 15 bbold17 * % using all bbold*.tfm +\_normalmath +\Umathchardef \bbplus 2 5 "2B +\Umathchardef \bble 3 5 "3C +\Umathchardef \bbge 3 5 "3E + +Finally, we must to declare new \TeX/ sequences for accessing the characters +from the new font, for example: + +\begtt \typosize[10/12] +\Umathchardef \bbplus 2 5 "2B +\Umathchardef \bble 3 5 "3C +\Umathchardef \bbge 3 5 "3E +\endtt +% +The `\Umathchardef` \TeX/ primitive declares new \TeX/ sequence used in math +typesetting. First parameter is class number (2 means Bin, 3 means Rel, +see the table in the section~\ref[class]). Second parameter is math +family number. It is 5, see the redefinition of the `\_normalmath` macro above. +Third parameter is the slot in the font. Now you can try to use these characters: +$$ + `a \bbplus b \bbge c` \quad \hbox{gives} \quad a \bbplus b \bbge c. +$$ +% +Maybe, you want to declare a special math selector which can be used as +`$\bball a+b>c$` in order to get $\bbchar a \bbplus b \bbge c$. +Then you can define: + +\begtt \typosize[10/12] +\def\bball {\bbchar \Umathcodenum `+ \bbplus + \Umathcodenum `> \bbge + \Umathcodenum `< \bble } +\endtt + +If you want to add all double stroked Greek letters into `\bball` +selector, then you can do something like this: + +\begtt \typosize[10/12] +\def\setbbgreek #1 {\tmpnum=#1\xargs\setbbgreekA} +\def\setbbgreekA #1{\Umathcode \_ea`#1 0 5 \tmpnum \advance\tmpnum by1 } + +\addto\bball {% + \setbbgreek "0B \alpha \beta \gamma \delta \epsilon \zeta \eta + \theta \iota \kappa \lambda \mu \nu \xi \pi \rho \sigma + \tau \upsilon \phi \chi ; + \setbbgreek "7F \omega ; + \setbbgreek "00 \Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon + \Phi \Psi \Omega ; } +\endtt +% +The `\Umathcode <input-code> <class> <family> <font-slot>` primitive is used +here. The control sequences `\alpha`, `\beta`, `\gamma` etc. are macros which expand +to the Unicode character of appropriate (non-math) Greek letter. We set the +Umathcode to such character, for example +\code{\\Umathcode `}$\_rmgreek\alpha$` 0 5 "0B` is processed. + +The bold variant of the font `bbold*.tfm` is not available, unfortunately. +We have to settle for normal version of the font in the `\_boldmath` macro: + +\begtt \typosize[10/12] + \addto \_boldmath {\_loadmathfamily 5 bbold } +\endtt + + +\bye diff --git a/Master/texmf-dist/doc/luatex/optex/optex-techdoc.tex b/Master/texmf-dist/doc/luatex/optex/optex-techdoc.tex index 0d53140a24b..8d1b10186a6 100644 --- a/Master/texmf-dist/doc/luatex/optex/optex-techdoc.tex +++ b/Master/texmf-dist/doc/luatex/optex/optex-techdoc.tex @@ -186,11 +186,12 @@ The `\margins` macro is documented in the section~\ref[marg]. \printdoc hi-syntax.opm \sec Graphics -\printdoc graphics.opm +\printdoctail graphics.opm +\printdoc graphics.opm -\sec[table] The \code{\\table} macro +\sec[table] The \code{\\table} macro, tables and rules \printdoctail table.opm -\secc[table.impl] Implemetation of the \code{\\table} macro +\secc[table.impl] Implemetation of the \code{\\table} macro and friends \printdoc table.opm \sec Balanced multi-columns @@ -214,7 +215,7 @@ The `\margins` macro is documented in the section~\ref[marg]. \sec[makeindex] Sorting and making Index \printdoc makeindex.opm -\sec Footnotes and marginal notes +\sec[fnotes] Footnotes and marginal notes \printdoc fnotes.opm \sec Styles diff --git a/Master/texmf-dist/doc/luatex/optex/optex-userdoc.tex b/Master/texmf-dist/doc/luatex/optex/optex-userdoc.tex index 15a33ee6324..6d6672be4f6 100644 --- a/Master/texmf-dist/doc/luatex/optex/optex-userdoc.tex +++ b/Master/texmf-dist/doc/luatex/optex/optex-userdoc.tex @@ -136,7 +136,8 @@ 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 to Plain \TeX/ \"output routine". +\OpTeX/ uses \"output routine" for page design. +It is very similar to Plain \TeX/ output routine. 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 @@ -168,8 +169,7 @@ 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`. +More about the page layout is documented in sections~\ref[oparams] and~\ref[output]. \secc Footnotes and marginal notes @@ -184,8 +184,7 @@ on each chapter from one\fnote document from one or \^`\fnotenumpages` if you want footnotes numbered at each page from one. Default setting is \^`\fnotenumchapters`}. The <text> is scaled to 80 \%. -User can redefine footnote mark or scaling, as shown in the file -`fnotes.opm`. +User can redefine footnote mark or scaling, as shown in the section~\ref[fnotes]. 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 @@ -219,11 +218,11 @@ The <text> 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{<text>}` -shifts this (and only this) note two lines up. +by using the `up` keyword: \~`\mnote`` up<dimen>{<text>}`. +You can set such <dimen> to each \^`\mnote` manually in final printing +in order to margin notes do not overlap. The positive value of <dimen> +shifts the note up and negative value shifts it down. For example +\^`\mnote`` up 2\badselineskip{<text>}` shifts this marginal note two lines up. \sec Fonts @@ -255,7 +254,7 @@ be used before a 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 First text \it Second text` +`{\caps \rm First text \it Second text}` gives {\caps \rm First text \it Second text}. \new @@ -278,7 +277,7 @@ This is {\em important} text. % = This is {\it important\/} text. \endtt \new -More about the \OpTeX/ Font Selection System is written the technical +More about the \OpTeX/ Font Selection System is written in the technical documentation in the section~\ref[fontsystem]. You can mix more font families in your document, you can declare your own variant selectors or modifiers etc. @@ -357,6 +356,10 @@ section~\ref[setfontsize]. \secc Typesetting math %%%%%%%%%%%%%%%%%%%%% +See the additional document +\ulink[http://petr.olsak.net/ftp/olsak/optex/optex-math.pdf] +{Typesetting Math with \OpTeX/} for more details about this issue. + \OpTeX/ preloads a collection of 7bit Computer Modern math fonts and AMS fonts in its format for math typesetting. You can use them in any size and in the \^`\boldmath` variant. @@ -368,12 +371,14 @@ math font. This font is automatically 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{[<font-file>]}` -or \^`\loadmath{font-name}` before first \^`\fontfam` command. +or \^`\loadmath{<font-name>}` before first \^`\fontfam` 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. +manual or +\ulink[http://petr.olsak.net/ftp/olsak/optex/optex-math.pdf] +{Typesetting Math with \OpTeX/} for complete list of math symbols. The following math alphabets are available: @@ -391,8 +396,8 @@ The following math alphabets are available: 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 them, see the file `unimath-codes.opm` where -Unicode math variants of \^`\bf` and \^`\bi` selectors are defined. +matrices. You can re-declare them, see section~\ref[unimath-codes] where +definitions of Unicode math variants of \^`\bf` and \^`\bi` selectors are documented. The math fonts can be scaled by \^`\typosize` and \^`\typoscale` macros. Two math fonts collections are prepared: \^`\normalmath` for normal weight @@ -407,8 +412,6 @@ scriptscript). Moreover, there is the macro \^`\mathstyles{<math list>}` which d the current math style. It is documented at the end of the section~\ref[math-macros]. -The \^`\eqalign` macro is more flexible in \OpTeX/, see technical documentation about it. - \sec Typical elements of document %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -416,7 +419,7 @@ The \^`\eqalign` macro is more flexible in \OpTeX/, see technical documentation \secc[chap] Chapters and sections %%%%%%%%%%%%%%%%%%%%%%%%%% -The document can be divided into chapters (\^`\chap`), +The documents can be divided into chapters (\^`\chap`), sections (\^`\sec`), subsections (\^`\secc`) and they can be titled by \^`\tit` command. The parameters are separated by the end of current line (no braces are used): @@ -428,10 +431,6 @@ braces are used): \secc Subsection title <end of line> \endtt -If you want to write a title to more lines in your source file then you can -use percent character before <end of line>. Such <end of line> is not -scanned and reading of the title continues at the 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. @@ -444,10 +443,17 @@ 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 +If a title is so long then it breaks to more lines in the output. 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. +If you want to arrange a title to more lines in your source file then you can +use `^^J` at the end of each line (except the last one). +When `^^J` is used, then reading of the title continues at the next line. +The \"normal" comment character `%` doesn't work in titles. +You can use \^`\nl`{\visiblesp` ^^J`} if you want to have corresponding lines in the source +and in the output. + 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. You can combine both prefixes. @@ -457,7 +463,7 @@ contents if \^`\notoc` precedes. You can combine both prefixes. 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. +figures. The user can declare more numbered objects. 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 @@ -528,6 +534,10 @@ Example: <caption and table> \endinsert \endtt +% +The pair \^`\midinsert`...\^`\endinsert` prefers to put the enclosed object +to the current place. Only if this is unable due to page breaking, it +behaves like \^`\topinsert`...\^`\endinsert`. \new There are five prepared counters `A`, `B`, `C`, `D` and `E`. @@ -545,10 +555,10 @@ macro. For example: 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... +{\bf Theorem 1.4.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... +is printed like {\bf Theorem 1.4.2 (L'Hôpital's rule).} Let $f$, $g$ be... \secc References @@ -584,12 +594,12 @@ During each pass, the working `*.ref` file (with references data) is created and this file is used (if it exists) at the beginning of the document. You can use the \^`\label[<label>]` before the `\theorem`, `\definition` etc.\ -(macros defined by `\numberedpar`) if you want to reference these numbered objects. +(macros defined with `\numberedpar`) if you want to reference these numbered objects. You can't use `\theorem[<label>]` because the optional parameter is reserved to another purpose here. You can create a reference to whatever else by commands -\^`\label[<label>]\wlabel{<text>}`. The connection between <label> and +\^`\label[<label>]`\^`\wlabel{<text>}`. The connection between <label> and <text> is established. The \^`\ref[<label>]` will print <text>. By default, labels are not printed, of course. But if you are preparing a @@ -600,14 +610,14 @@ are printed at their destination places after such declaration. \secc Hyperlinks, outlines %%%%%%%%%%%%%%%%%%%%%%%%% -If the command \^`\hyperlinks <color-in> <color-out>` is used at the beginning of +If the command \^`\hyperlinks` `<color-in> <color-out>` is used at the beginning of the document, then the following objects are hyperlinked in the PDF output: \begitems * numbers generated by \^`\ref` or \^`\pgref`, * numbers of chapters, sections and subsections in the table of contents, -* numbers or marks generated by `\cite` command (bibliography references), -* texts printed by \^`\url` or \^`\ulink` commands. +* numbers or marks generated by \~`\cite` command (bibliography references), +* texts printed by \~`\url` or \~`\ulink` commands. \enditems The last object is an external link and it is colored by @@ -639,7 +649,7 @@ in footnotes have <color-fnf>. You can define relevant borders There are \"low level" commands to create the links. You can specify the destination of the internal link by \^`\dest[<type>:<label>]`. The -active text linked to the `\dest` can be created by +active text linked to the \^`\dest` can be created by \^`\ilink[<type>:<label>]{<text>}`. The `<type>` parameter is one of the `toc`, `pg`, `cite`, `ref` or another special for your purpose. These commands create internal links only when \^`\hyperlinks` is declared. @@ -657,17 +667,17 @@ You can insert the `\|` command in the `\url` argument as a potential breakpoint. If the linked text have to be different than the URL, you can use -\^`\ulink[<url>]{text}` macro. For example: +\^`\ulink[<url>]{<text>}` macro. For example: `\ulink[http://petr.olsak.net/optex]{\OpTeX/ page}` outputs to the text \ulink[http://petr.olsak.net/optex]{\OpTeX/ page}. The PDF format provides {\em outlines} which are notes placed in the special frame of -the PDF viewer. These notes can be managed as structured as hyperlinked +the PDF viewer. These notes can be managed as structured and hyperlinked table of contents of the document. The command \^`\outlines{<level>}` creates such outlines from data used for table of contents in the document. The <level> parameter gives the level of opened sub-outlines -in the default view. The deeper levels can be open by mouse click on the +in the default view. The deeper levels can be opened by mouse click on the triangle symbol after that. \new @@ -732,7 +742,7 @@ produces: Another style can be defined by the command \^`\sdef{_item:<style>}{<text>}`. Default item can be set by \^`\defaultitem={<text>}`. -The list environments can be nested. Each new level of item is indented by +The list environments can be nested. Each new level of items is indented by next multiple of \^`\iindent` value which is set to `\parindent` by default. The \^`\ilevel` register says what level of items is currently processed. Each \^`\begitems` starts \^`\everylist` tokens register. You can set, for @@ -751,7 +761,7 @@ found in the section~\ref[lists]. The macro \^`\table{<declaration>}{<data>}` provides similar <declaration> of tables as in \LaTeX: you can use letters `l`, `r`, `c`, each letter declares -one column (aligned to left, right, center respectively). +one column (aligned to left, right, center, respectively). These letters can be combined by the `|` character (vertical line). Example \begtt @@ -774,7 +784,7 @@ generates the following result: Apart from `l`, `r`, `c` declarators, you can use the `p{<size>}` declarator which declares the column with paragraphs of given width. More precisely, -a long text in the table cell is printed as an paragraph with given width. +a long text in the table cell is printed as a multiline paragraph with given width. By default, the paragraph is left-right justified. But there are alternatives: @@ -797,11 +807,12 @@ prefixed. For example `3c` means `ccc` or `c 3{|c}` means can use them in order to more legibility. The command `\cr` used in the <data> part of the table -is generally known. It marks the end of each row in the table. +is generally known from Plain \TeX. It marks the end of each row in the table. Moreover \OpTeX/ defines following similar commands: \begitems * \^`\crl` \dots\ the end of the row with a horizontal line after it. +* \^`\crll` \dots\ the end of the row with a double horizontal line after it. * \^`\crli` \dots\ like \^`\crl` but the horizontal line doesn't intersect the vertical double lines. * \^`\crlli` \dots\ like \^`\crli` but horizontal line is doubled. @@ -811,7 +822,7 @@ Moreover \OpTeX/ defines following similar commands: \^`\crlp{1-3,5}` is equal to \^`\crlp{1,2,3,5}`. \enditems -The \^`\tskip<dimen>` command works like the `\noalign{\vskip<dimen>}` +The \^`\tskip``<dimen>` command works like the `\noalign{\vskip<dimen>}` immediately after `\cr*` commands but it doesn't interrupt the vertical lines. \new @@ -917,7 +928,7 @@ More about it is in technical documentation in section~\ref[table.impl]. See the definition of the \^`\tabdeclarec` macro, for example. The `:` columns boundary declarator is described in section~\ref[table.bound]. -The tables with given width can be declared by `to<size>` or `xto<size>`. +The tables with given width can be declared by `to<size>` or `pxto<size>`. More about it is in section~\ref[table.w] Many tips about tables can be seen on the site \url{http://petr.olsak.net/optex/optex-tricks.html}. @@ -952,7 +963,7 @@ User can change values of the `\parindent` and \^`\ttindent` independently. The \^`\begtt` command starts internal group in which the catcodes are changed. \new Then the \^`\everytt` tokens register is run. It is empty by default and user can -control fine behavior by it. For example the catcodes can be reseted here. If +control fine behavior by it. For example the catcodes can be re-declared here. If you need to define active character in the \^`\everytt`, use \^`\adef` as in the following example: @@ -993,10 +1004,11 @@ Each occurrence of ? will be changed to ! and vice versa. \endtt The in-line verbatim surrounded by an `\activettchar` doesn't work in -parameter of macros and macro definitions, especially in titles declared by -\~`\chap`, \~`\sec` etc. +parameter of macros and macro definitions. (It works in titles declared by +\~`\chap`, \~`\sec` etc. and in \~`\fnote`s, because these macros are +specially defined in \OpTeX/). \new -You can use more robust command \^`\code{<text>}` in such +You can use more robust command \^`\code{<text>}` in problematic situations, but you have to escape following characters in the <text>: `\`, `#`, `%`, braces (if the braces are unmatched in the <text>), and space or `^` (if there are more than one subsequent spaces or `^` in @@ -1038,10 +1050,10 @@ numbers are printed. The \^`\verbinput` can be controlled by \^`\everytt`, \^`\ttindent` just like in \~`\begtt...`\~`\endtt`. -The \~`\begtt`...`\~``\endtt` pair or \~`\verbinput` can be used for listings of +The \~`\begtt`...\~`\endtt` pair or \~`\verbinput` can be used for listings of codes. Automatic syntax highlighting is possible, for example `\begtt` \^`\hisyntax{C}` activates colors for C programs. Or -`\verinput` \^`\hisyntax{HTML} (-) file.html` can be used for HTML or XML codes. +`\verbinput` \^`\hisyntax{HTML} (-) file.html` can be used for HTML or XML codes. \OpTeX/ implements C, Python, \TeX/, HTML and XML syntax highlighting. More languages can be declared, see the section~\ref[hisyntax]. @@ -1057,10 +1069,11 @@ and \~`\secc` used in the document. These data are read from external `*.ref` fi you have to run \TeX/ more than once (typically three times if the table of contents is at the beginning of the document). -The name of the section with table of contents is not printed. The direct usage -of \~`\chap` or \~`\sec` isn't recommended here because the table of contents +Typically, we don't want to repeat the name of the section \"table of contents" +in the table of contents again. The direct usage +of \~`\chap` or \~`\sec` isn't recommended here because the table of contents is typically not referenced to itself. You can print the unnumbered and unreferenced -title of the section by the code: +title of the section like this: \begtt \nonum\notoc\sec Table of Contents @@ -1094,9 +1107,9 @@ program is needed, the alphabetical sorting are done inside \TeX/ at macro level. The \^`\ii` command (insert to index) declares the word separated by the space -as the index item. This declaration is represented as invisible atom on the +as the index item. This declaration is represented as invisible item on the page connected to the next visible word. The page number of the page where -this atom occurs is listed in the index entry. So you can type: +this item occurs is listed in the index entry. So you can type: \begtt The \ii resistor resistor is a passive electrical component ... @@ -1114,7 +1127,7 @@ Note that the dot or comma have to be separated by space when \^`\iid` is used. This space (before dot or comma) is removed by the macro in the current text. -The multiple-words entries are commonly organized in the index as follows: +The multiple-words entries are commonly arranged in the index as follows: \medskip @@ -1139,7 +1152,7 @@ Example: The number of the parts of one index entry is unlimited. Note, that you can spare your typing by the comma in the \~`\ii` parameter. The previous example -is equivalent to `\ii linear/space` `\ii vector/space`. +is equivalent to `\ii linear/space \ii vector/space`~. Maybe you need to propagate to the index the similar entry to the linear/space in the form space/linear. You can do this by the shorthand `,@` @@ -1166,7 +1179,7 @@ The \^`\makeindex` creates the list of alphabetically sorted index entries without the title of the section and without creating more columns. \OpTeX/ provides another macros \^`\begmulti` and \^`\endmulti` for more columns: -\begtt +\begtt \catcode`\<=13 \begmulti <number of columns> <text> \endmulti @@ -1218,7 +1231,7 @@ depending on the used bib-style. For example the citations look like [Now08] or [Nowak, 2008]. The \^`\rcite[<labels>]` creates the same list as \^`\cite[<labels>]` but without -the outer brackets. Example: `[\rcite[tbn], pg.~13]` creates [4,~pg.13]. +the outer brackets. Example: `[\rcite[tbn], pg.~13]` creates [4,~pg.~13]. The \^`\ecite[<label>]{<text>}` prints the `<text>` only, but the entry labeled <label> is decided as to be cited. If \~`\hyperlinks` is used then <text> @@ -1334,10 +1347,10 @@ with CMYK components using \^`\setcmykcolor`. On the other hand, you can define a color with three RGB components and \^`\morecolors` defines such RGB colors. By default, the color model isn't converted but only stored to -PDF output for each used color by default. Thus, there may be a mix of color +PDF output for each used color. Thus, there may be a mix of color models in the PDF output which is not good idea. You can overcome this problem by declaration \^`\onlyrgb` or \^`\onlycmyk`. Then only selected color -model is used for PDF output and if an used color is declared by another color +model is used for PDF output and if a used color is declared by another color model then it is converted. The \^`\onlyrgb` creates colors more bright (usable for computer presentations). On the other hand CMYK makes colors more true\fnote @@ -1429,8 +1442,8 @@ with the current matrix so linear transformations can be composed. One linear transformation given by the `\pdfsetmatrix` above transforms the vector $[0,1]$ to [<a>,\,<b>] and $[1,0]$ to [<c>,\,<d>]. The stack-oriented commands `\pdfsave` and `\pdfrestore` gives a possibility of -storing and restoring the current transformation matrix and the current point. -The position of the current point have to be the same from \TeX{}'s point of +storing and restoring the current transformation matrix and the position of the current point. +This position have to be the same from \TeX{}'s point of view as from transformation point of view when `\pdfrestore` is processed. Due to this fact the `\pdfsave\rlap{<transformed text>}\pdfrestore` or something similar is recommended. @@ -1438,7 +1451,7 @@ or something similar is recommended. \OpTeX/ provides two special transformation macros \^`\pdfscale` and \^`\pdfrotate`: -\begtt +\begtt \catcode`\<=13 \pdfscale{<horizontal-factor>}{<vertical-factor>} \pdfrotate{<angle-in-degrees>} \endtt @@ -1470,8 +1483,8 @@ third: \pdfsave \pdfrotate{-15.3}\pdfsetmatrix{2 0 1.5 2}\rlap{text3}\pdfrestore You can see that \TeX/ knows nothing about dimensions of transfomed material, it treats it as with a zero dimension object. \new -It can be solved by the \^`\transformbox{<transformation>}{<text>}` -macro. This macro puts the transformed +The \^`\transformbox{<transformation>}{<text>}` +macro solves the problem. This macro puts the transformed material to a box with relevant dimension. The <transfromation> parameter includes one or more transfromation commands `\pdfsetmatrix`, `\pdfscale`, `\pdfrotate` with their parameters. The <text> is transformed text. @@ -1656,7 +1669,7 @@ document. Or you can use `<prefixed text>\address...` to put `<prefixed text>` before first line of the address. The \^`\slides` style creates a simple presentation slides. See an example -in the file `op-slides.tex`. Run `optex op-slides.tex` and see the usage of +in the file `op-slides.tex`. Run `optex op-slides.tex` and see the documentation of \^`\slides` style in the file `op-slides.pdf`. Analogical declaration macro `\book` is not prepared. Each book needs an @@ -1667,10 +1680,10 @@ design. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% You can load more macro packages by `\input{<file-name>}` or by -\^`\load[<file-names>]`. The first case is \TeX/ primitive command, it can be +\^`\load[<file-names>]`. The first case (`\input`) is \TeX/ primitive command, it can be used in the alternative old syntax `\input <filename><space>` too. The -second case allows to specify a comma separated list of included files. -Moreover, the \^`\load` macro loads each macro file only once, it sets +second case (\^`\load`) allows to specify a comma separated list of included files. +Moreover, it loads each macro file only once, it sets temporarily standard category codes during loading and it tries to load `<filename>.opm` or `<filename>.tex` or `<filename>`, first occurence wins. Example: @@ -1683,8 +1696,8 @@ local information about the fact that these file names `qrcode` and `tikz` were already used, i.\,e. next \^`\load` will skip them. It is strongly recommended to use the `\load` macro for loading external -macros, if you need them. On the other hand, if your document is structured -to more files, use simply the `\input` primitive. +macros, if you need them. On the other hand, if your source document is structured +to more files (with individual chapters or sections), use simply the `\input` primitive. \secc Lorem ipsum dolor sit @@ -1697,7 +1710,7 @@ neutral text for such experiments. Use \^`\lorem[<number>]` or \^`\lorem[<from>-<to>]`. It prints a paragraph (or paragraphs) with neutral text. The numbers <number> or <from>, <to> must be in the range 1 to 150 because there are 150 paragraphs with neutral text prepared for you. -The \^`\lipsum` macro is equivalent to \^`\lorem`. Example \^`\lipsum[1-150]` +The \^`\lipsum` macro is equivalent to \^`\lorem`. Example: \^`\lipsum[1-150]` prints all prepared paragraphs. \secc Logos @@ -1807,18 +1820,21 @@ put it as the first command in your document: All macros of Plain \TeX/ are re-written in \OpTeX/. Common macros should 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 +prefixed by `_` (like `\_this`). If you need to use basic set of such Plain +\TeX/ control sequences (for example you are reading an old macro file), +use `\load[plain-at]`. + +All primitives and common macros have two control sequences with the same meaning: in prefixed and unprefixed form. 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 +should re-define unprefixed forms of control sequences without 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). +re-defined without change of internal \TeX/ behavior because it is +hard-coded in \TeX/, unfortunately). \new The Latin Modern 8bit fonts instead Computer Modern 7bit fonts are |