1 The Polish language

The file polish.dtx^{1} defines all the language-specific macros for the Polish language.

For this language the character " is made active. In table 1 an overview is given of its purpose.

"a or \aob, for tailed-a (like a̧)
"A or \Aob, for tailed-A (like A̧)
"e or \eob, for tailed-e (like ȩ)
"E or \Eob, for tailed-E (like Ȩ)

"c or \'c, for accented c (like ć), same with uppercase

letters and n,o,s

"l or \lpb{}, for l with stroke (like ł)
"L or \Lpb{}, for L with stroke (like Ł)
"r or \zkb{}, for pointed z (like ż), cf. pronounciation
"R or \Zkb{}, for pointed Z (like Ż)
"z or \'z, for accented z
"Z or \'Z, for accented Z
"| disable ligature at this position.

"- an explicit hyphen sign, allowing hyphenation in the

rest of the word. "" like "-, but producing no hyphen sign (for compund

words with hyphen, e.g. x-""y).

"` for German left double quotes (looks like ,,).
"' for German right double quotes.
"< for French left double quotes (similar to <<).
"> for French right double quotes (similar to >>).

Table 1: The extra definitions made by polish.sty

The macro \LdfInit takes care of preventing that this file is loaded more than once, checking the category code of the @ sign, etc.

1 ⟨∗code⟩

2 \LdfInit{polish}\captionspolish

When this file is read as an option, i.e. by the \usepackage command, polish could be an ‘unknown’ language in which case we have to make it known. So we check for the existence of \l@polish to see whether we have to do something here.

3 \ifx\l@polish\@undefined
4 \@nopatterns{Polish}
5 \adddialect\l@polish0\fi

The next step consists of defining commands to switch to (and from) the Polish language.

\captionspolish The macro \captionspolish defines all strings used in the four standard documentclasses provided with L^{A}TEX.

