3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7
%% Purpose: to provide best possible ogonek in every situation
9
%% The copyright holder of this file is Janusz S. Bie\'n
10
%% (JSBien@plearn.edu.pl)
12
%% The code consists of parts written by J. S. Bie\'n, L. Holenderski,
13
%% D. H\"ubel and Igor Moo, who finally assembled this file. Any bugs
14
%% can (and should) be attributed to him.
16
%% Note: you are not allowed to modify this file.
17
%% Note: I don't make any changes in T1 definitions so aAeE(iIuU)
18
%% checking does not work there.
22
% Since I hate the presence of section `Printing the documentation'
23
% in every DOCed package my driver is put into a metacomment.
24
% To print documentation LaTeX this file. If you need to change
25
% the driver run DOCSTRIP and ask it to make ogonek.drv by
26
% stripping ogonek.dtx with option `driver'. Do *not* modify this file.
28
\documentclass{ltxdoc}
38
\def\fileversion{v0.51}
39
\def\filedate{95/07/17}
40
\def\docdate {94/12/21}
43
% {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
44
% 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
45
% Digits \0\1\2\3\4\5\6\7\8\9
46
% Exclamation \! Double quote \" Hash (number) \#
47
% Dollar \$ Percent \% Ampersand \&
48
% Acute accent \' Left paren \( Right paren \)
49
% Asterisk \* Plus \+ Comma \,
50
% Minus \- Point \. Solidus \/
51
% Colon \: Semicolon \; Less than \<
52
% Equals \= Greater than \> Question mark \?
53
% Commercial at \@ Left bracket \[ Backslash \\
54
% Right bracket \] Circumflex \^ Underscore \_
55
% Grave accent \` Left brace \{ Vertical bar \|
56
% Right brace \} Tilde \~}
58
% \def\ogon/{\texttt{ogonek}}
60
% \title{The \ogon/ package\thanks{Version \fileversion\ dated \filedate.}}
61
% \author{Janusz Stanis\l aw Bie\'n}
66
% This \LaTeXe\ package provides a command to typeset letters with the
67
% ogonek diacritic mark; they are used in Polish and Lithuanian. The
68
% command is named |\k| in accordance with the recommendation of the
69
% Technical Working Group on Multiple Language Coordination of the \TeX\
70
% Users Group. The principal purpose of the command is to provide the
71
% high quality ogonek with CM fonts, although for Polish the best
72
% results are obtained with the special Polish PL fonts; the command
73
% can be also used with DC fonts.
76
% \section{Introduction}
77
% The ogonek diacritic mark (|\k|) is absent in the original Computer
78
% Modern font (\cite{CM}), probably because it was not needed for
79
% Donald Knuth's Art of Computer Programming. The
80
% ogonek was included in the extended \TeX\ layout agreed in 1990 at the
81
% \TeX\ conference in Cork in Ireland and therefore often called simply
82
% the Cork layout; however, there was still no standard command to
83
% typeset it. This was remedied in 1992, when the \TeX\ Users Group
84
% Technical Working Group on Multiple Language Coordination
85
% WG-92-03\footnote {The group was described in \cite{Council}}
86
% recommended a set of \TeX\ conventions concerning languages (cf.
87
% \cite{Conv}). In particular, the command names were proposed for
88
% typesetting letters and accents introduced in the extended layout;
89
% the command |\k| was assigned to the ogonek and the name justified as
90
% the last letter of the word {\it ogonek}\footnote {Actually J\"org
91
% Knappen wrote in \cite{summary} that \texttt{\string\k} stands also
92
% for the first letter
93
% of the Scandinavian {kvist}. It can be viewed also as the first
94
% letter of the German word {Krummhaken}}
96
% In \cite{Conv} WG-92-3 proposed also a set of two-letter names for
97
% the language-switching macros. We use the two names from this list
98
% (but without the preceeding backslash) as the option names in our
99
% package: PL for Polish and LT for Lithuanian.
101
% The lack of a standard way to typeset ogonek with Computer Modern
102
% fonts and its predecessors (including AM, i.e. Almost Computern
103
% Modern fonts) was from the very beginning a very serious obstacle for
104
% high quality typesetting of Polish texts. Several various techniques
105
% were developed independently to circumvent this problem; in the
106
% present package we use the method developed at the Faculty of
107
% Mathematics, Informatics and Mechanics of the Warsaw University and
108
% used in \LaTeX\ styles plfonts and plhb.\footnote {Thanks to the
109
% contribution of Piotr Filip Sawicki, the support of these styles is a
110
% standard feature of AUC \TeX, a sophisticated (La)\TeX\ environment for
111
% Emacs, since the release 9.0 of May 1994.}
113
% The primary problem was to find a CM character which bears sufficient
114
% ressemblance to ogonek. Several characters (including e.g. comma)
115
% were tried till 1988, when Jerzy Ryll suggested to use |\lhook| (left
116
% hook) symbol available in Plain \TeX\ as a part of the |\hookrightarrow|
117
% ($\hookrightarrow$) symbol; this is the character \texttt{'54} in math italics
118
% fonts. Ryll's idea was described in the note \cite{TeXline} and
119
% Janusz S. Bie\'n's \texttt{pl.sty} style using this technique was sent to the
120
% \TeX line editor to be included in the Aston \TeX\ archive;
121
% unfortunately, it seems that it never managed to get there. The
122
% idea was also presented in a paper written in Polish in 1988, which
123
% however appeared much later (\cite{cttex90}).
125
% The remaining problem was to achieve proper positioning of the left
126
% hook character with the appropriate letters for every fonts size and
127
% shape; as ogonek accompanies such different letters as a, A, e and E,
128
% this was not an easy task. At first it was done simply by hand, as in
129
% Janusz S.~Bie\'n's \texttt{plfonts.tex} file loaded during the \LaTeX\ format
130
% generation. The credit for solving this problem is due to Leszek
131
% Holenderski, who in 1989 created his \texttt{plfonts.sty}, which patched the
132
% standard \LaTeX\ font switching mechanism with the code for adjusting
133
% the placing of ogonek. We use his code here without any substantial
134
% changes.\footnote {Bie\'n's notes say that he started to use Ryll's
135
% technique on 22nd June 1988 and created a version of Holenderski's
136
% style on 17th October 1999 (the version was called \texttt{plhb.sty},
138
% stands for {Holenderski's style as modified by Bie\'n} and \texttt{pl} stands
139
% both for Polish and the earlier \texttt{pl} style; it used a different input
140
% convention than the original Holenderski's style)}
142
% In the extended \TeX\ layout used at present practically only in
143
% Norbert Schwarz's DC fonts (cf. \cite{DC1}, \cite{DC2}) but envisaged
144
% as the future \TeX\ standard and therefore recommended for \LaTeXe\
145
% users the slots are assigned for both Polish letters with ogonek and
146
% the ogonek itself; typeseting all Polish letters and some Lithuanian
147
% ones causes therefore no problem and requires only referencing the
148
% appropriate characters; the remaining Lithuanian characters have to
149
% be typeset using by the composition of the appropriate chcaracters
150
% (the |\accent| primitive cannot be used for this purpose because it
151
% placed the accent {over} the letter).
153
% The primary problem with the extended \TeX\ font layout was (at to some
154
% measure still is) its incompatibility with the standard CM layouts,
155
% which for many users makes the migration to the new layout
156
% prohibitively difficult. For many applications a good solution was a
157
% mixed layout, with the lower part (character codes from 0 to 127)
158
% fully compatible with CM fonts and the higher part more or less
159
% compatible with the Cork layout. We will call this layout
160
% {Cork-extended CM layout}\footnote {It seems to be little known that
161
% the layout should be coded in the TFM and PK files by means of the
162
% Metafont \textbf{font\_coding\_scheme} command; to the best of our knowledge,
163
% the only program which takes advantage of this fact is Eberhard
166
% The PL fonts, developed by Bogus{\l}aw Jackowski and Marek Ry\'cko with
167
% some advice of a professional typographer Roman Tomaszewski and
168
% included in the MeX distribution\footnote{available e.g. from
169
% Comprehensive \TeX\ Archive Network in the directory
170
% tex-archive/languages/polish }, are a special
171
% case of Cork-like extended Computer Modern fonts---in the higher
172
% part they contain Polish letters with ogonek placed in the same slots
173
% as in the Cork layout; however, they contain also the Polish double
174
% opening quote moved from its Cork position in the lower part to the
175
% higher part of the font. This layout can be called PL-extended CM
176
% fonts\footnote {At present (i.e. in all MeX releases including 1.5) a
177
% PL font have the \textbf{font\_coding\_scheme} identical with the CM font it is
178
% compatible with. For example, both plr10 and cmr10 have the coding
179
% scheme {TeX text}, pltt10 and cmtt10 {TeX typewriter text} etc.
180
% Dvispell users would appreciate very much if the PL fonts were
181
% distinguishable from CM fonts by the coding scheme field, which can
182
% be asigned such values as {PL-extended TeX text}, {PL-extended TeX
183
% typewriter text} etc.}
185
% The PL fonts provide the best quality for Polish texts; however, for
186
% those Lithuanian letters with ogonek which do not coincide with Polish
187
% ones it is necessary to use the same technique as for CM fonts. In
188
% consequence, for Lithuanian texts the use of DC fonts is probably an
193
% The package is loaded in the standard way with the
194
% |\usepackage{ogonek}| command.
196
% As the fonts called by us the PL-extended CM fonts are not widely
197
% used, they do not have also a generally accepted symbol for their
198
% layout. Mariusz Olko in his preliminary version of polski package
199
% referes to them as OT1P, while W{\l}odzimierz Bzyl in his LaMeXe uses
201
% In consequence \ogon/ works with the following
203
% OT1 (standard meaning)
204
% OT1P (PL fonts with Olko's package)
205
% OT4 (PL fonts with LaMeX2e and later versions of Olko's package)
206
% T1 (standard meaning)
208
% The package accepts two language options:
210
% \begin{tabular}{cl}
211
% PL & only Polish letters with ogonek\\
212
% LT & Lithuanian letters --- which subsume the Polish ones --- with ogonek
215
% Omitting the language option allows to use any letter with ogonek.
217
% \section{Hyphenation of words with ogonek accent}
218
% The full and correct hyphenation of words with ogonek (and other Polish
219
% letters) is possible with DC and PL fonts; details to be written later.
222
% \begin{thebibliography}{8}
224
% Janusz S. Bie\'n. Polish Language and {\TeX}. \TeX line 8, January 1989,
227
% \bibitem{cttex90} Janusz S. Bie\'n. Co to jest {\TeX}. Available by
228
% anonymous FTP from ftp.mimuw.edu.pl in pub/users/jsbien/tex as
229
% cttex90.tar.Z or from LISTSERV@PLEARN.edu.pl as CTTEX90 PACKAGE.
232
% Michael J. Ferguson. Report on Multilingual Activities.
233
% TUGboat Vol. 11, No 4, November 1990, pp 514--516
236
% Michael J. Ferguson. The Technical Council.
237
% {\it \TeX\ and TUG News} Vol. 1, No. 3, November 1992, pp 5--8.
240
% Yannis Haralambous. \TeX\ Convention Concerning Languages.
241
% {\it \TeX\ and TUG News} Vol. 1, No. 4, December 1992, pp 3--10.
244
% Yannis Haralambous. DC fonts---questions and answers (I).
245
% {\it \TeX\ and TUG News} Vol. 1, No. 4, December 1992, pp 15--17.
248
% Yannis Haralambous. DC fonts---questions and answers (II).
249
% {\it \TeX\ and TUG News} Vol. 2, No. 1, February 1993, pp 10--12.
252
% J\"org Knappen. Summary on Polish (La)\TeX. Info-TeX@SHSU.edu and
253
% TeX-Euro@vm.urz.uni-heidelberg.de, 20th Novemebr 1992.
256
% Donald E. Knuth. Computer Modern Typefaces. Computers and Typesetting
257
% Vol. E. Addison-Wesley, Reading, Massachusetts 1986.
258
% \end{thebibliography}
262
% \section{Implementation}
263
% {\small Beware: comments in this section were written by Igor Moo.}
264
% \subsection{Identification}
265
% We start the code with standard identification of the package
268
\NeedsTeXFormat{LaTeX2e}[95/06/01]
270
\ProvidesPackage{ogonek}[\filedate\space\fileversion\space
271
Provides macro `\string\k' for ogonek]
273
% \subsection{Processing options}
274
% \subsubsection{Encoding selection options}
275
% \begin{macro}{\ogonek@obsolete}
276
% In previous versions of \ogon/ options were present for selection of
277
% font encoding(s) used in a document. Now they are no longer needed since
278
% we try to guess what encodings are really used.
280
\newcommand\ogonek@obsolete[1]{%
281
\PackageWarningNoLine{ogonek}{Option #1 is now obsolete \MessageBreak
282
due to dynamic encodings testing}
284
\DeclareOption{T1}{\ogonek@obsolete{T1}}
285
\DeclareOption{OT1}{\ogonek@obsolete{OT1}}
286
\DeclareOption{OT1P}{\ogonek@obsolete{OT1P}}
287
\DeclareOption{OT4}{\ogonek@obsolete{OT4}}
291
% \subsubsection{Language selection options}
292
% \begin{macro}{\@testogonekletter}
293
% Here we define macro that will be used below to test if a ogonked
294
% letter is `legal'. Primarily we define it just to gobble it's
297
% If option \texttt{PL} is specified the macro is redefined to accept
298
% only Polish ogonked letters. Option \texttt{LT} redefines it to allow
299
% only Lithuanian letters.
301
% If both options were specified all aAeEiIuU letters will be allowed
302
% since in \LaTeXe\ options are processed in order of
303
% declaration and LT overwrites PL.
305
\let\@testogonekletter\@gobble
307
\def\@testogonekletter#1{%
308
\ifx a#1\else \ifx A#1\else
309
\ifx e#1\else \ifx E#1\else
310
\PackageWarning{ogonek}%
311
{Unusual Polish letter #1 with ogonek}\fi
316
\def\@testogonekletter#1{%
317
\ifx a#1\else \ifx A#1\else
318
\ifx e#1\else \ifx E#1\else
319
\ifx i#1\else \ifx I#1\else
320
\ifx u#1\else \ifx U#1\else
321
\PackageWarning{ogonek}%
322
{Unusual Lithuanian letter #1 with ogonek}\fi
323
\fi \fi \fi \fi \fi \fi \fi
328
% Now we're ready to process the options
332
% \subsection{Positioning of ogonek in old fonts}
333
% This comes from L.~Holenderski's \texttt{plfonts.sty}.
334
% Positionig of ogonek for specific letters is tuned for 300dpi
335
% Computer Modern fonts, but works reasonably well with other
337
% \begin{macro}{\sob}
338
% Macro |\sob| positioning ogonek under a letter.
340
\dimendef\pl@left=0 \dimendef\pl@down=1
341
\dimendef\pl@right=2 \dimendef\pl@temp=3
343
% typeset `ogonek' box
344
\def\sob#1#2#3#4#5{% parameters: letter and fractions hl,ho,vl,vo
345
\setbox0\hbox{#1}\setbox1\hbox{$_\mathchar'454$}\setbox2\hbox{p}%
346
\pl@right=#2\wd0 \advance\pl@right by-#3\wd1
347
\pl@down=#5\ht1 \advance\pl@down by-#4\ht0
348
\pl@left=\pl@right \advance\pl@left by\wd1
349
\pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp
350
\leavevmode\kern\pl@right\lower\pl@down\box1\kern-\pl@left #1}
353
% \begin{macro}{\aob}\begin{macro}{\Aob}\begin{macro}{\eob}
354
% \begin{macro}{\Eob}\begin{macro}{\iob}\begin{macro}{\Iob}
355
% \begin{macro}{\uob}\begin{macro}{\Uob}
356
% Special positioning of ogonek for some letters
358
\def\aob{\sob a{.66}{.20}{0}{.90}}
359
\def\Aob{\sob A{.80}{.50}{0}{.90}}
360
\def\eob{\sob e{.50}{.35}{0}{.93}}
361
\def\Eob{\sob E{.60}{.35}{0}{.90}}
362
\def\iob{\sob i{.66}{.20}{0}{.90}}
363
\def\Iob{\sob I{.80}{.50}{0}{.90}}
364
\def\uob{\sob u{.66}{.20}{0}{.90}}
365
\def\Uob{\sob U{.60}{.35}{0}{.90}}
367
% \end{macro}\end{macro}\end{macro}\end{macro}
368
% \end{macro}\end{macro}\end{macro}\end{macro}
370
% \begin{macro}{\@iIuUogonek}
371
% \begin{macro}{\@oldfontsogonek}
372
% Below we define macros producing ogonek in encodings OT4 (OT1P) (this
373
% needs special positioning of ogonek only for iIuU since for aAeE we
374
% have composities) and OT1. This could be done in a more \LaTeX y way
375
% if we had something like \verb+\DeclareTextComposite+ allowing
376
% replacement to be macro not a single character. But we haven't.
382
\ifx U#1\Uob\else\sob {#1}{.50}{.35}{0}{.90}\fi
385
\def\@oldfontsogonek#1{%
396
% \subsection{Testing of encodings used in a document}
397
% This testing must be carried off when the document begins,
398
% since only then all used encodings are already known.
399
% We use |\AtBeginDocument| hook for that purpose.
400
% This will work unless some package loaded after \ogon/
401
% has an idea to declare encodings `at begin document' (I cannot think
402
% of any reason for that).
404
% First my favourite hack for operations on names
405
% constructed with |\csname|:
407
\newcommand\n@me[2]{\expandafter#1\csname#2\endcsname}
409
% You can not only say |\n@me\ifx{T@T1}\sth| but even |\n@me\show{a name}|
410
% or |\n@me\newcommand{and another}{...}| (sic!).
412
% The testing really starts here. If an encoding \texttt{XXX} is known
413
% a macro with name |\T@XXX| is defined. In that way we check
414
% what encodings are in use.
416
% For every encoding found we define |\k| to
417
% test if accentee is legal and put appropriate kind of ogonek.
421
% We don't make any changes for T1, since all we need is defined by
424
\n@me\ifx{T@T1}\relax \else \PackageInfo{ogonek}{T1 is known} \fi
426
% For OT1 encoding we define ogonek as |\@oldfontsogonek|
428
\n@me\ifx{T@OT1}\relax
429
\else \PackageInfo{ogonek}{Defining ogonek for OT1}
430
\DeclareTextCommand\k{OT1}[1]{%
431
\@testogonekletter{#1}\@oldfontsogonek{#1}}
434
% For OT4 or OT1P |\k| won't know how to put ogonek under aAeE,
435
% but we have composities for that cases.
437
% We are lucky that ogonek is always allowed under aAeE. Otherwise
438
% we would have to invent a way to incorporate test into composities.
440
\n@me\ifx{T@OT4}\relax
441
\else \PackageInfo{ogonek}{Defining ogonek for OT4}
442
\DeclareTextCommand\k{OT4}[1]{%
443
\@testogonekletter{#1}\@iIuUogonek{#1}}
444
\DeclareTextComposite\k{OT4}{a}{"A1}
445
\DeclareTextComposite\k{OT4}{A}{"81}
446
\DeclareTextComposite\k{OT4}{e}{"A6}
447
\DeclareTextComposite\k{OT4}{E}{"86}
449
\n@me\ifx{T@OT1P}\relax
450
\else \PackageInfo{ogonek}{Defining ogonek for OT1P}
451
\DeclareTextCommand\k{OT1P}[1]{%
452
\@testogonekletter{#1}\@iIuUogonek{#1}}
453
\DeclareTextComposite\k{OT1P}{a}{"A1}
454
\DeclareTextComposite\k{OT1P}{A}{"81}
455
\DeclareTextComposite\k{OT1P}{e}{"A6}
456
\DeclareTextComposite\k{OT1P}{E}{"86}
466
% \iffalse metaquestion
467
% this definition intended for T1 encoding differs from
468
% `official' lxiie version. why? IM
469
%\def\@gonekaccent #1{%
470
% \setbox\z@\hbox {#1}\ifdim\ht\z@=1ex\accent12 #1%
471
% \else {\ooalign{\unhbox\z@\crcr\hidewidth\char12\hidewidth}}\fi}
477
%% End of file `ogonek.sty'.