1 % \iffalse meta-comment
3 % Copyright 1989-2005 Johannes L. Braams and any individual authors
4 % listed elsewhere in this file. All rights reserved.
6 % This file is part of the Babel system.
7 % --------------------------------------
9 % It may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of LaTeX
15 % version 2003/12/01 or later.
17 % This work has the LPPL maintenance status "maintained".
19 % The Current Maintainer of this work is Johannes Braams.
21 % The list of all files belonging to the Babel system is
22 % given in the file `manifest.bbl. See also `legal.bbl' for additional
25 % The list of derived (unpacked) files belonging to the distribution
26 % and covered by LPPL is defined by the unpacking scripts (with
27 % extension .ins) which are part of the distribution.
32 % Tell the \LaTeX\ system who we are and write an entry on the
35 \ProvidesFile{polish.dtx}
37 %<code>\ProvidesLanguage{polish}
39 %\ProvidesFile{polish.dtx}
40 [2005/03/31 v1.2l Polish support from the babel system]
43 %% Babel package for LaTeX version 2e
44 %% Copyright (C) 1989 -- 2005
45 %% by Johannes Braams, TeXniek
47 %% Polish Language Definition File
48 %% Copyright (C) 1989 - 2005
49 %% by Elmar Schalueck, Michael Janich
50 % Universitaet-Gesamthochschule Paderborn
51 % Warburger Strasse 100
54 % elmar at uni-paderborn.de
55 % massa at uni-paderborn.de
57 %% Please report errors to: J.L. Braams
58 %% babel at braams.cistron.nl
60 % This file is part of the babel system, it provides the source
61 % code for the Polish language definition file. It was developped
62 % out of Polish.tex, which was written by Elmar Schalueck and
63 % Michael Janich. Polish.tex was based on code by Leszek
64 % Holenderski, Jerzy Ryll and J. S. Bie\'n from Faculty of
65 % Mathematics,Informatics and Mechanics of Warsaw University, exept
66 % of Jerzy Ryll (Instytut Informatyki Uniwersytetu Warszawskiego).
68 \documentclass{ltxdoc}
69 \newcommand*\TeXhax{\TeX hax}
70 \newcommand*\babel{\textsf{babel}}
71 \newcommand*\langvar{$\langle \it lang \rangle$}
72 \newcommand*\note[1]{}
73 \newcommand*\Lopt[1]{\textsf{#1}}
74 \newcommand*\file[1]{\texttt{#1}}
80 % \GetFileInfo{polish.dtx}
82 % \changes{polish-1.1c}{1994/06/26}{Removed the use of \cs{filedate}
83 % and moved identification after the loading of babel.def}
84 % \changes{polish-1.2d}{1996/10/10}{Replaced \cs{undefined} with
85 % \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
86 % with \LaTeX, moved the definition of \cs{atcatcode} right to the
89 % \section{The Polish language}
91 % The file \file{\filename}\footnote{The file described in this
92 % section has version number \fileversion\ and was last revised on
93 % \filedate.} defines all the language-specific macros for the
96 % For this language the character |"| is made active. In
97 % table~\ref{tab:polish-quote} an overview is given of its purpose.
100 % \begin{tabular}{lp{8cm}}
101 % |"a| & or |\aob|, for tailed-a (like \c{a})\\
102 % |"A| & or |\Aob|, for tailed-A (like \c{A})\\
103 % |"e| & or |\eob|, for tailed-e (like \c{e})\\
104 % |"E| & or |\Eob|, for tailed-E (like \c{E})\\
105 % |"c| & or |\'c|, for accented c (like \'c),
106 % same with uppercase letters and n,o,s\\
107 % |"l| & or |\lpb{}|, for l with stroke (like \l)\\
108 % |"L| & or |\Lpb{}|, for L with stroke (like \L)\\
109 % |"r| & or |\zkb{}|, for pointed z (like \.z), cf.
111 % |"R| & or |\Zkb{}|, for pointed Z (like \.Z)\\
112 % |"z| & or |\'z|, for accented z\\
113 % |"Z| & or |\'Z|, for accented Z\\
114 % \verb="|= & disable ligature at this position.\\
115 % |"-| & an explicit hyphen sign, allowing hyphenation
116 % in the rest of the word.\\
117 % |""| & like |"-|, but producing no hyphen sign
118 % (for compund words with hyphen, e.g.\ |x-""y|). \\
119 % |"`| & for German left double quotes (looks like ,,). \\
120 % |"'| & for German right double quotes. \\
121 % |"<| & for French left double quotes (similar to $<<$). \\
122 % |">| & for French right double quotes (similar to $>>$).\\
124 % \caption{The extra definitions made by \file{polish.sty}}
125 % \label{tab:polish-quote}
131 % The macro |\LdfInit| takes care of preventing that this file is
132 % loaded more than once, checking the category code of the
133 % \texttt{@} sign, etc.
134 % \changes{polish-1.2d}{1996/11/03}{Now use \cs{LdfInit} to perform
138 \LdfInit{polish}\captionspolish
141 % When this file is read as an option, i.e. by the |\usepackage|
142 % command, \texttt{polish} could be an `unknown' language in which
143 % case we have to make it known. So we check for the existence of
144 % |\l@polish| to see whether we have to do something here.
146 % \changes{polish-1.1c}{1994/06/26}{Now use \cs{@nopatterns} to
147 % produce the warning}
149 \ifx\l@polish\@undefined
151 \adddialect\l@polish0\fi
154 % The next step consists of defining commands to switch to (and
155 % from) the Polish language.
157 % \begin{macro}{\captionspolish}
158 % The macro |\captionspolish| defines all strings used in the four
159 % standard documentclasses provided with \LaTeX.
160 % \changes{polish-1.2b}{1995/07/04}{Added \cs{proofname} for
162 % \changes{polish-1.2f}{1997/09/11}{Added translation for Proof and
163 % changed translation of Contents}
164 % \changes{polish-1.2i}{2000/09/19}{\cs{bibname} and \cs{refname} were
166 % \changes{polish-1.2i}{2000/09/19}{Added \cs{glossaryname}}
168 \addto\captionspolish{%
169 \def\prefacename{Przedmowa}%
170 \def\refname{Literatura}%
171 \def\abstractname{Streszczenie}%
172 \def\bibname{Bibliografia}%
173 \def\chaptername{Rozdzia\l}%
174 \def\appendixname{Dodatek}%
175 \def\contentsname{Spis tre\'sci}%
176 \def\listfigurename{Spis rysunk\'ow}%
177 \def\listtablename{Spis tablic}%
178 \def\indexname{Indeks}%
179 \def\figurename{Rysunek}%
180 \def\tablename{Tablica}%
181 \def\partname{Cz\eob{}\'s\'c}%
182 \def\enclname{Za\l\aob{}cznik}%
185 \def\pagename{Strona}%
186 \def\seename{Por\'ownaj}%
187 \def\alsoname{Por\'ownaj tak\.ze}%
188 \def\proofname{Dow\'od}%
189 \def\glossaryname{Glossary}% <-- Needs translation
194 % \begin{macro}{\datepolish}
195 % The macro |\datepolish| redefines the command |\today| to produce
197 % \changes{polish-1.2f}{1997/10/01}{Use \cs{edef} to define
198 % \cs{today} to save memory}
199 % \changes{polish-1.2f}{1998/03/28}{use \cs{def} instead of \cs{edef}}
200 % \changes{polish-1.2i}{2000/01/08}{A missing comment character caused
201 % an unwanted space character in the output}
204 \def\today{\number\day~\ifcase\month\or
205 stycznia\or lutego\or marca\or kwietnia\or maja\or czerwca\or lipca\or
206 sierpnia\or wrze\'snia\or pa\'zdziernika\or listopada\or grudnia\fi
212 % \begin{macro}{\extraspolish}
213 % \begin{macro}{\noextraspolish}
214 % The macro |\extraspolish| will perform all the extra definitions
215 % needed for the Polish language. The macro |\noextraspolish| is
216 % used to cancel the actions of |\extraspolish|.
218 % For Polish the \texttt{"} character is made active. This is
219 % done once, later on its definition may vary. Other languages in
220 % the same document may also use the \texttt{"} character for
221 % shorthands; we specify that the polish group of shorthands
225 \initiate@active@char{"}
226 \addto\extraspolish{\languageshorthands{polish}}
227 \addto\extraspolish{\bbl@activate{"}}
229 % Don't forget to turn the shorthands off again.
230 % \changes{polish-1.2h}{1999/12/17}{Deactivate shorthands ouside of
233 \addto\noextraspolish{\bbl@deactivate{"}}
238 % The code above is necessary because we need an extra
239 % active character. This character is then used as indicated in
240 % table~\ref{tab:polish-quote}.
242 % If you have problems at the end of a word with a linebreak, use
243 % the other version without hyphenation tricks. Some TeX wizard may
244 % produce a better solution with forcasting another token to decide
245 % whether the character after the double quote is the last in a
246 % word. Do it and let us know.
248 % In Polish texts some letters get special diacritical marks.
249 % Leszek Holenderski designed the following code to position the
250 % diacritics correctly for every font in every size. These macros
251 % need a few extra dimension variables.
260 % \begin{macro}{\sob}
261 % The macro |\sob| is used to put the `ogonek' in the right
264 % \changes{polish-1.2d}{1996/08/18}{This macro is meant to be used in
265 % horizontal mode; so leave vertical mode if necessary}
267 \def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo
268 \setbox0\hbox{#1}\setbox1\hbox{$_\mathchar'454$}\setbox2\hbox{p}%
269 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
270 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
271 \pl@left=\pl@right \advance\pl@left by\wd1
272 \pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
274 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
278 % \begin{macro}{\aob}
279 % \begin{macro}{\Aob}
280 % \begin{macro}{\eob}
281 % \begin{macro}{\Eob}
282 % The ogonek is placed with the letters `a', `A', `e', and `E'.
283 % \changes{polish-1.2d}{1996/08/18}{Use the constructed version of the
284 % characters only in OT1; use proper characters in T1.}
286 \DeclareTextCommand{\aob}{OT1}{\sob a{.66}{.20}{0}{.90}}
287 \DeclareTextCommand{\Aob}{OT1}{\sob A{.80}{.50}{0}{.90}}
288 \DeclareTextCommand{\eob}{OT1}{\sob e{.50}{.35}{0}{.93}}
289 \DeclareTextCommand{\Eob}{OT1}{\sob E{.60}{.35}{0}{.90}}
291 % For the 'new' \texttt{T1} encoding we can provide simpler
294 \DeclareTextCommand{\aob}{T1}{\k a}
295 \DeclareTextCommand{\Aob}{T1}{\k A}
296 \DeclareTextCommand{\eob}{T1}{\k e}
297 \DeclareTextCommand{\Eob}{T1}{\k E}
299 % Construct the characters by default from the OT1 encoding.
301 \ProvideTextCommandDefault{\aob}{\UseTextSymbol{OT1}{\aob}}
302 \ProvideTextCommandDefault{\Aob}{\UseTextSymbol{OT1}{\Aob}}
303 \ProvideTextCommandDefault{\eob}{\UseTextSymbol{OT1}{\eob}}
304 \ProvideTextCommandDefault{\Eob}{\UseTextSymbol{OT1}{\Eob}}
311 % \begin{macro}{\spb}
312 % The macro |\spb| is used to put the `poprzeczka' in the
315 % \changes{polish-1.2d}{1996/08/18}{\cs{spb} is meant to be used in
316 % horizontal mode; so leave vertical mode if necessary}
319 \setbox0\hbox{#1}\setbox1\hbox{\char'023}%
320 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
321 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
322 \pl@left=\pl@right \advance\pl@left by\wd1
323 \ht1=\pl@down \dp1=-\pl@down
325 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
329 % \begin{macro}{\skb}
330 % The macro |\skb| is used to put the `kropka' in the
333 % \changes{polish-1.2d}{1996/08/18}{\cs{skb} is meant to be used in
334 % horizontal mode; so leave vertical mode if necessary}
337 \setbox0\hbox{#1}\setbox1\hbox{\char'056}%
338 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
339 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
340 \pl@left=\pl@right \advance\pl@left by\wd1
342 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
346 % \begin{macro}{\textpl}
347 % For the `poprzeczka' and the `kropka' in text fonts we don't need
348 % any special coding, but we can (almost) use what is already
358 % Initially we assume that typesetting is done with text fonts.
359 % \changes{polish-1.0a}{1993/11/05}{Initially execute `textpl}
365 \let\lll=\l \let\LLL=\L
371 % \begin{macro}{\telepl}
372 % But for the `teletype' font in `OT1' encoding we have to take some
373 % special actions, involving the macros defined above.
377 \def\lpb{\spb l{.45}{.5}{.4}{.8}}%
378 \def\Lpb{\spb L{.23}{.5}{.4}{.8}}%
379 \def\zkb{\skb z{.5}{.5}{1.2}{0}}%
380 \def\Zkb{\skb Z{.5}{.5}{1.1}{0}}}
384 % To activate these codes the font changing commands as they are
385 % defined in \LaTeX\ are modified. The same is done for plain
386 % \TeX's font changing commands.
388 % When |\selectfont| is undefined the current format is spposed to be
389 % either plain (based) or \LaTeX$\:$2.09.
390 % \changes{polish-1.2a}{1995/06/06}{Don't modify \cs{rm} and friends for
391 % \LaTeXe, take \cs{selectfont } instead}
393 \ifx\selectfont\@undefined
394 \ifx\prm\@undefined \addto\rm{\textpl}\else \addto\prm{\textpl}\fi
395 \ifx\pit\@undefined \addto\it{\textpl}\else \addto\pit{\textpl}\fi
396 \ifx\pbf\@undefined \addto\bf{\textpl}\else \addto\pbf{\textpl}\fi
397 \ifx\psl\@undefined \addto\sl{\textpl}\else \addto\psl{\textpl}\fi
398 \ifx\psf\@undefined \else \addto\psf{\textpl}\fi
399 \ifx\psc\@undefined \else \addto\psc{\textpl}\fi
400 \ifx\ptt\@undefined \addto\tt{\telepl}\else \addto\ptt{\telepl}\fi
403 % When |\selectfont| exists we assume \LaTeXe.
405 \expandafter\addto\csname selectfont \endcsname{%
406 \csname\f@encoding @pl\endcsname}
409 % Currently we support the OT1 and T1 encodings. For T1 we don't
410 % have to make a difference between typewriter fonts and other
411 % fonts, they all have the same glyphs.
413 \expandafter\let\csname T1@pl\endcsname\textpl
415 % For OT1 we need to check the current font family, stored in
416 % |\f@family|. Unfortunately we need a hack as |\ttdefault| is
417 % defined as a |\long| macro, while |\f@family| is not.
419 \expandafter\def\csname OT1@pl\endcsname{%
420 \long\edef\curr@family{\f@family}%
421 \ifx\curr@family\ttdefault
429 % We save the original double quote character in |\dq| to keep
430 % it available, the math accent |\"| can now be typed as |"|.
432 \begingroup \catcode`\"12
439 % Now we can define the doublequote macros for diacritics,
440 % \changes{polish-1.1d}{1995/01/31}{The dqmacro for C used \cs{'c}}
442 \declare@shorthand{polish}{"a}{\textormath{\aob}{\ddot a}}
443 \declare@shorthand{polish}{"A}{\textormath{\Aob}{\ddot A}}
444 \declare@shorthand{polish}{"c}{\textormath{\'c}{\acute c}}
445 \declare@shorthand{polish}{"C}{\textormath{\'C}{\acute C}}
446 \declare@shorthand{polish}{"e}{\textormath{\eob}{\ddot e}}
447 \declare@shorthand{polish}{"E}{\textormath{\Eob}{\ddot E}}
448 \declare@shorthand{polish}{"l}{\textormath{\lpb}{\ddot l}}
449 \declare@shorthand{polish}{"L}{\textormath{\Lpb}{\ddot L}}
450 \declare@shorthand{polish}{"n}{\textormath{\'n}{\acute n}}
451 \declare@shorthand{polish}{"N}{\textormath{\'N}{\acute N}}
452 \declare@shorthand{polish}{"o}{\textormath{\'o}{\acute o}}
453 \declare@shorthand{polish}{"O}{\textormath{\'O}{\acute O}}
454 \declare@shorthand{polish}{"s}{\textormath{\'s}{\acute s}}
455 \declare@shorthand{polish}{"S}{\textormath{\'S}{\acute S}}
457 % \begin{macro}{\polishrz}
458 % \begin{macro}{\polishzx}
459 % \changes{polish-1.2j}{2000/11/11}{Added support for two
460 % notationstyles for kropka and accented z}
461 % The command |\polishrz| defines the shorthands |"r|, |"z| and
462 % |"x| to produce pointed z, accented z and |"x|. This is the
463 % default as these shorthands were defined by this language
464 % definition file for quite some time.
466 \newcommand*{\polishrz}{%
467 \declare@shorthand{polish}{"r}{\textormath{\zkb}{\ddot r}}%
468 \declare@shorthand{polish}{"R}{\textormath{\Zkb}{\ddot R}}%
469 \declare@shorthand{polish}{"z}{\textormath{\'z}{\acute z}}%
470 \declare@shorthand{polish}{"Z}{\textormath{\'Z}{\acute Z}}%
471 \declare@shorthand{polish}{"x}{\dq x}%
472 \declare@shorthand{polish}{"X}{\dq X}%
476 % The command |\polishzx| switches to a different set of
477 % shorthands, |"z|, |"x| and |"r| to produce pointed z, accented z
478 % and |"r|; a different shorthand notation also in use.
479 % \changes{polish-1.2k}{2003/10/12}{Fixed a typo}
481 \newcommand*{\polishzx}{%
482 \declare@shorthand{polish}{"z}{\textormath{\zkb}{\ddot z}}%
483 \declare@shorthand{polish}{"Z}{\textormath{\Zkb}{\ddot Z}}%
484 \declare@shorthand{polish}{"x}{\textormath{\'z}{\acute x}}%
485 \declare@shorthand{polish}{"X}{\textormath{\'Z}{\acute X}}%
486 \declare@shorthand{polish}{"r}{\dq r}%
487 \declare@shorthand{polish}{"R}{\dq R}%
493 % Then we define access to two forms of quotation marks, similar
494 % to the german and french quotation marks.
495 % \changes{polish-1.2e}{1997/04/03}{Removed empty groups after
496 % double quote and guillemot characters}
497 % \changes{polish-1.2l}{2004/02/18}{Changed closing quote}
499 \declare@shorthand{polish}{"`}{%
500 \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
501 \declare@shorthand{polish}{"'}{%
502 \textormath{\textquotedblright}{\mbox{\textquotedblright}}}
503 \declare@shorthand{polish}{"<}{%
504 \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
505 \declare@shorthand{polish}{">}{%
506 \textormath{\guillemotright}{\mbox{\guillemotright}}}
508 % then we define two shorthands to be able to specify hyphenation
509 % breakpoints that behavew a little different from |\-|.
511 \declare@shorthand{polish}{"-}{\nobreak-\bbl@allowhyphens}
512 \declare@shorthand{polish}{""}{\hskip\z@skip}
514 % And we want to have a shorthand for disabling a ligature.
516 \declare@shorthand{polish}{"|}{%
517 \textormath{\discretionary{-}{}{\kern.03em}}{}}
521 % \begin{macro}{\mdqon}
522 % \begin{macro}{\mdqoff}
523 % All that's left to do now is to define a couple of commands
524 % for reasons of compatibility with \file{polish.tex}.
525 % \changes{polish-1.2f}{1998/06/07}{Now use \cs{shorthandon} and
528 \def\mdqon{\shorthandon{"}}
529 \def\mdqoff{\shorthandoff{"}}
534 % The macro |\ldf@finish| takes care of looking for a
535 % configuration file, setting the main language to be switched on
536 % at |\begin{document}| and resetting the category code of
537 % \texttt{@} to its original value.
538 % \changes{polish-1.2d}{1996/11/03}{Now use \cs{ldf@finish} to wrap
548 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
549 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
550 %% Digits \0\1\2\3\4\5\6\7\8\9
551 %% Exclamation \! Double quote \" Hash (number) \#
552 %% Dollar \$ Percent \% Ampersand \&
553 %% Acute accent \' Left paren \( Right paren \)
554 %% Asterisk \* Plus \+ Comma \,
555 %% Minus \- Point \. Solidus \/
556 %% Colon \: Semicolon \; Less than \<
557 %% Equals \= Greater than \> Question mark \?
558 %% Commercial at \@ Left bracket \[ Backslash \\
559 %% Right bracket \] Circumflex \^ Underscore \_
560 %% Grave accent \` Left brace \{ Vertical bar \|
561 %% Right brace \} Tilde \~}