| 1 |
%% This is part of the OpTeX project, see http://petr.olsak.net/optex |
| 2 |
|
| 3 |
\_codedecl \normalbaselineskip {Parameter settings <2026-04-20>} % preloaded in format |
| 4 |
|
| 5 |
\_doc ----------------------------- |
| 6 |
\secc Primitive registers |
| 7 |
The primitive registers with the same default value as in plain \TeX/ follow: |
| 8 |
\_cod ----------------------------- |
| 9 |
|
| 10 |
\_parindent=20pt % indentation of paragraphs |
| 11 |
\_pretolerance=100 % parameters used in paragraph breaking algorithm |
| 12 |
\_tolerance=200 |
| 13 |
\_hbadness=1000 |
| 14 |
\_vbadness=1000 |
| 15 |
\_doublehyphendemerits=10000 |
| 16 |
\_finalhyphendemerits=5000 |
| 17 |
\_adjdemerits=10000 |
| 18 |
\_uchyph=1 |
| 19 |
\_defaulthyphenchar=`\- |
| 20 |
\_defaultskewchar=-1 |
| 21 |
\_hfuzz=0.1pt |
| 22 |
\_vfuzz=0.1pt |
| 23 |
\_overfullrule=5pt |
| 24 |
\_linepenalty=10 % penalty between lines inside the paragraph |
| 25 |
\_hyphenpenalty=50 % when a word is bro-ken |
| 26 |
\_exhyphenpenalty=50 % when the hyphenmark is used explicitly |
| 27 |
\_binoppenalty=700 % between binary operators in math |
| 28 |
\_relpenalty=500 % between relations in math |
| 29 |
\_brokenpenalty=100 % after lines if they end by a broken word. |
| 30 |
\_displaywidowpenalty=50 % before last line of paragraph if display math follows |
| 31 |
\_predisplaypenalty=10000 % above display math |
| 32 |
\_postdisplaypenalty=0 % below display math |
| 33 |
\_delimiterfactor=901 % parameter for scaling delimiters |
| 34 |
\_delimitershortfall=5pt |
| 35 |
\_nulldelimiterspace=1.2pt |
| 36 |
%\_scriptspace=0.5pt % \Umathspaceafterscript used in \_setmathdimens, \_setunimathdimens instead |
| 37 |
\_maxdepth=4pt |
| 38 |
\_splitmaxdepth=\_maxdimen |
| 39 |
\_boxmaxdepth=\_maxdimen |
| 40 |
\_parskip=0pt plus 1pt |
| 41 |
\_abovedisplayskip=12pt plus 3pt minus 9pt |
| 42 |
\_abovedisplayshortskip=0pt plus 3pt |
| 43 |
\_belowdisplayskip=12pt plus 3pt minus 9pt |
| 44 |
\_belowdisplayshortskip=7pt plus 3pt minus 4pt |
| 45 |
\_parfillskip=0pt plus 1fil |
| 46 |
\_thinmuskip=3mu |
| 47 |
\_medmuskip=4mu plus 2mu minus 4mu |
| 48 |
\_thickmuskip=5mu plus 5mu |
| 49 |
|
| 50 |
\_doc ----------------------------- |
| 51 |
Note that `\topskip` and `\splittopskip` are changed when first |
| 52 |
`\typosize` sets the main values (default font size and default |
| 53 |
`\baselineskip`). |
| 54 |
\_cod ----------------------------- |
| 55 |
|
| 56 |
\_topskip=10pt % top edge of page-box to first baseline distance |
| 57 |
\_splittopskip=10pt |
| 58 |
|
| 59 |
\_doc ----------------------------- |
| 60 |
The following four registers were introduced to fix some bugs |
| 61 |
in the \LuaTeX/ engine (see also |
| 62 |
\ulink[https://ctan.gust.org.pl/tex-archive/macros/luatex/latex/luabidi/luabidi.pdf\#section.5] |
| 63 |
{chapter 5 of luabidi documentation}). When `\matheqdirmode` is positive short |
| 64 |
skip detection around display equations will work with right to left |
| 65 |
typesetting. When `\breakafterdirmode` is set to 1 a glue after a dir |
| 66 |
node will not be ignored. When `\mathemptydisplaymode` is set to 1 paragraphs |
| 67 |
before display equation containing only local_par and dir nodes will be discarded |
| 68 |
(other wise dir nodes are considered actual matirial in this case). When `\fixupboxesmode` |
| 69 |
is set to 1 dir nodes will be balanced at the end of hboxes (like in normal groups). |
| 70 |
This is important for unboxing: |
| 71 |
\begtt |
| 72 |
\setbox0\hbox{\textdirection=1 text}\unhbox0 more text |
| 73 |
\endtt |
| 74 |
|
| 75 |
With `\fixupboxesmode` set to 0 you have |
| 76 |
\begtt |
| 77 |
\begindirTRT text more text\enddirTRT |
| 78 |
\endtt |
| 79 |
where the `\enddirTRT` is added from \LuaTeX's par builder. |
| 80 |
While with `\fixupboxesmode` set to 1 you have |
| 81 |
|
| 82 |
\begtt |
| 83 |
\begindirTRT text\enddirTRT more text |
| 84 |
\endtt |
| 85 |
\_cod ----------------------------- |
| 86 |
|
| 87 |
\_ifx\_mathemptydisplaymode\_undefined \_else |
| 88 |
\_matheqdirmode=1 |
| 89 |
\_breakafterdirmode=1 |
| 90 |
\_mathemptydisplaymode=1 |
| 91 |
\_fixupboxesmode=1 |
| 92 |
\_fi |
| 93 |
|
| 94 |
\_doc ---------------------------- |
| 95 |
The `\tracingfonts` register is equivalent to `\pdftracingfonts` from pdf\TeX. |
| 96 |
We set it to 1 in order to enable the full font names in tracing information. |
| 97 |
\_cod ----------------------------- |
| 98 |
|
| 99 |
\_tracingfonts=1 |
| 100 |
|
| 101 |
\_doc ----------------------------- |
| 102 |
\secc Plain \TeX/ registers |
| 103 |
Allocate registers that are used just like in plain \TeX/.\nl |
| 104 |
\`\smallskipamount`, \`\medskipamount`, \`\bigskipamount`, |
| 105 |
\`\normalbaselineskip`, \`\normallineskip`,\nl \`\normallineskiplimit`, |
| 106 |
\`\jot`, \`\interdisplaylinepenalty`, \`\interfootnotelinepenalty`. |
| 107 |
\_cod ----------------------------- |
| 108 |
|
| 109 |
% We also define special registers that function like parameters: |
| 110 |
\_newskip\_smallskipamount \_smallskipamount=3pt plus 1pt minus 1pt |
| 111 |
\_newskip\_medskipamount \_medskipamount=6pt plus 2pt minus 2pt |
| 112 |
\_newskip\_bigskipamount \_bigskipamount=12pt plus 4pt minus 4pt |
| 113 |
\_newskip\_normalbaselineskip \_normalbaselineskip=12pt |
| 114 |
\_newskip\_normallineskip \_normallineskip=1pt |
| 115 |
\_newdimen\_normallineskiplimit \_normallineskiplimit=0pt |
| 116 |
\_newdimen\_jot \_jot=3pt |
| 117 |
\_newcount\_interdisplaylinepenalty \_interdisplaylinepenalty=100 |
| 118 |
\_newcount\_interfootnotelinepenalty \_interfootnotelinepenalty=100 |
| 119 |
|
| 120 |
\_public \smallskipamount \medskipamount \bigskipamount |
| 121 |
\normalbaselineskip \normallineskip \normallineskiplimit |
| 122 |
\jot \interdisplaylinepenalty \interfootnotelinepenalty ; |
| 123 |
|
| 124 |
\_doc ----------------------------- |
| 125 |
Plain \TeX/ macros for setting parameters. |
| 126 |
\`\normalbaselines`, \`\frenchspacing`, \`\nonfrenchspacing`. |
| 127 |
\_cod ----------------------------- |
| 128 |
|
| 129 |
\_def\_normalbaselines{\_lineskip=\_normallineskip |
| 130 |
\_baselineskip=\_normalbaselineskip \_lineskiplimit=\_normallineskiplimit} |
| 131 |
|
| 132 |
\_def\_frenchspacing{\_sfcode`\.=1000 \_sfcode`\?=1000 \_sfcode`\!=1000 |
| 133 |
\_sfcode`\:=1000 \_sfcode`\;=1000 \_sfcode`\,=1000 } |
| 134 |
\_def\_nonfrenchspacing{\_sfcode`\.=3000 \_sfcode`\?=3000 \_sfcode`\!=3000 |
| 135 |
\_sfcode`\:=2000 \_sfcode`\;=1500 \_sfcode`\,=1250 } |
| 136 |
|
| 137 |
\_public \normalbaselines \frenchspacing \nonfrenchspacing ; |
| 138 |
|
| 139 |
\_doc ----------------------------- |
| 140 |
\secc Different settings than in plain \TeX/ |
| 141 |
|
| 142 |
Default \"baseline setting" is for 10\,pt fonts (like in plain \TeX/). |
| 143 |
But `\typosize` and `\typoscale` macros re-declare it if another font size is used. |
| 144 |
|
| 145 |
The \^`\nonfrenchspacing` is not set by default because |
| 146 |
the author of \OpTeX/ is living in Europe. |
| 147 |
If you set `\enlang` hyphenation patterns then \^`\nonfrenchspacing` |
| 148 |
is set. |
| 149 |
\_cod ----------------------------- |
| 150 |
|
| 151 |
\_normalbaselines % baseline setting, 10 pt font size |
| 152 |
|
| 153 |
\_doc ----------------------------- |
| 154 |
The following primitive registers have different values than in plain \TeX/. |
| 155 |
We prohibit orphans, set more information for tracing boxes, set page origin |
| 156 |
to the upper left corner of the paper (no at 1\,in, 1\,in coordinates) |
| 157 |
and set default page dimensions as A4, not letter. |
| 158 |
\_cod ----------------------------- |
| 159 |
|
| 160 |
\_emergencystretch=20pt % we want to use third pass of paragraph building algorithm |
| 161 |
% we don't need compatibility with old documents |
| 162 |
|
| 163 |
\_clubpenalty=10000 % after first line of paragraph |
| 164 |
\_widowpenalty=10000 % before last line of paragraph |
| 165 |
|
| 166 |
\_showboxbreadth=150 % for tracing boxes |
| 167 |
\_showboxdepth=7 |
| 168 |
\_errorcontextlines=15 |
| 169 |
\_tracinglostchars=2 % missing character warnings on terminal too |
| 170 |
|
| 171 |
\_outputmode=1 % PDF output |
| 172 |
\_pdfvorigin=0pt % origin is exactly at upper left corner |
| 173 |
\_pdfhorigin=0pt |
| 174 |
\_hoffset=25mm % margins are 2.5cm, no 1in |
| 175 |
\_voffset=25mm |
| 176 |
\_hsize=160mm % 210mm (from A4 size) - 2*25mm (default margins) |
| 177 |
\_vsize=244mm % 297mm (from A4 size) - 2*25mm (default margins) -3mm baseline correction |
| 178 |
\_pdfpagewidth=210 true mm |
| 179 |
\_pdfpageheight=297 true mm |
| 180 |
|
| 181 |
\_doc ----------------------------- |
| 182 |
If you insist on plain \TeX/ values of these parameters then you can |
| 183 |
call the \`\plaintexsetting` macro. |
| 184 |
\_cod ----------------------------- |
| 185 |
|
| 186 |
\_def\_plaintexsetting{% |
| 187 |
\_emergencystretch=0pt |
| 188 |
\_clubpenalty=150 |
| 189 |
\_widowpenalty=150 |
| 190 |
\_pdfvorigin=1in |
| 191 |
\_pdfhorigin=1in |
| 192 |
\_hoffset=0pt |
| 193 |
\_voffset=0pt |
| 194 |
\_hsize=6.5in |
| 195 |
\_vsize=8.9in |
| 196 |
\_pdfpagewidth=8.5 true in |
| 197 |
\_pdfpageheight=11 true in |
| 198 |
\_nonfrenchspacing |
| 199 |
} |
| 200 |
\_public \plaintexsetting ; |
| 201 |
|
| 202 |
\_doc ----------------------------- |
| 203 |
\secc[oparams] \OpTeX/ parameters |
| 204 |
|
| 205 |
The main principle of how to configure \OpTeX/ is not to use only parameters. |
| 206 |
A designer can copy macros from \OpTeX/ and re-define them as required. |
| 207 |
This is a reason why we don't implement dozens of parameters, |
| 208 |
but we keep \OpTeX/ macros relatively simple. Example: do you want |
| 209 |
another design of section titles? Copy macros `\_printsec` and |
| 210 |
`\_printsecc` from `sections.opm` file to your macro file and re-define them. |
| 211 |
|
| 212 |
Notice for OPmac users: there is an important difference: all "string-like" |
| 213 |
parameters are token lists in \OpTeX/ (OPmac uses macros for them). The reason of |
| 214 |
this difference: if a user sets parameter by unprefixed (public) control sequence, |
| 215 |
an \OpTeX/ macro can read {\em the same data} using a prefixed (private) control sequence. |
| 216 |
|
| 217 |
The \`\picdir` tokens list can include a directory where image files |
| 218 |
(loaded by `\inspic`) are saved. Empty `\picdir` (default value) means |
| 219 |
that image files are in the current directory (or somewhere in the \TeX/ |
| 220 |
system where \LuaTeX/ can find them). If you set a non-empty value to |
| 221 |
the `\picdir`, then it must end by `/` character, for example |
| 222 |
`\picdir={img/}` means that there exists a directory `img` in your |
| 223 |
current directory and the image files are stored here. |
| 224 |
\_cod ----------------------------- |
| 225 |
|
| 226 |
\_newtoks\_picdir |
| 227 |
\_public \picdir ; |
| 228 |
|
| 229 |
\_doc ----------------------------- |
| 230 |
You can control the dimensions of included images by |
| 231 |
the parameters \`\picwidth` (which is equivalent to \`\picw`) and |
| 232 |
\`\picheight` (\`\pich`). By default these parameters are set to zero: the native |
| 233 |
dimension of the image is used. If only `\picwidth` has a nonzero value, |
| 234 |
then this is the width of the image (height is calculated automatically in |
| 235 |
order to respect the aspect of the image). If only `\picheight` has |
| 236 |
a nonzero value then the height is given, the width is calculated. If both |
| 237 |
parameters are non-zero, the height and width are given and the aspect |
| 238 |
ratio of the image is (probably) broken. We recommend setting these |
| 239 |
parameters locally in the group where \^`\inspic` is used in order to not |
| 240 |
influence the dimensions of other images. But there exist many |
| 241 |
situations you need to put the same dimensions to more images, |
| 242 |
so you can set this parameter only once before more \^`\inspic` macros.\nl |
| 243 |
More parameters accepted by `\pdfximage` primitive can be set in the |
| 244 |
\`\picparams` tokens list. For example `\picparams={page3}` |
| 245 |
selects page 3 from included PDF file. |
| 246 |
\_cod ----------------------------- |
| 247 |
|
| 248 |
\_newdimen\_picwidth \_picwidth=0pt \_let\picw=\_picwidth |
| 249 |
\_newdimen\_picheight \_picheight=0pt \_let\pich=\_picheight |
| 250 |
\_newtoks\_picparams |
| 251 |
\_public \picwidth \picheight \picparams ; |
| 252 |
|
| 253 |
\_doc ----------------------------- |
| 254 |
\`\kvdict` is dictionary name when \~`\readkv`, \~`\kvx`, \~`\kv`, and \~`\iskv` are |
| 255 |
processed. The default is empty. |
| 256 |
\_cod ----------------------------- |
| 257 |
|
| 258 |
\_newtoks \_kvdict |
| 259 |
\_public \kvdict ; |
| 260 |
|
| 261 |
\_doc ----------------------------- |
| 262 |
The \`\everytt` is the token list used in |
| 263 |
\^`\begtt`...\^`\endtt` environment and |
| 264 |
in the verbatim group opened by \^`\verbinput` macro. You can include a |
| 265 |
code which is processed inside the group after basic settings were done |
| 266 |
On the other hand, it is processed before the scanner of verbatim text is started. |
| 267 |
Your macros should influence scanner (catcode settings) or printing |
| 268 |
process of the verbatim code or both. |
| 269 |
|
| 270 |
The code from the line immediately after \^`\begtt` is processed after |
| 271 |
the \^`\everytt`. This code should overwrite \^`\everytt` settings. Use |
| 272 |
\^`\everytt` for all verbatim environments in your document and use a code |
| 273 |
after \^`\begtt` locally only for this environment. |
| 274 |
|
| 275 |
The \`\everyintt` token list does similar work |
| 276 |
but acts in the in-line verbatim |
| 277 |
text processed by a pair of \^`\verbchar` characters or by \^`\code``{<text>}`. |
| 278 |
You can set `\everyintt={\Red}` for example if you want in-line verbatim |
| 279 |
in red color. |
| 280 |
\_cod ----------------------------- |
| 281 |
|
| 282 |
\_newtoks\_everytt |
| 283 |
\_newtoks\_everyintt |
| 284 |
\_public \everytt \everyintt ; |
| 285 |
|
| 286 |
\_doc ----------------------------- |
| 287 |
The \`\ttline` is used |
| 288 |
in \^`\begtt`...\^`\endtt` environment or in the code |
| 289 |
printed by \^`\verbinput`. If `\ttline` is positive or zero, then the |
| 290 |
verbatim code has numbered lines from `\ttline+1`. The `\ttline` |
| 291 |
register is re-set to a new value after a code piece is printed, so next |
| 292 |
code pieces have numbered lines continuously. If `\ttline=-1`, then |
| 293 |
\^`\begtt`...\^`\endtt` lines are without numbers and \^`\verbinput` lines |
| 294 |
show the line numbers of inputted file. If `\ttline`\code{<-1} |
| 295 |
then no line numbers are printed. |
| 296 |
\_cod ----------------------------- |
| 297 |
|
| 298 |
\_newcount\_ttline \_ttline=-1 % last line number in \begtt...\endtt |
| 299 |
\_public \ttline ; |
| 300 |
|
| 301 |
\_doc ----------------------------- |
| 302 |
The \`\ttindent` gives default indentation |
| 303 |
of verbatim lines printed by \^`\begtt`...\^`\endtt` pair or by |
| 304 |
\^`\verbinput`. |
| 305 |
\nl |
| 306 |
The \`\ttshift` gives the amount of shift of all verbatim lines to the right. |
| 307 |
Despite the \^`\ttindent`, it does not shift the line numbers, only |
| 308 |
the text. |
| 309 |
\nl |
| 310 |
The \`\iindent` gives default indentations used in the table of contents, |
| 311 |
captions, lists, bib references, |
| 312 |
\nl |
| 313 |
It is strongly recommended to re-set this value if you set `\parindent` |
| 314 |
to another value than plain \TeX/ default 20pt. A well-typeset |
| 315 |
document should have the same dimension for all indentations, so |
| 316 |
you should say `\ttindent=\parindent` and `\iindent=\parindent`. |
| 317 |
\_cod ----------------------------- |
| 318 |
|
| 319 |
\_newdimen\_ttindent \_ttindent=\_parindent % indentation in verbatim |
| 320 |
\_newdimen\_ttshift |
| 321 |
\_newdimen\_iindent \_iindent=\_parindent |
| 322 |
\_public \ttindent \ttshift \iindent ; |
| 323 |
|
| 324 |
\_doc ----------------------------- |
| 325 |
The tabulator `^^I` has its category code like space: it behaves as a |
| 326 |
space in normal text. This is a common plain \TeX/ setting. |
| 327 |
But in the multiline verbatim environment it |
| 328 |
is active and expands to the `\hskip<dimen>` where `<dimen>` |
| 329 |
is the width of \`\tabspaces` spaces. |
| 330 |
Default `\tabspaces=3` means |
| 331 |
that tabulator behaves like three spaces in multiline verbatim. |
| 332 |
\_cod ----------------------------- |
| 333 |
|
| 334 |
\_newcount \_tabspaces \_tabspaces=3 |
| 335 |
\_public \tabspaces ; |
| 336 |
|
| 337 |
\_doc ----------------------------- |
| 338 |
\`\hicolors` can include a list of \~`\hicolor` commands with |
| 339 |
re-declarations of default colors |
| 340 |
mentioned in the `\_hicolors<name>` from `hisyntax-<name>.opm` file. |
| 341 |
The user can give his/her preferences about colors for |
| 342 |
syntax highlighting by this tokens list. |
| 343 |
\_cod ----------------------------- |
| 344 |
|
| 345 |
\_newtoks\_hicolors |
| 346 |
\_public \hicolors ; |
| 347 |
|
| 348 |
\_doc ----------------------------- |
| 349 |
The default item mark used between \^`\begitems` and \^`\enditems` is the bullet. |
| 350 |
The \`\defaultitem` tokens list declares this default item mark. |
| 351 |
\nl |
| 352 |
The \`\everyitem` tokens list is applied in vertical mode |
| 353 |
at the start of each item. |
| 354 |
\nl |
| 355 |
The \`\everylist` tokens list is applied after the group is opened by \^`\begitems` |
| 356 |
\nl |
| 357 |
The \`\ilevel` keeps the value of the current nesting level of the items list. |
| 358 |
\nl |
| 359 |
The \`\olistskipamount` is vertical skip above and below the items list |
| 360 |
if `\ilevel=1`.\nl |
| 361 |
The \`\ilistskipamount` is vertical skip above and below the items list |
| 362 |
if `\ilevel>1`.\nl |
| 363 |
The \`\itemskipamount` is vertical skip between list items, but not above the first |
| 364 |
and below the last. |
| 365 |
\_cod ----------------------------- |
| 366 |
|
| 367 |
\_newtoks\_defaultitem \_defaultitem={$\_bullet$\_enspace} |
| 368 |
\_newtoks\_everyitem |
| 369 |
\_newtoks\_everylist |
| 370 |
\_newcount \_ilevel |
| 371 |
\_newskip\_olistskipamount \_olistskipamount=\_medskipamount |
| 372 |
\_newskip\_ilistskipamount \_ilistskipamount=0pt plus.5\_smallskipamount |
| 373 |
\_newskip\_itemskipamount \_itemskipamount=0pt |
| 374 |
|
| 375 |
\_public \defaultitem \everyitem \everylist \ilevel |
| 376 |
\olistskipamount \ilistskipamount \itemskipamount ; |
| 377 |
\_let \listskipamount = \_olistskipamount % for backward compatibility |
| 378 |
|
| 379 |
\_doc ----------------------------- |
| 380 |
The \^`\tit` macro includes `\vglue`\`\titskip` above the title of the document. |
| 381 |
\_cod ----------------------------- |
| 382 |
|
| 383 |
\_newskip\_titskip \_titskip=40pt \_relax % \vglue above title printed by \tit |
| 384 |
\_public \titskip ; |
| 385 |
|
| 386 |
\_doc ---------------------------- |
| 387 |
The \^`\begmulti` and \^`\endmulti` pair creates more columns. The parameter |
| 388 |
\`\colsep` declares the space between columns. If $n$ columns are specified |
| 389 |
then we have $n-1$ `\colseps` and $n$ columns in total `\hsize`. This |
| 390 |
gives the definite result of the width of the columns. |
| 391 |
\_cod ---------------------------- |
| 392 |
|
| 393 |
\_newdimen\_colsep \_colsep=20pt % space between columns |
| 394 |
\_public \colsep ; |
| 395 |
|
| 396 |
\_doc ----------------------------- |
| 397 |
Each line in the Table of contents is printed in a group. |
| 398 |
The \`\everytocline` tokens list is processed here before |
| 399 |
the internal `\_tocl:<num>` macro which starts printing the line. |
| 400 |
\_cod ----------------------------- |
| 401 |
|
| 402 |
\_newtoks \_everytocline |
| 403 |
\_public \everytocline ; |
| 404 |
|
| 405 |
\_doc ----------------------------- |
| 406 |
The \`\bibtexhook` tokens list is used inside the group when `\usebib` command is |
| 407 |
processed after style file is loaded and before printing bib-entries. |
| 408 |
You can re-define a behavior of the style file here or you can modify the |
| 409 |
more declaration for printing (fonts, baselineskip, etc.) or you can |
| 410 |
define specific macros used in your `.bib` file.\nl |
| 411 |
The \`\biboptions` is used in the `iso690` bib-style for global options, |
| 412 |
see section~\ref[isobib].\nl |
| 413 |
The \`\bibpart` saves the name of bib-list if there are more bib-lists in |
| 414 |
single document, see section~\ref[bib]. |
| 415 |
\_cod ----------------------------- |
| 416 |
|
| 417 |
\_newtoks\_bibtexhook |
| 418 |
\_newtoks\_biboptions |
| 419 |
\_newtoks\_bibpart |
| 420 |
\_public \bibtexhook \biboptions \bibpart ; |
| 421 |
|
| 422 |
\_doc ----------------------------- |
| 423 |
\`\everycapitonf` is used before printing caption in figures and |
| 424 |
\`\everycapitont` is used before printing caption in tables. |
| 425 |
\_cod ----------------------------- |
| 426 |
|
| 427 |
\_newtoks\_everycaptiont \_newtoks\_everycaptionf |
| 428 |
\_public \everycaptiont \everycaptionf ; |
| 429 |
|
| 430 |
\_doc ----------------------------- |
| 431 |
The \`\everyii` tokens list is used before `\noindent` for each |
| 432 |
Index item when printing the Index. |
| 433 |
\_cod ----------------------------- |
| 434 |
|
| 435 |
\_newtoks\_everyii |
| 436 |
\_public \everyii ; |
| 437 |
|
| 438 |
\_doc ----------------------------- |
| 439 |
The \`\everymnote` is used in the \^`\mnote` group before `\noindent` which |
| 440 |
immediately precedes marginal note text. |
| 441 |
\nl |
| 442 |
The \`\mnotesize` is the horizontal size of the marginal notes. |
| 443 |
\nl |
| 444 |
The \`\mnoteindent` is horizontal space between body-text and marginal note. |
| 445 |
\_cod ----------------------------- |
| 446 |
|
| 447 |
\_newtoks\_everymnote |
| 448 |
\_newdimen\_mnotesize \_mnotesize=20mm % the width of the mnote paragraph |
| 449 |
\_newdimen\_mnoteindent \_mnoteindent=10pt % distance between mnote and text |
| 450 |
\_public \everymnote \mnotesize \mnoteindent ; |
| 451 |
|
| 452 |
\_doc ----------------------------- |
| 453 |
The \^`\table` parameters follow. The \`\thistable` tokens list |
| 454 |
register should be used for giving an exception for only one `\table` |
| 455 |
which follows. It should change locally other parameters of the `\table`. |
| 456 |
It is reset to an empty list after the table is printed. |
| 457 |
\nl |
| 458 |
The \`\everytable` tokens list register is applied in every table. |
| 459 |
There is another difference between these two registers. |
| 460 |
The `\thistable` is used first, then strut and baselineskip settings are |
| 461 |
done, then `\everytable` is applied and then the table is printed. |
| 462 |
\nl |
| 463 |
\`\tabstrut` configures the height and depth of lines in the table. |
| 464 |
You can declare `\tabstrut={}`, then normal baselineskip is used in the |
| 465 |
table. This can be used when you don't use horizontal nor vertical |
| 466 |
lines in tables. |
| 467 |
\nl |
| 468 |
\`\tabiteml` is applied before each item, |
| 469 |
\`\tabitemr` is applied after each item of the table. |
| 470 |
\nl |
| 471 |
\`\tablinespace` is additional vertical space between horizontal rules |
| 472 |
and the lines of the table. |
| 473 |
\nl |
| 474 |
\`\hhkern` gives the space between horizontal lines if they are doubled and |
| 475 |
\`\vvkern` gives the space between such vertical lines. |
| 476 |
\nl |
| 477 |
\`\tabskipl` is `\tabskip` used before first column, |
| 478 |
\`\tabskipr` is `\tabskip` used after the last column. |
| 479 |
\nl |
| 480 |
\`\tsize` is virtual unit of the width of paragraph-like table items when |
| 481 |
`\table pxto<size>` is used. |
| 482 |
\_cod ----------------------------- |
| 483 |
|
| 484 |
\_newtoks\_everytable \_newtoks\_thistable |
| 485 |
\_newtoks\_tabiteml \_newtoks\_tabitemr \_newtoks\_tabstrut |
| 486 |
\_newdimen\_tablinespace \_newdimen\_vvkern \_newdimen\_hhkern \_newdimen\_tsize |
| 487 |
\_newskip\_tabskipl \_newskip\_tabskipr |
| 488 |
\_everytable={} % code used after settings in \vbox before table processing |
| 489 |
\_thistable={} % code used when \vbox starts, is is removed after using it |
| 490 |
\_tabstrut={\_strut} |
| 491 |
\_tabiteml={\_enspace} % left material in each column |
| 492 |
\_tabitemr={\_enspace} % right material in each column |
| 493 |
\_tablinespace=2pt % additional vertical space before/after horizontal rules |
| 494 |
\_vvkern=1pt % space between double vertical line and used in \frame |
| 495 |
\_hhkern=1pt % space between double horizontal line and used in \frame |
| 496 |
\_tabskipl=0pt\_relax % \tabskip used before first column |
| 497 |
\_tabskipr=0pt\_relax % \tabskip used after the last column |
| 498 |
\_public \everytable \thistable \tabiteml \tabitemr \tabstrut \tablinespace |
| 499 |
\vvkern \hhkern \tsize \tabskipl \tabskipr ; |
| 500 |
|
| 501 |
\_doc ----------------------------- |
| 502 |
The \^`\eqalign` macro can be configured by \`\eqlines` and \`\eqstyle` |
| 503 |
tokens lists. The default values are set in order these macro behaves |
| 504 |
like in Plain \TeX. The \`\eqspace` is horizontal space put |
| 505 |
between equation systems if more columns in \^`\eqalign` are used. |
| 506 |
\_cod ----------------------------- |
| 507 |
|
| 508 |
\_newtoks \_eqlines \_eqlines={\_openup\_jot} |
| 509 |
\_newtoks \_eqstyle \_eqstyle={\_strut\_displaystyle} |
| 510 |
\_newdimen \_eqspace \_eqspace=20pt |
| 511 |
\_public \eqlines \eqstyle \eqspace ; |
| 512 |
|
| 513 |
\_doc ----------------------------- |
| 514 |
\`\lmfil` is \"left matrix filler" (for `\matrix` columns). The default |
| 515 |
value does centering because the right matrix filler is directly set to `\hfil`. |
| 516 |
\_cod ----------------------------- |
| 517 |
|
| 518 |
\_newtoks \_lmfil \_lmfil={\_hfil} |
| 519 |
\_public \lmfil ; |
| 520 |
|
| 521 |
\_doc ----------------------------- |
| 522 |
The output routine uses token lists \`\headline` and \`\footline` in the |
| 523 |
same sense as plain \TeX/ does. If they are non-empty then `\hfil` or `\hss` |
| 524 |
must be here because they are used inside `\hbox to\hsize`. |
| 525 |
|
| 526 |
Assume that page-body text can be typeset in different sizes and |
| 527 |
different fonts and we don't know in what font context the output routine |
| 528 |
is invoked. So, it is strongly recommended to declare fixed variants of |
| 529 |
fonts at the beginning of your document. For example `\fontdef\rmfixed{\rm}`, |
| 530 |
`\fontdef\itfixed{\it}`. Then use them in headline and footline: |
| 531 |
\begtt |
| 532 |
\headline={\itfixed Text of headline, section: \firstmark \hss} |
| 533 |
\footline={\rmfixed \ifodd\pageno \hfill\fi \folio \hfil} |
| 534 |
\endtt |
| 535 |
\_cod ----------------------------- |
| 536 |
|
| 537 |
\_newtoks\_headline \_headline={} |
| 538 |
\_newtoks\_footline \_footline={\_hss\_rmfixed \_numprint\_folio \_hss} |
| 539 |
\_public \headline \footline ; |
| 540 |
|
| 541 |
\_doc ----------------------------- |
| 542 |
The distance between the `\headline` and the top of the page text |
| 543 |
is controlled by the \`\headlinedist` register. |
| 544 |
The distance between the bottom of |
| 545 |
page-text and `\footline` is \`\footlinedist`. |
| 546 |
More precisely: baseline of |
| 547 |
headline and baseline of the first line in page-text have distance |
| 548 |
`\headlinedist+\topskip`. The baseline of the last line in page-text and |
| 549 |
the baseline of the footline have distance `\footlinedist`. |
| 550 |
Default values are inspired by plain \TeX/. |
| 551 |
\_cod ----------------------------- |
| 552 |
|
| 553 |
\_newdimen \_headlinedist \_headlinedist=14pt |
| 554 |
\_newdimen \_footlinedist \_footlinedist=24pt |
| 555 |
\_public \headlinedist \footlinedist ; |
| 556 |
|
| 557 |
\_doc ----------------------------- |
| 558 |
The \`\pgbottomskip` is inserted to the page bottom |
| 559 |
in the output routine. You can set less tolerance here than |
| 560 |
`\raggedbotom` does. By default, no tolerance is given. |
| 561 |
\_cod ----------------------------- |
| 562 |
|
| 563 |
\_newskip \_pgbottomskip \_pgbottomskip=0pt \_relax |
| 564 |
\_public \pgbottomskip ; |
| 565 |
|
| 566 |
\_doc ----------------------------- |
| 567 |
The \`\nextpages` tokens list can include settings which will be used at |
| 568 |
next pages. It is processed at the end of output routine with |
| 569 |
`\globaldefs=1` prefix. The `\nextpages` is reset to empty after |
| 570 |
processing. Example of usage: |
| 571 |
\begtt |
| 572 |
\headline={} \nexptages={\headline={\rmfixed \firstmark \hfil}} |
| 573 |
\endtt |
| 574 |
This example sets current page with empty headline, but next pages have |
| 575 |
non-empty headlines. |
| 576 |
\_cod ----------------------------- |
| 577 |
|
| 578 |
\_newtoks \_nextpages |
| 579 |
\_public \nextpages ; |
| 580 |
|
| 581 |
\_doc ----------------------------- |
| 582 |
The \`\pgbackground` token list can include macros which generate a |
| 583 |
vertical list. It is used as page background. The top-left corner of such |
| 584 |
`\vbox` is at the top-left corner of the paper. Example creates the |
| 585 |
background of all pages yellow: |
| 586 |
\begtt |
| 587 |
\pgbackground={\Yellow \hrule height 0pt depth\pdfpageheight width\pdfpagewidth} |
| 588 |
\endtt |
| 589 |
\_cod ----------------------------- |
| 590 |
|
| 591 |
\_newtoks \_pgbackground \_pgbackground={} % for page background |
| 592 |
\_public \pgbackground ; |
| 593 |
|
| 594 |
\_doc ----------------------------- |
| 595 |
The parameters used in \^`\inoval` and \^`\incircle` macros |
| 596 |
can be re-set by \`\ovalparams`, \`\circleparams` tokens lists. |
| 597 |
The default values (documented in the user manual) are set in the macros. |
| 598 |
\_cod ----------------------------- |
| 599 |
|
| 600 |
\_newtoks \_ovalparams |
| 601 |
\_newtoks \_circleparams |
| 602 |
%\_ovalparams={\_roundness=2pt \_fcolor=\Yellow \_lcolor=\Red \_lwidth=.5bp |
| 603 |
% \_shadow=N \_overlapmargins=N \_hhkern=0pt \_vvkern=0pt } |
| 604 |
%\_circleparams={\_ratio=1 \_fcolor=\Yellow \_lcolor=\Red \_lwidth=.5bp |
| 605 |
% \_shadow=N \_overlapmargins=N \_hhkern=3pt \_vvkern=3pt} |
| 606 |
|
| 607 |
\_newdimen \_roundness \_roundness=5mm % used in \clippingoval macro |
| 608 |
\_public \ovalparams \circleparams \roundness ; |
| 609 |
|
| 610 |
\_doc ----------------------------- |
| 611 |
\OpTeX/ defines \"Standard \OpTeX/ markup language" |
| 612 |
which lists selected commands from chapter~1 and gives their behavior when a |
| 613 |
converter from \OpTeX/ document to HTML or Markdown or \LaTeX/ is used. |
| 614 |
The structure-oriented commands are selected here, but the commands which |
| 615 |
declare typographical appearance (page layout, dimensions, selected font |
| 616 |
family) are omitted. More information for such a converter should be |
| 617 |
given in \`\cnvinfo``{<data>}`. |
| 618 |
\OpTeX/ simply ignores this but the converter can read its configuration |
| 619 |
from here. For example, a user can write: |
| 620 |
\begtt \catcode`\<=13 |
| 621 |
\cnvinfo {type=html, <cnv-to-html-data>} |
| 622 |
\cnvinfo {type=markdown, <cnv-to-markdown-data>} |
| 623 |
\endtt |
| 624 |
and the document can be processed by \OpTeX/ to create PDF, or by a |
| 625 |
converter to create HTML, or by another converter to create Markdown. |
| 626 |
\_cod ----------------------------- |
| 627 |
|
| 628 |
\_let\cnvinfo=\_ignoreit |
| 629 |
|
| 630 |
\_doc ----------------------------- |
| 631 |
In addition to the \LuaTeX/ primitive registers `\textdirection`, `\bodydirection` |
| 632 |
etc.\ we introduce the register \`\inboxdirection` with the same meaning of |
| 633 |
its four values 0, 1, 2, 3. It affects the texts in internal boxes of |
| 634 |
the macros \^`\mathbox`, \^`\puttext`, \^`\transformbox`, \^`\rotbox`, |
| 635 |
\^`\inoval`, \^`\incircle`. Dirmode~0 is L$\to$R (Latin), |
| 636 |
dirmode~1 (R$\to$L, Hebrew) was tested, see `op-letter-he.tex`. |
| 637 |
Dirmode~2 is T$\to$B, L$\to$R, and Dirmode~3 is T$\to$B, R$\to$L. |
| 638 |
\_cod ----------------------------- |
| 639 |
|
| 640 |
\_newcount\_inboxdirection \_inboxdirection=0 |
| 641 |
\_public \inboxdirection ; |
| 642 |
|
| 643 |
\_endcode %---------------------------------------------------- |
| 644 |
|
| 645 |
The behavior of document processing by \OpTeX/ is |
| 646 |
controlled by {\em parameters}. The parameters are |
| 647 |
\begitems |
| 648 |
* primitive registers used in built-in algorithms of \TeX/, |
| 649 |
* registers declared and used by \OpTeX/ macros. |
| 650 |
\enditems |
| 651 |
Both groups of registers have their type: number, dimension, skip, token |
| 652 |
list. |
| 653 |
|
| 654 |
The registers are represented by their names (control sequences). If the user |
| 655 |
re-defines this control sequence then the appropriate register exists |
| 656 |
steadily and built-in algorithms are using it without change. But user |
| 657 |
cannot access its value in this case. \OpTeX/ declares two control sequences |
| 658 |
for each register: prefixed (private) and unprefixed (public). \OpTeX/ macros use only |
| 659 |
prefixed variants of control sequences. The user should use the unprefixed variant |
| 660 |
with the same meaning and set or read the values of registers using the |
| 661 |
unprefixed variant. If the user re-defines the unprefixed control sequence of |
| 662 |
a register then \OpTeX/ macros still work without change. |
| 663 |
|
| 664 |
%There are only a few parameters declared by \OpTeX/ macros. All of them |
| 665 |
%are listed in this section. This is the desired feature of the \OpTeX/. |
| 666 |
%If you want to do more |
| 667 |
%changes which cannot be controlled by parameters listed here then you |
| 668 |
%can copy the appropriate \OpTeX/ macro to your macro file and you |
| 669 |
%can completely re-define it. The typical examples are `\_printsomething` |
| 670 |
%macros which declare the design of the document. |
| 671 |
|
| 672 |
\_endinput |
| 673 |
|
| 674 |
History: |
| 675 |
2026-04-20 ... \pich is equivalent to \picheight |
| 676 |
2026-04-14 ... \tracingfonts=1 introduced |
| 677 |
2024-04-30 ... \matheqdirmode set only if it is defined (LuaTeX 1.15 and newer). |
| 678 |
2023-09-19 ... \matheqdirmode and \breakafterdirmode set (relevant when RTL typesetting) |
| 679 |
2021-04-13 ... \bibpart added |
| 680 |
2021-04-07 ... \biboptions added, bug from iso690 fixed |
| 681 |
2020-04-04 ... \tabspaces added |
| 682 |
2020-04-03 ... \hicolors added |