Debian Codegraph @

texmf-dist/tex/optex/base/styles.opm

raw
1 %% This is part of the OpTeX project, see http://petr.olsak.net/optex
2
3 \_codedecl \report {Basic styles of OpTeX <2021-03-10>} % preloaded in format
4
5 \_doc -----------------------------
6 We define auxiliary macro first (used by the \^`\address` macro)
7 \nl
8 The `{`\`\boxlines` `<line-1><eol><line-2><eol>...<line-n><eol>}`
9 returns to the outer vertical mode a box with `<line-1>`, next box with
10 `<line-2>` etc. Each box has its natural width. This is reason why we cannot
11 use paragraph mode where each resulting box has the width `\hsize`.
12 The `<eol>` is set active and `\everypar` starts `\hbox{` and active <eol>
13 closes this `\hbox` by `}`.
14 \_cod -----------------------------
15
16 \_def\_boxlines{%
17 \_def\_boxlinesE{\_ifhmode\_egroup\_empty\_fi}%
18 \_def\_nl{\_boxlinesE}%
19 \_bgroup \_lccode`\~=`\^^M\_lowercase{\_egroup\_let~}\_boxlinesE
20 \_everypar{\_setbox0=\_lastbox\_endgraf
21 \_hbox\_bgroup \_catcode`\^^M=13 \_let\_par=\_nl \_aftergroup\_boxlinesC}%
22 }
23 \_def\_boxlinesC{\_futurelet\_next\_boxlinesD}
24 \_def\_boxlinesD{\_ifx\_next\_empty\_else\_ea\_egroup\_fi}
25
26 \_public \boxlines ;
27
28 \_doc -----------------------------
29 The \`\report` style initialization macro is defined here.
30 \_cod -----------------------------
31
32 \_def\_report{
33 \_typosize[11/13.2]
34 \_vsize=\_dimexpr \_topskip + 52\_baselineskip \_relax % added 2020-03-28
35 \_let\_titfont=\_chapfont
36 \_titskip=3ex
37 \_eoldef\_author##1{\_removelastskip\_bigskip
38 {\_leftskip=0pt plus1fill \_rightskip=\_leftskip \_it \_noindent ##1\_par}\_nobreak\_bigskip
39 }
40 \_public \author ;
41 \_parindent=1.2em \_iindent=\_parindent \_ttindent=\_parindent
42 \_footline={\_global\_footline={\_hss\_rmfixed\_folio\_hss}}
43 }
44
45 \_doc -----------------------------
46 The \`\letter` style initialization macro is defined here.
47
48 The `\letter` defines \`\address` and \`\subject` macros.
49
50 See the files `demo/op-letter-*.tex` for usage examples.
51 \_cod -----------------------------
52
53 \_def\_letter{
54 \_def\_address{\_vtop\_bgroup\_boxlines \_parskip=0pt \_let\_par=\_egroup}
55 \_def\_subject{{\_bf \_mtext{subj}: }}
56 \_public \address \subject ;
57 \_typosize[11/14]
58 \_vsize=\_dimexpr \_topskip + 49\_baselineskip \_relax % added 2020-03-28
59 \_parindent=0pt
60 \_parskip=\_medskipamount
61 \_nopagenumbers
62 }
63 \_public \letter \report ;
64
65 \_doc -----------------------------
66 The \`\slides` macro reads macro file `slides.opm`, see the section~\ref[slides].
67 \_cod -----------------------------
68
69 \_def\_slides{\_par
70 \_opinput{slides.opm}
71 \_adef*{\_relax\_ifmmode*\_else\_ea\_startitem\_fi}
72 }
73 \_public \slides ;
74
75 \_endcode % -------------------------------------
76
77 2021-03-10 \ifmmode* added to \adef*
78 2020-03-28 released