| 1 |
% Vlna implementovana jako makra v encTeXu |
| 2 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 3 |
% Leden 2003 Petr Olsak |
| 4 |
|
| 5 |
% The following test and error message was |
| 6 |
% inserted by Z. Wagner |
| 7 |
\expandafter\ifx\csname mubyte\endcsname\relax |
| 8 |
{\newlinechar=`\^^J\errhelp= |
| 9 |
{This package is implemented by new primitives of encTeX of Feb 2003^^J |
| 10 |
but this extension was not detected in your system. You can continue^^J |
| 11 |
but all commands of `encxvlna' will be ignored. If your TeX distribution^^J |
| 12 |
contains encTeX but does not activate it, you have to create the format^^J |
| 13 |
using the -enc switch (e.g. in fmtutils.cnf). If you do not have encTeX^^J |
| 14 |
at all, you have to compile it from the source code. You can find^^J |
| 15 |
the source code including documentation at^^J |
| 16 |
http://math.feld.cvut.cz/olsak/enctex.html |
| 17 |
}% |
| 18 |
\errmessage |
| 19 |
{encTeX of Feb 2003 or later not detected,^^Jthe rest of the package will be ignored}}% |
| 20 |
\expandafter\endinput\fi |
| 21 |
|
| 22 |
% Toto je ukazka moznosti encTeXu. Na urovni maker muzeme |
| 23 |
% naprogramovat program vlna. |
| 24 |
|
| 25 |
% Pomocna makra: |
| 26 |
|
| 27 |
\def\setmu #1#2{\mubyte #1##1 #2\endmubyte} % use encTeX Feb 2003 |
| 28 |
\bgroup \uccode`X=\endlinechar \uppercase{\gdef\endchar{X}} |
| 29 |
\uccode`X=`\{ \uppercase{\gdef\leftbrace{X}} |
| 30 |
\egroup |
| 31 |
|
| 32 |
\def\sylabi #1{% |
| 33 |
\setmu \spacesylab {\space#1} % <mezera>v lese -> <mezera>v~lese |
| 34 |
\setmu \normalsylab {(#1} % (v lese -> (v~lese |
| 35 |
\setmu \normalsylab {\endchar#1} % <zacatek radku>v lese -> v~lese |
| 36 |
\setmu \normalsylab {[#1} % [v lese -> [v~lese |
| 37 |
\setmu \specsylab {\leftbrace#1} % {v lese -> {v~lese |
| 38 |
} |
| 39 |
% dve moznosti za predlozkou: mezera nebo konec radku: |
| 40 |
|
| 41 |
\def\sylab #1{\sylabi {#1\space}\sylabi {#1\endchar}} |
| 42 |
|
| 43 |
% seznam predlozek: |
| 44 |
|
| 45 |
\sylab v \sylab k \sylab o \sylab s \sylab u \sylab z |
| 46 |
\sylab V \sylab K \sylab O \sylab S \sylab U \sylab Z |
| 47 |
\sylab A \sylab I \sylab i \sylab a |
| 48 |
|
| 49 |
% makra neudelaji nic v matematickem modu a verbatim prostredi: |
| 50 |
|
| 51 |
\def\exx{\expandafter\expandafter\expandafter} |
| 52 |
\def\spacesylab {\ifmmode\else\ifnum\catcode`\ =10 \exx\spacesylabP \fi\fi} |
| 53 |
\def\normalsylab {\ifmmode\else\ifnum\catcode`\ =10 \exx\normalsylabP \fi\fi} |
| 54 |
\def\specsylab {\ifmmode\else\ifnum\catcode`\ =10 \exx\specsylabP \fi\fi} |
| 55 |
|
| 56 |
\def\spacesylabP {\afterassignment\spacesylabR \let\next= } |
| 57 |
\def\spacesylabR {\ifhmode\unskip\fi \next \normalsylabP} |
| 58 |
\def\normalsylabP #1 {#1~} |
| 59 |
\def\specsylabP #1{{\normalsylabP #1}} |
| 60 |
|
| 61 |
\def\uv{\futurelet\next\uvR} |
| 62 |
\def\uvR{\ifx \next\specsylab \expandafter \uvS \else \expandafter \uvP \fi} |
| 63 |
\long\def\uvP #1{\clqq#1\crqq} |
| 64 |
\long\def\uvS \specsylab #1{\normalsylab \clqq#1\crqq} |
| 65 |
|
| 66 |
\mubytein=2 % potrebujeme i konstrukce "a v lese -> a~v~lese" |
| 67 |
|
| 68 |
\endinput |
| 69 |
|
| 70 |
|
| 71 |
|