1The file described in this section has version number v1.2d and was last revised on 1996/12/23.

 6 \addto\captionspolish{%
 7 \def\prefacename{Przedmowa}%
 8 \def\refname{Bibliografia}%
 9 \def\abstractname{Streszczenie}%
10 \def\bibname{Literatura}%
11 \def\chaptername{Rozdzia\l}%
12 \def\appendixname{Dodatek}%
13 \def\contentsname{Spis rzeczy}%
14 \def\listfigurename{Spis rysunk\'ow}%
15 \def\listtablename{Spis tablic}%
16 \def\indexname{Indeks}%
17 \def\figurename{Rysunek}%
18 \def\tablename{Tablica}%
19 \def\partname{Cz\eob{}\'s\'c}%
20 \def\enclname{Za\l\aob{}cznik}%
21 \def\ccname{Kopie:}%
22 \def\headtoname{Do}%
23 \def\pagename{Strona}%
24 \def\seename{Por\'ownaj}%
25 \def\alsoname{Por\'ownaj tak\.ze}%
26 \def\proofname{Proof}%   <-- needs translation

27 }

\datepolish The macro \datepolish redefines the command \today to produce Polish dates.

28 \def\datepolish{%
29 \def\today{\number\day~\ifcase\month\or
30 stycznia\or lutego\or marca\or kwietnia\or maja\or czerwca\or lipca\or
31 sierpnia\or wrze\'snia\or pa\'zdziernika\or listopada\or grudnia\fi
32 \space\number\year}

33 }

\extraspolish \noextraspolish The macro \extraspolish will perform all the extra definitions needed for the Polish language. The macro \noextraspolish is used to cancel the actions of

\extraspolish.

For Polish the " character is made active. This is done once, later on its definition may vary. Other languages in the same document may also use the " character for shorthands; we specify that the polish group of shorthands should be used.

34 \initiate@active@char{"}
35 \addto\extraspolish{\languageshorthands{polish}}
36 \addto\extraspolish{\bbl@activate{"}}
37 %\addto\noextraspolish{\bbl@deactivate{"}}

The code above is necessary because we need an extra active character. This character is then used as indicated in table 1.

If you have problems at the end of a word with a linebreak, use the other version without hyphenation tricks. Some TeX wizard may produce a better solution with forcasting another token to decide whether the character after the double quote is the last in a word. Do it and let us know.

In Polish texts some letters get special diacritical marks. Leszek Holenderski designed the following code to position the diacritics correctly for every font in every size. These macros need a few extra dimension variables.

38 \newdimen\pl@left
39 \newdimen\pl@down
40 \newdimen\pl@right
41 \newdimen\pl@temp

\sob The macro \sob is used to put the ‘ogonek’ in the right place.

42 \def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo
43 \setbox0\hbox{#1}\setbox1\hbox{$_\mathchar'454$}\setbox2\hbox{p}%
44 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
45 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
46 \pl@left=\pl@right \advance\pl@left by\wd1
47 \pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
48 \leavevmode
49 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}

\aob \Aob \eob \Eob The ogonek is placed with the letters ‘a’, ‘A’, ‘e’, and ‘E’.

50 \DeclareTextCommand{\aob}{OT1}{\sob a{.66}{.20}{0}{.90}}
51 \DeclareTextCommand{\Aob}{OT1}{\sob A{.80}{.50}{0}{.90}}
52 \DeclareTextCommand{\eob}{OT1}{\sob e{.50}{.35}{0}{.93}}
53 \DeclareTextCommand{\Eob}{OT1}{\sob E{.60}{.35}{0}{.90}}

For the ’new’ T1 encoding we can provide simpler definitions.

54 \DeclareTextCommand{\aob}{T1}{\k a}
55 \DeclareTextCommand{\Aob}{T1}{\k A}
56 \DeclareTextCommand{\eob}{T1}{\k e}
57 \DeclareTextCommand{\Eob}{T1}{\k E}

Construct the characters by default from the OT1 encoding.

58 \ProvideTextCommandDefault{\aob}{\UseTextSymbol{OT1}{\aob}}
59 \ProvideTextCommandDefault{\Aob}{\UseTextSymbol{OT1}{\Aob}}
60 \ProvideTextCommandDefault{\eob}{\UseTextSymbol{OT1}{\eob}}
61 \ProvideTextCommandDefault{\Eob}{\UseTextSymbol{OT1}{\Eob}}

\spb The macro \spb is used to put the ‘poprzeczka’ in the right place.

62 \def\spb#1#2#3#4#5{%
63 \setbox0\hbox{#1}\setbox1\hbox{\char'023}%
64 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
65 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
66 \pl@left=\pl@right \advance\pl@left by\wd1
67 \ht1=\pl@down \dp1=-\pl@down
68 \leavevmode
69 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}

\skb The macro \skb is used to put the ‘kropka’ in the right place.

70 \def\skb#1#2#3#4#5{%
71 \setbox0\hbox{#1}\setbox1\hbox{\char'056}%
72 \pl@right=#2\wd0 \advance\pl@right by-#3\wd1
73 \pl@down=#5\ht1 \advance\pl@down by-#4\ht0
74 \pl@left=\pl@right \advance\pl@left by\wd1
75 \leavevmode
76 \kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}

\textpl For the ‘poprzeczka’ and the ‘kropka’ in text fonts we don’t need any special coding, but we can (almost) use what is already available.

77 \def\textpl{%
78 \def\lpb{\plll}%
79 \def\Lpb{\pLLL}%
80 \def\zkb{\.z}%
81 \def\Zkb{\.Z}}

Initially we assume that typesetting is done with text fonts.

82 \textpl
83 \let\lll=\l \let\LLL=\L
84 \def\plll{\lll}
85 \def\pLLL{\LLL}

\telepl But for the ‘teletype’ font in ‘OT1’ encoding we have to take some special actions, involving the macros defined above.

86 \def\telepl{%
87 \def\lpb{\spb l{.45}{.5}{.4}{.8}}%
88 \def\Lpb{\spb L{.23}{.5}{.4}{.8}}%
89 \def\zkb{\skb z{.5}{.5}{1.2}{0}}%
90 \def\Zkb{\skb Z{.5}{.5}{1.1}{0}}}

To activate these codes the font changing commands as they are defined in L^{A}TEX are modified. The same is done for plain TEX’s font changing commands.

When \selectfont is undefined the current format is spposed to be either plain (based) or L^{A}TEX 2.09.

91 \ifx\selectfont\@undefined
92 \ifx\prm\@undefined \addto\rm{\textpl}\else \addto\prm{\textpl}\fi
93 \ifx\pit\@undefined \addto\it{\textpl}\else \addto\pit{\textpl}\fi
94 \ifx\pbf\@undefined \addto\bf{\textpl}\else \addto\pbf{\textpl}\fi
95 \ifx\psl\@undefined \addto\sl{\textpl}\else \addto\psl{\textpl}\fi
96 \ifx\psf\@undefined                   \else \addto\psf{\textpl}\fi
97 \ifx\psc\@undefined                   \else \addto\psc{\textpl}\fi
98 \ifx\ptt\@undefined \addto\tt{\telepl}\else \addto\ptt{\telepl}\fi
99 \else

When \selectfont exists we assume L^{A}TEX 2ε.

100 \expandafter\addto\csname selectfont \endcsname{%
101  \csname\f@encoding @pl\endcsname}
102 \fi

Currently we support the OT1 and T1 encodings. For T1 we don’t have to make a difference between typewriter fonts and other fonts, they all have the same glyphs.

103 \expandafter\let\csname T1@pl\endcsname\textpl

For OT1 we need to check the current font family, stored in \f@family. Unfortunately we need a hack as \ttdefault is defined as a \long macro, while

\f@family is not.
104 \expandafter\def\csname OT1@pl\endcsname{%
105 \long\edef\curr@family{\f@family}%
106 \ifx\curr@family\ttdefault
107  \telepl
108 \else
109  \textpl
110 \fi}

\dq We save the original double quote character in \dq to keep it available, the math accent \" can now be typed as ".

111 \begingroup \catcode`\"12
112 \def\x{\endgroup
113 \def\dq{"}}

114 \x

Now we can define the doublequote macros for diacritics,

115 \declare@shorthand{polish}{"a}{\textormath{\aob}{\ddot a}}
116 \declare@shorthand{polish}{"A}{\textormath{\Aob}{\ddot A}}
117 \declare@shorthand{polish}{"c}{\textormath{\'c}{\acute c}}
118 \declare@shorthand{polish}{"C}{\textormath{\'C}{\acute C}}
119 \declare@shorthand{polish}{"e}{\textormath{\eob}{\ddot e}}
120 \declare@shorthand{polish}{"E}{\textormath{\Eob}{\ddot E}}
121 \declare@shorthand{polish}{"l}{\textormath{\lpb}{\ddot l}}
122 \declare@shorthand{polish}{"L}{\textormath{\Lpb}{\ddot L}}
123 \declare@shorthand{polish}{"n}{\textormath{\'n}{\acute n}}
124 \declare@shorthand{polish}{"N}{\textormath{\'N}{\acute N}}
125 \declare@shorthand{polish}{"o}{\textormath{\'o}{\acute o}}
126 \declare@shorthand{polish}{"O}{\textormath{\'O}{\acute O}}
127 \declare@shorthand{polish}{"r}{\textormath{\zkb}{\ddot r}}
128 \declare@shorthand{polish}{"R}{\textormath{\Zkb}{\ddot R}}
129 \declare@shorthand{polish}{"s}{\textormath{\'s}{\acute s}}
130 \declare@shorthand{polish}{"S}{\textormath{\'S}{\acute S}}
131 \declare@shorthand{polish}{"z}{\textormath{\'z}{\acute z}}
132 \declare@shorthand{polish}{"Z}{\textormath{\'Z}{\acute Z}}

Then we define access to two forms of quotation marks, similar to the german and french quotation marks.

133 \declare@shorthand{polish}{"`}{%
134 \textormath{\quotedblbase{}}{\mbox{\quotedblbase}}}
135 \declare@shorthand{polish}{"'}{%
136 \textormath{\textquotedblleft{}}{\mbox{\textquotedblleft}}}
137 \declare@shorthand{polish}{"<}{%
138 \textormath{\guillemotleft{}}{\mbox{\guillemotleft}}}
139 \declare@shorthand{polish}{">}{%
140 \textormath{\guillemotright{}}{\mbox{\guillemotright}}}

then we define two shorthands to be able to specify hyphenation breakpoints that behavew a little different from \-.

141 \declare@shorthand{polish}{"-}{\allowhyphens-\allowhyphens}
142 \declare@shorthand{polish}{""}{\hskip\z@skip}

And we want to have a shorthand for disabling a ligature.

143 \declare@shorthand{polish}{"|}{%
144 \textormath{\discretionary{-}{}{\kern.03em}}{}}

\mdqon \mdqoff All that’s left to do now is to define a couple of commands for reasons of compatibility with polish.tex.

145 \def\mdqon{\bbl@activate{"}}
146 \def\mdqoff{\bbl@deactivate{"}}

The macro \ldf@finish takes care of looking for a configuration file, setting the main language to be switched on at \begin{document} and resetting the category code of @ to its original value.

147 \ldf@finish{polish}

148 ⟨/code⟩