summaryrefslogtreecommitdiff
path: root/macros/luatex/optex/others.opm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/optex/others.opm')
-rw-r--r--macros/luatex/optex/others.opm54
1 files changed, 34 insertions, 20 deletions
diff --git a/macros/luatex/optex/others.opm b/macros/luatex/optex/others.opm
index 6c656ec0e0..dc4956b0a3 100644
--- a/macros/luatex/optex/others.opm
+++ b/macros/luatex/optex/others.opm
@@ -1,12 +1,17 @@
%% This is part of OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \uv {Miscenaleous <2020-03-14>} % preloaded in format
+\_codedecl \uv {Miscenaleous <2020-04-02>} % preloaded in format
-% You can write \useOpTeX at begining of your document
+ \_doc ----------------------------
+ \`\useOpTeX` and \`\useoptex` are declared as `\relax`.
+ \_cod ----------------------------
\_let \useOpTeX = \_relax \_let \useoptex = \_relax
-% lastpage/totalpages
+ \_doc ----------------------------
+ The \`\lastpage` and \`\totalpages` get the information from the
+ \^`\_currpage`. The \^`\_Xpage` from `.ref` file sets the \^`\_currpage`.
+ \_cod ----------------------------
\_def\_totalpages {\_openref\_ea\_lastpageA\_currpage}
\_def\_lastpage {\_openref\_ea\_lastpageB\_currpage}
@@ -15,6 +20,14 @@
\_def\_currpage {{0}{?}}
\_public \lastpage \totalpages ;
+ \_doc ----------------------------
+ We need \`\uv`, \`\clqq`, \`\crqq`, \`\flqq`, \`\frqq`, \`\uslang`, \`\ehyph`
+ \`\chyph`, \`\shyph`, for backward compatibility with \csplain.
+ Codes are set according to Unicode, because we are using Czech only in Unicode
+ when \LuaTeX/ is used.
+ \_cod ----------------------------
+
+
% for compatibility with csplain:
\_chardef\clqq=8222 \_chardef\crqq=8220
@@ -27,32 +40,36 @@
\_let\chyph=\cslang \_let\shyph=\sklang
\_let\csUnicode=\csPatt \_let\czUnicode=\csPatt \_let\skUnicode=\skPatt
-% classical \ten* macros (keeps only preloaded fonts!)
+ \_doc ----------------------------
+ The \`\letfont` was used in \csplain/ instead of `\fontlet`.
+ \_cod ----------------------------
\_let \letfont = \_fontlet
-\_let \tenrm = \_tenrm \_let \tenbf = \_tenbf
-\_let \tenit = \_tenit \_let \tenbi = \_tenbi
-\_let \tentt = \_tentt
-% non breaking space in Unicode
+ \_doc ----------------------------
+ Non breaking space in Unicode.
+ \_cod ----------------------------
\let ^^a0=~
-% TikZ needs these control sequences:
+ \_doc ----------------------------
+ TikZ needs these control sequences.
+ \_cod ----------------------------
\ea\toksdef \csname toks@\endcsname=0
\ea\let \csname voidb@x\endcsname=\_voidbox
-% another \tmpnum and \tmpdim are declared for user macros, no the same as private:
-
-\newcount\tmpnum % auxiliary count
-\newdimen\tmpdim % auxiliary dimen
-
-% We don't want to read opmac.tex unless \input opmac is specified:
+ \_doc ----------------------------
+ We don't want to read `opmac.tex` unless `\input opmac` is specified.
+ \_cod ----------------------------
\def\OPmacversion{OpTeX}
-% Lorem ipsum. Usage \lipsum[3] or \lipsum[112-121], max=150
+ \_doc ----------------------------
+ Lorem ipsum can be printed by \`\lipsum``[<range>]` or \`\lorem``[<range>]`,
+ for example `\lipsum[3]` or `\lipsum[112-121]`, max=150. The data are read
+ from \LaTeX/ file `lipsum.ltd.tex`.
+ \_cod ----------------------------
\_def \_lipsum {%
{\_long\_def\ProvidesFile##1[##2]##3{\_ifx\_par##3\_relax\_else \_ea##3\_fi}\_tmpnum=0
@@ -65,7 +82,7 @@
\_def\_negativermnm{\_romannumeral-`\.}
\_def\_reallipsum[#1]{\_lipsumA #1\_empty-\_empty\_end}
\_def\_lipsumA #1-#2\_empty#3\_end{\_tmpnum=#1 \_edef\_tmp{\_ifx^#2^#1\_else#2\_fi}%
- \_loop \_csname lips:\_the\_tmpnum\_endcsname \_par
+ \_loop \_csname lips:\_the\_tmpnum\_endcsname \par % \par is better here
\_ifnum\_tmpnum<\_tmp \_advance\_tmpnum by1 \_repeat
}
\def\lipsum {\_lipsum}
@@ -73,6 +90,3 @@
\_endcode
-These codes are usable only after Unicode font is loaded using \fontfam.
-If you don't use Unicode fonts then more characters from Czech language stay
-unavailable (ř, ů, for example). See the notice in `fonts-preoad.opm`.