%% Czech + Slovak lang-style file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Mar. 2004                           Petr Olsak

%% This file is a common part of lang-cz.tex and lang-sk.tex

\def\langdeflist {cz sk}  

\langdef \langinit {%
   \langmessage{frenchspacing on}\frenchspacing
   \afterlang{\langmessage{frenchspacing off}\nonfrenchspacing}%
}
\langdef \activechar #1{%
   \if\string#1"\langmessage 
      {Character " is activated as \string\clqq...\string\crqq.}%
      \activedef "{\bgroup\maybeactive\def"{\crqq\egroup}\clqq}\else
   \if\string#1-\langmessage
      {Character - is activated as hyphen-split character.}%
      \def\minus{-}%
      \activedef -{\ssdoublechar-}\else
   \if\string#1`\langmessage
      {Character ` is activated as \string\clqq\space or \string\clq.}%
      \activedef `{\ssdoublechar`}\else
   \if\string#1'\langmessage
      {Character ' is activated as \string\crqq\space or \string\crq.}%
      \cz@redefpr@m@s
      \activedef '{\ssdoublechar'}\else
   \activecharwarn#1\fi\fi\fi\fi
}

%%% double chars:

\doublechardef -\mathchar{-}
\doublechardef --{\futurelet\tmpa\cz@tryemdash}
\doublechardef -#1{\discretionary{-}{-}{-}#1}

\doublechardef `\mathchar{`}
\doublechardef ``{\clqq}
\doublechardef `#1{\clq#1}

\doublechardef '\mathchar{^\bgroup\prim@s}
\doublechardef ''{\crqq}
\doublechardef '#1{\crq#1}

\def\cz@tryemdash {\maybeactive\ifx-\tmpa \hbox{---}%
   \expandafter \let\expandafter\tmpa
   \else \hbox{--}\fi}

\def\cz@redefpr@m@s {%
   \def\pr@m@s{\maybeactive\ifx'\next % may be ' is active
      \let\nxt\pr@@@s \else\ifx^\next\let\nxt\pr@@@t
      \else\let\nxt\egroup\fi\fi \nxt}%
   \doublechardef (*) '\mathchar{^\bgroup\prim@s}%
}

%%% quotes:

\let\langdefprefix=\long \langdef \doubleuv #1{\clqq#1\crqq}
\let\langdefprefix=\long \langdef \singleuv #1{\clq#1\crq}
\let\langdefprefix=\long \langdef \doublefuv #1{\frqq#1\flqq}

\langdef \verbuv {%
   \bgroup\aftergroup\crqq
   \afterassignment\clqq\let\next=}

\ifx\uv\undefined    \let\uv=\doubleuv    \fi
\ifx\fuv\undefined   \let\fuv=\doublefuv  \fi

\let\langdefprefix=\long \langdef \uvinuv #1{%
   \bgroup \let\uv=\singleuv \clqq#1\crqq\egroup}

%%% backward compatibility:

\langdef \cstieon {\def~{\ifmmode\else\penalty\@M\ \fi}}
\langdef \cstieoff {\def~{\penalty\@M \ }}

\endinput

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\langdocbegin

The "\langinit" initialises "\frenchspacing" only.

No dialects are declared here.

You can choose from four active characters:

\begitems
* "\activechar!"" --- If you write 
   {\tt \char`\"text in quotes\char`\"} then you get 
   \clqq text in quotes\crqq. Internal kerning 
   with quote characters
   is enabled, but external kerning is disabled 
   by this macro.

* "\activechar-" --- The word "propan-butan" 
   will be hyphenated as propan-/-butan.
   You can use the "\minus" macro which expands to the normal
   ``minus'' character. Example:~"\looseness=\minus1".

* "\activechar`" and "\activechar'" --- If you write
   "``text in quotes''" then you get \clqq text in quotes\crqq.
   If you write "`text in single quotes'" then you get 
   \clq text in single quotes\crq. Warning: be carefull when using
   this feature: "\activechar'" redefines internal plain\TeX{}
   macros for prime character. Moreover the left kernings with 
   quote characters are disabled.
\enditems

There are three quote commands with full left+right kernings:

\begitems
* "\doubleuv{text}"\to \clqq text\crqq,
* "\singleuv{text}"\to \clq text\crq,
* "\doublefuv{text}"\to \frqq text\flqq,
\enditems

The main quote macro "\uv" is defined as "\doubleuv" only if this
macro is not defined already. The macro "\fuv" is defined as
"\doublefuv".

You can say "\let\uv=\uvinuv" after this style file is read. Then
the qoutes in qoutes:

\begtt
\uv{outer \uv{inner} text}
\endtt
behave
differently: outer quotes behave as "\doubleuv" and inner quotes as 
"\singleuv".

You can use "\verbuv" or say "\let\uv=\verbuv" if the quoted text
includes category code changes. The previous macros don't work in such
case because the quoted text is scanned to "#1" macro parameter.
The "\verbuv" uses trick with "\aftergroup" and the quoted text is
read directly by main processor. You can use this version to 
quote some verbatim parts of text (your verbatim macro changes 
category codes of course). The "\verbuv" macro works similar as 
implicit definition of "\uv" from "csplain". Left kerning of left 
and right quote character is disabled, unfortunately.

For backward compatibility, there are two commands: "\cstieon" which
defines the tie "~" more elaborate: in math mode is this macro
ignored. The "\cstieoff" returns tie behavior to the plain\TeX{}
meaning. The reason: there are used old non-intelligent preprocessors for
Czech/Slovak texts. They add tie characters not only after czech non-syllabe 
prepositions but also in math mode after variables. The occurrence of
tie in math mode is unwanted so, macro "\cstieon" solves this problem.

\endinput









