%% Polish lang-style file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Mar. 2004                           Petr Olsak

\def\langdeflist {pl}

\langdef \langinfo {Polish language}

\langdef \langinit {%
   \langmessage{frenchspacing on}\frenchspacing
   \afterlang{\langmessage{frenchspacing off}\nonfrenchspacing}%
}
\langdef \activechar #1{%
   \if\string#1/\langmessage 
      {Character / is activated as expandable double-char prefix.}%
      \activedef /{\expdoublechar/}\else
   \if\string#1"\langmessage 
      {Character " is activated as expandable double-char prefix.}%
      \activedef "{\expdoublechar"}\else
   \activecharwarn#1 \fi\fi
}
\langdef \langphrases {%
   \def\refname{Cytowana literatura}%
   \def\abstractname{Streszczenie}%
   \def\bibname{Bibliografia}%
   \def\chaptername{Rozdzia\lslash}%
   \def\appendixname{Dodatek}%
   \def\contentsname{Spis tre\'sci}%
   \def\listfigurename{Wykaz ilustracji}%
   \def\listtablename{Wykaz tablic}%
   \def\indexname{Skorowidz}%
   \def\figurename{Rysunek}%
   \def\tablename{Tablica}%
   \def\partname{Cz\k e\'s\'c}%
   \def\enclname{Za\lslash.}%
   \def\ccname{Do wiadomo\'sci}%
   \def\headtoname{Do}%
   \def\pagename{Strona}%
   \def\seename{patrz}%
}
\langdef \today {\number\day~\ifcase\month\or
  stycznia\or lutego\or marca\or kwietnia\or maja\or czerwca\or
  lipca\or sierpnia\or wrze\'snia\or pa\'zdziernika\or
  listopada\or grudnia\fi~\number\year~r.}

% from MeX:

\doublechardef /\mathchar{/}
\doublechardef /A{\k A}
\doublechardef /C{\'C}
\doublechardef /E{\k E}
\doublechardef /L{\Lslash}
\doublechardef /N{\'N}
\doublechardef /O{\'O}
\doublechardef /S{\'S}
\doublechardef /X{\'Z}
\doublechardef /Z{\.Z}
\doublechardef /a{\k a}
\doublechardef /c{\'c}
\doublechardef /e{\k e}
\doublechardef /l{\lslash}
\doublechardef /n{\'n}
\doublechardef /o{\'o}
\doublechardef /s{\'s}
\doublechardef /x{\'z}
\doublechardef /z{\.z}
\doublechardef /#1{\pl@error{#1}}

\def\pl@error
    #1% illegal argument
    {\begingroup
    \newlinechar=`\*%
    \errorcontextlines=0 %
    \errhelp={%
    Only the characters:  aeclnosxzAECLNOSXYZ/  can appear after / .*%
    % (We do not mention the possibility of writing /\pslash)
    Proceed, I'll omit both / and the following character.*%
    You can also correct your mistake by typing now `I' followed by*%
    whatever should be in place of the incorrect pair of characters.*%
    For example if you typed `/w' and you meant `w', type `Iw' now.}%
    \errmessage{%
    MeX error: Illegal pair of characters%
    \space\space/\string#1\space\space occured}%
    \endgroup
}
\langdef \plqq {\printcharacter{clqq}} 
\langdef \prqq {\printcharacter{crqq}} 
\langdef \normalslash {/}

% From Babel:

\doublechardef "a{\textormath{\k a}{\ddot a}}
\doublechardef "A{\textormath{\k A}{\ddot A}}
\doublechardef "c{\textormath{\'c}{\acute c}}
\doublechardef "C{\textormath{\'C}{\acute C}}
\doublechardef "e{\textormath{\k e}{\ddot e}}
\doublechardef "E{\textormath{\k E}{\ddot E}}
\doublechardef "l{\textormath{\lslash}{\ddot l}}
\doublechardef "L{\textormath{\Lslash}{\ddot L}}
\doublechardef "n{\textormath{\'n}{\acute n}}
\doublechardef "N{\textormath{\'N}{\acute N}}
\doublechardef "o{\textormath{\'o}{\acute o}}
\doublechardef "O{\textormath{\'O}{\acute O}}
\doublechardef "s{\textormath{\'s}{\acute s}}
\doublechardef "S{\textormath{\'S}{\acute S}}
\doublechardef "r{\textormath{\.z}{\ddot r}}%
\doublechardef "R{\textormath{\.Z}{\ddot R}}%
\doublechardef "z{\textormath{\'z}{\acute z}}%
\doublechardef "Z{\textormath{\'Z}{\acute Z}}%
\doublechardef "x{"x}%
\doublechardef "X{"X}%

\langdef \polishrz {%
  \doublechardef (pl) "r{\textormath{\.z}{\ddot r}}%
  \doublechardef (pl) "R{\textormath{\.Z}{\ddot R}}%
  \doublechardef (pl) "z{\textormath{\'z}{\acute z}}%
  \doublechardef (pl) "Z{\textormath{\'Z}{\acute Z}}%
  \doublechardef (pl) "x{"x}%
  \doublechardef (pl) "X{"X}%
}
\langdef \polishzx {%
  \doublechardef (pl) "z{\textormath{\.z}{\ddot z}}%
  \doublechardef (pl) "Z{\textormath{\.Z}{\ddot R}}%
  \doublechardef (pl) "x{\textormath{\'z}{\acute x}}%
  \doublechardef (pl) "X{\textormath{\'Z}{\acute X}}%
  \doublechardef (pl) "r{"r}%
  \doublechardef (pl) "R{"R}%
}

\doublechardef "`{\clqq}
\doublechardef "'{\crqq}
\doublechardef "<{\flqq}
\doublechardef ">{\frqq}
\doublechardef "-{\nobreak-\allowhyphens}
\doublechardef ""{\hskip\z@skip}
\doublechardef "|{%
  \textormath{\discretionary{-}{}{\kern.03em}}{}}

\endinput

\langdocbegin

\title Polish language: pl

\author Petr Ol\v s\'ak

Inspired by: "mex.tex" (by Marek Ry\'cko \& Bogus\lslash{}aw Jackowski).

Inspired by: "polish.ldf" from Babel
(by Johannes Braams, Elmar Schalueck, Michael Janich).

The "\langinit" initializes "\frenchspacing" only.

There are no dialects in "pl" language.

You can choose active character: "\activechar/" or "\activechar!"".
The first one sets the behavior similar to MeX (polish \TeX{} format).
and second initializes shothands from Babel.

MeX's shorthands (activated after "\activechar/") are:
"/A"\to \k A,
"/C"\to \'C,
"/E"\to \k E,
"/L"\to \Lslash,
"/N"\to \'N,
"/O"\to \'O,
"/S"\to \'S,
"/X"\to \'Z,
"/Z"\to \.Z,
"/a"\to \k a,
"/c"\to \'c,
"/e"\to \k e,
"/l"\to \lslash,
"/n"\to \'n,
"/o"\to \'o,
"/s"\to \'s,
"/x"\to \'z,
"/z"\to \.z.

Babel's shorhands (activated after "\activechar!"") are:
"!"a"\to \k a,
"!"A"\to \k A,
"!"c"\to \'c,
"!"C"\to \'C,
"!"e"\to \k e,
"!"E"\to \k E,
"!"l"\to \lslash,
"!"L"\to \Lslash,
"!"n"\to \'n,
"!"N"\to \'N,
"!"o"\to \'o,
"!"O"\to \'O,
"!"s"\to \'s,
"!"S"\to \'S,
"!"r"\to \.z,
"!"R"\to \.Z,
"!"z"\to \'z,
"!"Z"\to \'Z,
"!"x"\to \char`"x,
"!"X"\to \char`"X,
"!"`"\to \clqq,
"!"'"\to \crqq,
"!"!<"\to \flqq,
"!">"\to \frqq.
The "!"-" works like "\-" but allows hyphenation before and after this
sequence. "!"!"" is equivalent to "\hskip0pt" and "!"|" can be used to
avoid ligatures (typically in word joints).

The six shorthands have variant definition if you use "\polishzx":
"!"z"\to \.z,
"!"Z"\to \.Z,
"!"x"\to \'z,
"!"X"\to \'Z,
"!"r"\to \char`"r,
"!"R"\to \char`"R.
The command "\polishrz" returns these definitions back to the implicit
meaing.

\endinput



