summaryrefslogtreecommitdiff
path: root/macros/luatex/optex/styles.opm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-15 03:01:24 +0000
committerNorbert Preining <norbert@preining.info>2020-03-15 03:01:24 +0000
commit87cddce361c3b477029d13b27bdaa57190b2d74b (patch)
tree0b8f15ef416645c1438cdc4228a1ddb44691b17c /macros/luatex/optex/styles.opm
parent942e56ba7d147d18d379305e76f064cec0aade7d (diff)
CTAN sync 202003150301
Diffstat (limited to 'macros/luatex/optex/styles.opm')
-rw-r--r--macros/luatex/optex/styles.opm98
1 files changed, 98 insertions, 0 deletions
diff --git a/macros/luatex/optex/styles.opm b/macros/luatex/optex/styles.opm
new file mode 100644
index 0000000000..66414f85ff
--- /dev/null
+++ b/macros/luatex/optex/styles.opm
@@ -0,0 +1,98 @@
+%% This is part of OpTeX project, see http://petr.olsak.net/optex
+
+\_codedecl \report {Basic styles of OpTeX <2020-03-12>}
+
+ \_doc -----------------------------
+ The `{\boxlines <line-1><eol><line-2><eol>...<line-n><eol>}`
+ returns to the outer vertical mode a box with <line-1>, next box with
+ <line-2> etc. Each box has its natural width. This is reaon why we cannot
+ use paragraph mode where each resulting box has the width `\hsize`.
+ The <eol> is set active and `\everypar` starts `\hbox{` and acive <eol>
+ closes this `\hbox` by `}`.
+ \_cod -----------------------------
+
+\_def\_boxlines{%
+ \_def\_boxlinesE{\_ifhmode\_egroup\_empty\_fi}%
+ \_def\_nl{\_boxlinesE}%
+ \_bgroup \_lccode`\~=`\^^M\_lowercase{\_egroup\_let~}\_boxlinesE
+ \_everypar{\_setbox0=\_lastbox\_endgraf
+ \_hbox\_bgroup \_catcode`\^^M=13 \_let\par=\_nl \_aftergroup\_boxlinesC}%
+}
+\_def\_boxlinesC{\_futurelet\_next\_boxlinesD}
+\_def\_boxlinesD{\_ifx\_next\_empty\_else\_ea\_egroup\_fi}
+
+ \_doc -----------------------------
+ The `\report` and `\letter` style initialization macos are defined here.
+ Their behavior is documented in user part of the manual in the section \ref[styles].
+ \_cod -----------------------------
+
+\_def\_report{
+ \_typosize[11/13.2]
+ \_let\_titfont=\_chapfont
+ \_titskip=3ex
+ \_eoldef\_author##1{\_removelastskip\_bigskip
+ {\_leftskip=0pt plus1fill \_rightskip=\_leftskip \_it \_noindent ##1\_par}\_nobreak\_bigskip
+ }
+ \_public \author ;
+ \_parindent=1.2em \_iindent=\_parindent \_ttindent=\_parindent
+ \_footline={\_global\_footline={\_hss\_rmfixed\_folio\_hss}}
+}
+\_def\_letter{
+ \_def\_address{\_vtop\_bgroup\_boxlines \_parskip=0pt \_let\par=\_egroup}
+ \_def\_subject{{\_bf \_mtext{subj}: }}
+ \_public \address \subject ;
+ \_typosize[11/14]
+ \_parindent=0pt
+ \_parskip=\_medskipamount
+ \_nopagenumbers
+}
+\_public \boxlines \letter \report ;
+
+\_endcode % -------------------------------------
+
+The example of `\letter` style document follows:
+
+\begtt %-----------------------------------------------------------------
+
+\letter
+\fontfam[bonum]
+\chyph
+
+\address
+ Vážený pan
+ Mgr. Bořek Byrokrat
+ ředitel Ústavu pro další možnosti
+ Úřední 789
+ 123 45 Praha 1
+
+\hfill V Praze dne \today
+
+\subject Žádost o možnost další možnosti
+
+Vážený pane řediteli
+
+na základě Vašeho dopisu č.j.~123456/78-dat a elektronické výzvy si dovoluji
+Vás požádat o prozkoumání mé možnosti další možnosti.
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
+eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
+veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
+commodo consequat.
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
+eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
+veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
+commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
+esse cillum dolore eu fugiat nulla pariatur.
+
+S úctou
+
+\hfill \address
+ {\it Petr Olšák}
+ specialista na \TeX{}
+ Ulice 12345
+ Praha 13
+
+\bye
+
+\endtt %---------------------------------------------------------------------
+