summaryrefslogtreecommitdiff
path: root/macros/generic/encxvlna/plain/encxvlna.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/generic/encxvlna/plain/encxvlna.tex
Initial commit
Diffstat (limited to 'macros/generic/encxvlna/plain/encxvlna.tex')
-rw-r--r--macros/generic/encxvlna/plain/encxvlna.tex71
1 files changed, 71 insertions, 0 deletions
diff --git a/macros/generic/encxvlna/plain/encxvlna.tex b/macros/generic/encxvlna/plain/encxvlna.tex
new file mode 100644
index 0000000000..bc1ec19e17
--- /dev/null
+++ b/macros/generic/encxvlna/plain/encxvlna.tex
@@ -0,0 +1,71 @@
+% Vlna implementovana jako makra v encTeXu
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Leden 2003 Petr Olsak
+
+% The following test and error message was
+% inserted by Z. Wagner
+\expandafter\ifx\csname mubyte\endcsname\relax
+ {\newlinechar=`\^^J\errhelp=
+ {This package is implemented by new primitives of encTeX of Feb 2003^^J
+ but this extension was not detected in your system. You can continue^^J
+ but all commands of `encxvlna' will be ignored. If your TeX distribution^^J
+ contains encTeX but does not activate it, you have to create the format^^J
+ using the -enc switch (e.g. in fmtutils.cnf). If you do not have encTeX^^J
+ at all, you have to compile it from the source code. You can find^^J
+ the source code including documentation at^^J
+ http://math.feld.cvut.cz/olsak/enctex.html
+ }%
+ \errmessage
+ {encTeX of Feb 2003 or later not detected,^^Jthe rest of the package will be ignored}}%
+ \expandafter\endinput\fi
+
+% Toto je ukazka moznosti encTeXu. Na urovni maker muzeme
+% naprogramovat program vlna.
+
+% Pomocna makra:
+
+\def\setmu #1#2{\mubyte #1##1 #2\endmubyte} % use encTeX Feb 2003
+\bgroup \uccode`X=\endlinechar \uppercase{\gdef\endchar{X}}
+ \uccode`X=`\{ \uppercase{\gdef\leftbrace{X}}
+\egroup
+
+\def\sylabi #1{%
+ \setmu \spacesylab {\space#1} % <mezera>v lese -> <mezera>v~lese
+ \setmu \normalsylab {(#1} % (v lese -> (v~lese
+ \setmu \normalsylab {\endchar#1} % <zacatek radku>v lese -> v~lese
+ \setmu \normalsylab {[#1} % [v lese -> [v~lese
+ \setmu \specsylab {\leftbrace#1} % {v lese -> {v~lese
+}
+% dve moznosti za predlozkou: mezera nebo konec radku:
+
+\def\sylab #1{\sylabi {#1\space}\sylabi {#1\endchar}}
+
+% seznam predlozek:
+
+\sylab v \sylab k \sylab o \sylab s \sylab u \sylab z
+\sylab V \sylab K \sylab O \sylab S \sylab U \sylab Z
+\sylab A \sylab I \sylab i \sylab a
+
+% makra neudelaji nic v matematickem modu a verbatim prostredi:
+
+\def\exx{\expandafter\expandafter\expandafter}
+\def\spacesylab {\ifmmode\else\ifnum\catcode`\ =10 \exx\spacesylabP \fi\fi}
+\def\normalsylab {\ifmmode\else\ifnum\catcode`\ =10 \exx\normalsylabP \fi\fi}
+\def\specsylab {\ifmmode\else\ifnum\catcode`\ =10 \exx\specsylabP \fi\fi}
+
+\def\spacesylabP {\afterassignment\spacesylabR \let\next= }
+\def\spacesylabR {\ifhmode\unskip\fi \next \normalsylabP}
+\def\normalsylabP #1 {#1~}
+\def\specsylabP #1{{\normalsylabP #1}}
+
+\def\uv{\futurelet\next\uvR}
+\def\uvR{\ifx \next\specsylab \expandafter \uvS \else \expandafter \uvP \fi}
+\long\def\uvP #1{\clqq#1\crqq}
+\long\def\uvS \specsylab #1{\normalsylab \clqq#1\crqq}
+
+\mubytein=2 % potrebujeme i konstrukce "a v lese -> a~v~lese"
+
+\endinput
+
+
+