summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/ibycus-babel
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-11-23 20:06:01 +0000
committerNorbert Preining <preining@logic.at>2007-11-23 20:06:01 +0000
commitf385fa454ee3d165f431d1a11e72d5d630bd5289 (patch)
treefe4a62af5e8a2e201e5abc14de5b94decba2a452 /Master/texmf-dist/source/latex/ibycus-babel
parent103fa01eacdf470af9d47acbbd0f8cd3add32dcf (diff)
update ibycus-babel (very old change from 2005)
git-svn-id: svn://tug.org/texlive/trunk@5571 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/ibycus-babel')
-rw-r--r--Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.dtx252
-rw-r--r--Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.ins3
2 files changed, 175 insertions, 80 deletions
diff --git a/Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.dtx b/Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.dtx
index f9049e35198..e3d9face85b 100644
--- a/Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.dtx
+++ b/Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.dtx
@@ -1,8 +1,8 @@
-% \CheckSum{180}
+% \CheckSum{202}
% \iffalse
%
% file `ibycus.dtx'.
-% Copyright (c) 2004 Peter Heslin, Walter Schmidt
+% Copyright (c) 2004, 2005 Peter Heslin, Walter Schmidt
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -19,18 +19,20 @@
% This work consists of the files
% ibycus-babel.dtx, ibycus-babel.ins, ibyhyph.pl,
% and the derived files
-% ibycus.ldf and ufib.fd
+% ibycus.ldf, lgienc.def and lgifib.fd.
%
%<*driver>
\ProvidesFile{ibycus-babel.dtx}
%</driver>
%
%<ibycus>\ProvidesLanguage{ibycus}
-%<ufib>\ProvidesFile{ufib.fd}%
- [2004/11/19 v2.4 (PH/WaS)]
+%<lgifib>\ProvidesFile{lgifib.fd}%
+%<lgienc>\ProvidesFile{lgienc.def}%
+ [2005/11/23 v3.0 (PH/WaS)]
%
%<*driver>
\documentclass{ltxdoc}
+\usepackage{hyperref}
\usepackage{url}
\OnlyDescription
\begin{document}
@@ -41,7 +43,7 @@
% \fi
%
% \GetFileInfo{ibycus-babel.dtx}
-% \title{Typesetting ancient Greek\\ using the Ibycus fonts with the Babel system}
+% \title{Typesetting ancient Greek\\ using Ibycus-encoded fonts with the Babel system}
% \author{Peter Heslin\thanks{\texttt{p.j.heslin@dur.ac.uk}} \and Walter Schmidt\thanks{\texttt{w-a-schmidt@gmx.net}}}
% \date{\fileversion{} -- \filedate}
% \makeatletter
@@ -53,19 +55,20 @@
% \sloppy
%
% \section{Overview}
-% The present document describes a new interface for the Ibycus fonts
+% The present document describes a new interface for Greek fonts with
+% the so-called `Ibycus' encoding,
% to use them in conjunction with the Babel system for multilanguage typesetting.
% It constitutes an alternative to the well-known macro packages
-% |ibycus4.sty| and |psibycus.sty|, which are distributed together with the
-% fonts. The main advantage over these packages is that automatic
+% |ibycus4.sty| and |psibycus.sty|, which are distributed together with
+% Pierre A. MacKay's original Ibycus fonts.
+% The main advantage over these packages is that automatic
% hyphenation is provided for the Greek language. Notice, however, that
% a \TeX\ program with the so-called \eTeX\ extensions is required.
-%
% The implementation is available for \LaTeXe\ only; there are no
% corresponding macro files for plain~\TeX\ or \LaTeX~2.09.
%
%
-% \section{{\boldmath Why \eTeX?}}
+% \section{\texorpdfstring{{\boldmath Why \eTeX?}}{Why \eTeX?}}
% With `ordinary' \TeX,
% hyphenation of Greek words will not work properly, if the end of a mixed Greek
% and Latin-alphabet paragraph does not coincide with the end of the
@@ -83,8 +86,8 @@
% All up-to-date \LaTeX\ systems are now built upon an \eTeX\ typesetting
% engine, rather than on the classical \TeX\ program.
%
-% \section{Usage}
-% The Ibycus fonts are assigned a (pseudo-)language named |ibycus|,
+% \section{Basic usage}
+% The Greek fonts are assigned a (pseudo-)language named |ibycus|,
% which can be used (almost) like any other language supported by
% Babel. To enable the use of this language in your document, specify
% it as an option to the Babel package just as you would do for any
@@ -100,9 +103,8 @@
% And, of course, do not use it together with the packages |ibycus4|
% or |psibycus|.
%
-% The language |ibycus| should be selected only locally. Either use
-% the |ibycus| environment
-% to typeset larger passages of Greek text:
+% The language |ibycus| should be selected only \emph{locally}.
+% Either use the |ibycus| environment to typeset larger passages of Greek text:
% \begin{verse}
% |\begin{ibycus} | \\
% | (Hrodo'tou Qouri'ou i(stori'hs a)po'decis h('de, | \\
@@ -113,7 +115,7 @@
% or use the command |\ibygr|, which is more appropriate for
% short pieces of Greek within Latin-written text:
% \begin{verse}
-% |blah blah \ibygr{a)rxai=a gra'mmata} blah...|
+% |... Latin, \ibygr{a)rxai=a gra'mmata} and Latin again|
% \end{verse}
% In fact, the environment |ibycus| is nothing but an abbreviation for
% Babel's |otherlanguage| environment with the option |ibycus|, and
@@ -124,7 +126,12 @@
% notation is described in the documentation that comes with the Ibycus
% fonts.
%
-% The typeface Ibycus and the related input notation can also be
+% Notice a particular difference between |ibycus| and other languages
+% of the Babel system: Switching to the language |ibycus| selects
+% both a particular font encoding (|LGI|) and a particular font family (by default |fib|),
+% regardless of the font family that was active before.
+%
+% Greek fonts and the related input notation can also be
% selected without changing the hyphenation tables; to do so, use the
% declaration |\ibycustext| or the text-generating command
% |\textibycus{...}|. These macros exist more or less only as a
@@ -135,16 +142,11 @@
% Greek text (without, however, changing the hyphenation table), use
% the declaration |\latintext| or the text-generating macro
% |\textlatin{...}|. When Babel is loaded with the option |ibycus|,
-% these commands not only switch back to the default latin text font
-% encoding as usual; they also select the default roman font family
-% (just like |\rmfamily| or |\textrm|).
-%
-% Notice a particular difference between |ibycus| and other languages
-% of the Babel system: Switching to the language |ibycus| selects
-% both a particular font encoding (|U|) and a particular font family (|fib|),
-% regardless of the font family that was active before.
+% these commands not only switch back to the default Latin font
+% encoding as usual; they also select the default font family of the
+% document.
%
-% The Ibycus typeface provides a few traditional text-editor symbols
+% Ibycus-encoded fonts provide a few traditional text-editor symbols
% for critical editions:
%
% \begin{center}
@@ -163,14 +165,36 @@
% However, this macro belongs to the \LaTeX\ kernel and should not be redefined,
% so the name |\sdagger| is now used for the Ibycus-specific symbol.
%
-% \section{Scaling the Ibycus fonts}
-% The Ibycus typeface was primarily designed to go with Computer Modern;
-% yet it can be used with other Latin typefaces, too. In this case it
-% may sometimes be useful to typeset the Ibycus fonts a little bit larger
-% or smaller, to make them blend better with the Latin typeface.
-% This can be accomplished through the macro |\setgreekfontsize|. For instance,
-% |\setgreekfontsize{1.05}| will enlarge the Ibycus fonts by 5\%, as compared
-% with their nominal size. The command can be issued in the preamble only.
+%
+% \section{Using alternative typefaces}
+% \label{sec:typefaces}
+% By default, Pierre A. MacKay's original Ibycus font family is used to typeset
+% the Greek passages.
+% From version 3.0 on the Ibucus-Babel interface supports also other font families
+% with the same encoding.
+%
+% To select the Greek font family manually, issue the command
+% \begin{verse}
+% |\renewcommand{\ibycusdefault}|\marg{family}
+% \end{verse}
+% after loading of Babel---provided, of course, that the indicated font family is
+% indeed available with the Ibycus encoding LGI.
+% Macro packages to support alternative font familes in general may already include
+% this action; see the related documentation.
+%
+% If you intend to write a class or package which is to change the font family
+% used by the Ibycus-Babel interface, or if you want to implement a font family
+% with Ibycus encoding, see the documentation of the source code,
+% particularly the last section.
+%
+%
+% \section{Scaling the Greek fonts}
+% It may sometimes be useful to typeset the Greek fonts a little bit larger
+% % or smaller (as compared with their `natural' size), to make them blend better
+% with the typeface used for Latin.
+% This can be accomplished through the macro |\setgreekfontscale|. For instance,
+% |\setgreekfontscale{1.05}| will enlarge the Greek fonts by 5\%.
+% The command can be issued in the preamble only.
%
%
% \section{The hyphenation patterns}
@@ -179,7 +203,9 @@
% Dimitrios Filippou's \path{GRAhyph4.tex}, which can be found in the
% CTAN directory \path{language/hyphenation/elhyphen}. This is an
% improved set of hyphenation patterns for ancient Greek with LGR encoding;
-% Babel does not currently use it by default.
+% Babel does not currently use it by default. With version~3 of the
+% Ibycus-Babel interface, additional manual patches were applied to the
+% patterns, in order to fix a bug regarding the use of `lunate sigmas'.
%
% Dimitrios Filippou's improved hyphenation patterns discover far more
% hyphenation points than the default Babel patterns, and are more
@@ -199,7 +225,7 @@
%
% Filippou's patterns also include legal hyphenation points
% immediately before the last letter of a word. However, the
-% Ibycus-Babel interface suppreses them, since they are not only ugly
+% Ibycus-Babel interface suppresses them, since they are not only ugly
% but also of little practical use.
%
% Please contact Peter Heslin if you come across any words that
@@ -210,28 +236,31 @@
%
% \section{Problems and deficiencies}
% \begin{itemize}
-% \item After a sequence such as
+% \item Globally changing the language to |ibycus|, i.e., a sequence such as
% \begin{verse}
% |\selectlanguage{ibycus}| \\
% \textit{Greek text\dots} \\
% |\selectlanguage{|\textit{anything}|}| \\
% \end{verse}
-% the font family is changed to the default roman typeface,
-% just as after |\rmfamily|. This can be avoided by selecting
+% may have unwanted effects, for instance on the font selection.
+% This can be avoided by selecting
% the language |ibycus| only within a group or environment,
% or by using the commands |\ibygr| or |\foreignlanguage|.
-% \item The command |\setgreekfontscale| has no effect
+% \item The behavior of the existing commands \cmd{\textlatin}
+% and \cmd{\latintext} is altered:
+% They will switch to the the default font family of the document,
+% rather than leaving the current font family untouched.
+% \item The command \cmd{\setgreekfontscale} has no effect
% when the Ibycus fonts are already in use;
% this situation is, however, rather unlikely in the preamble.
% \end{itemize}
%
%
-% \section{Changes since version 1.5}
-% The names of several commands and environments have been changed:
-%
+% \section{Incompatible changes over version 1.5}
+% The names of several commands and environments have changed:
% \begin{center}
% \begin{tabular}{ll}
-% Version 1.5: & Version 2.4 \\ \hline
+% Version 1.5: & Version 2.4 and later \\ \hline
% \cmd{\gk} & \cmd{\ibygr} \\
% \texttt{greek} (environment) & \texttt{ibycus} \\
% \cmd{\ibylatintext} & \cmd{\latintext} \\
@@ -276,6 +305,26 @@
\adddialect\l@ibycus0\fi
% \end{macrocode}
%
+% We are going to load the file providing the definition of the LGI encoding,
+% see section \ref{sec:lgienc}.
+% The error handling has been adopted from Babel's (LGR) Greek module,
+% in order to ensure consistent behavior:
+% \begin{macrocode}
+\InputIfFileExists{lgienc.def}{%
+ \message{Loading the definitions for the Greek font encoding LGI}}{%
+ \errhelp{I can't find the lgienc.def file for the Greek fonts}%
+ \errmessage{Since I do not know what the LGI encoding means^^J
+ I can't typeset Greek.^^J
+ I stop here, while you get a suitable lgienc.def file}\@@end
+ }
+% \end{macrocode}
+%
+% The font family to be used for Greek passages is initialized to |fib|,
+% unless it has been defined already by a preceding package:
+% \begin{macrocode}
+\providecommand{\ibycusdefault}{fib}
+% \end{macrocode}
+%
% We declare a command |\ibygr| and an environment |ibycus| to make
% entering of Greek text easier, as compared with Babel's macros:
% \begin{macrocode}
@@ -290,27 +339,27 @@
% does not really make sure that the fonts have not yet been loaded.
% \begin{macrocode}
\newcommand*{\setgreekfontscale}[1]{%
- \def\fib@scale{#1}}
+ \def\ibycus@scale{#1}}
\@onlypreamble\setgreekfontscale
% \end{macrocode}
-% The macro |\fib@scale|, which is defined here, will be evaluated
-% in the file \texttt{ufib.fd}, see below.
+% The macro |\ibycus@scale|, which is defined here, will be evaluated
+% in the font definition files of LGI-encoded fonts; see \path{lgifib.fd} below.
%
% All text-editor symbols of the old package |ibycus4| are provided.
% However, |\dagger| is named |\sdagger| now.
% \begin{macrocode}
\newcommand{\braceleft}{%
- {\fontencoding{U}\fontfamily{fib}\selectfont\char'333}}
+ {\fontencoding{LGI}\fontfamily{\ibycusdefault}\selectfont\char'333}}
\newcommand{\braceright}{%
- {\fontencoding{U}\fontfamily{fib}\selectfont\char'337}}
+ {\fontencoding{LGI}\fontfamily{\ibycusdefault}\selectfont\char'337}}
\newcommand{\bracketleftbt}{%
- {\fontencoding{U}\fontfamily{fib}\selectfont\char'363}}
+ {\fontencoding{LGI}\fontfamily{\ibycusdefault}\selectfont\char'363}}
\newcommand{\bracketrightbt}{%
- {\fontencoding{U}\fontfamily{fib}\selectfont\char'367}}
+ {\fontencoding{LGI}\fontfamily{\ibycusdefault}\selectfont\char'367}}
\newcommand{\sdagger}{%
- {\fontencoding{U}\fontfamily{fib}\selectfont\char'375}}
+ {\fontencoding{LGI}\fontfamily{\ibycusdefault}\selectfont\char'375}}
\newcommand{\dbldagger}{%
- {\fontencoding{U}\fontfamily{fib}\selectfont\char'376}}
+ {\fontencoding{LGI}\fontfamily{\ibycusdefault}\selectfont\char'376}}
% \end{macrocode}
%
% Finally, the code to integrate the pseudo-language Ibycus into Babel.
@@ -320,25 +369,30 @@
\def\captionsibycus{}
\def\dateibycus{}
% \end{macrocode}
-% |\latintext| needs to be changed slightly, as compared with the
-% default definition from the Babel kernel. The macro
-% must not only switch back to the default Latin font encoding;
-% it must also switch back to an appropriate font \emph{family}, since the family
-% is always changed to |fib| within the Greek passages.
+%
+% \cmd{\latintext} needs to be extended, as compared with the default definition
+% provided by the Babel kernel. The macro must not only switch to the default
+% Latin font \emph{encoding}; in addition to that, it must also switch to an appropriate
+% font \emph{family}, because the family is always changed to |\ibycusdefault|
+% within the Greek passages. While v2.0 would select |\rmdefault|,
+% this has been changed to |\familydefault| now.
+% Since |\latintext| is a protected command, we extend actually the
+% `unprotected' command \verb*|\latintext |:
% \begin{macrocode}
-\DeclareRobustCommand{\latintext}{%
- \fontencoding{\latinencoding}\fontfamily{\rmdefault}\selectfont
- \def\encodingdefault{\latinencoding}}
+\expandafter\let\expandafter\iby@latintext\csname latintext \endcsname
+\@namedef{latintext }{\fontfamily{\familydefault}\iby@latintext}
% \end{macrocode}
-% Should we save and restore the actual family name,
-% instead of simply forcing |\rmdefault|?
+%
+% \cmd{\ibycustext} is modelled after Babel's original \cmd{\greektext}.
+% However, we do not alter \cmd{\encodingdefault} any longer, since
+% doing so has turned out to be wrong. (See the \LaTeX\ bug babel/3796.)
+% As long as |ibycus| is never used as the default language
+% of a document, there is no need to touch \cmd{\encodingdefault} at all.
% \begin{macrocode}
\DeclareRobustCommand{\ibycustext}{%
- \fontencoding{U}\fontfamily{fib}\selectfont
- \def\encodingdefault{U}}
+ \fontencoding{LGI}\fontfamily{\ibycusdefault}\selectfont}
\DeclareRobustCommand{\textibycus}[1]{\leavevmode{\ibycustext #1}}
\addto\extrasibycus{\ibycustext}
-\addto\noextrasibycus{\latintext}
\addto\extrasibycus{%
\babel@savevariable{\lccode`\(}\lccode`\(=`\(%
\babel@savevariable{\lccode`\)}\lccode`\)=`\)%
@@ -347,16 +401,41 @@
\babel@savevariable{\lccode`\`}\lccode`\`=`\`%
\babel@savevariable{\lccode`\'}\lccode`\'=`\'%
\babel@savevariable{\lccode`\+}\lccode`\+=`\+}
+% \end{macrocode}
+% At the end of a Greek passage, we are going to issue the new command \cmd{\noibycustext}.
+% In contrast to \cmd{\latintext}, it does not alter |\encodingdefault|.
+% \begin{macrocode}
+\DeclareRobustCommand{\noibycustext}{%
+ \fontencoding{\latinencoding}\fontfamily{\familydefault}\selectfont}
+\addto\noextrasibycus{\noibycustext}
\ldf@finish{ibycus}
%</ibycus>
% \end{macrocode}
+% Should we save and restore the actual family name,
+% instead of simply forcing |\familydefault|?
+%
+% \subsection{The encoding definition file \texttt{lgienc.def}}
+% \label{sec:lgienc}
+% From v3.0 on, the Ibycus-encoded fonts are assigned the encoding LGI, even though
+% there are currently no encoding-specific commands declared. Rationale:
+% Future alternative font families with Ibycus encoding are using U already for other
+% purposes such as non-alphabetic symbols. As usual, the encoding is declared in an
+% external file.
+% \begin{macrocode}
+%<*lgienc>
+\DeclareFontEncoding{LGI}{}{}
+\DeclareFontSubstitution{LGI}{fib}{m}{n}
+\DeclareErrorFont{LGI}{fib}{m}{n}{10}
+%</lgienc>
+% \end{macrocode}
%
-% \subsection{The \texttt{.fd} file}
+%
+% \subsection{The font definition file \texttt{lgifib.fd}}
% We provide a correct \texttt{fd} file of our own for the Ibycus font family,
% instead of relying on the weird file from the Ibycus4 collection,
% and we use only those fonts, that exist also in Postscript format.
% \begin{macrocode}
-%<*ufib>
+%<*lgifib>
\ifx\aliasfont\@undefined\else\ifx\aliasfont\relax\else
% \end{macrocode}
% This piece of code is executed with V\TeX\ only.
@@ -368,21 +447,36 @@
\endgroup
\fi\fi
% \end{macrocode}
+% Now let's evaluate \cmd{\ibycus@scale} to determine the optional
+% scaling parameter \cmd{\ibycus@@scale}, which will be applied in the
+% font shape declarations:
% \begin{macrocode}
-\expandafter\ifx\csname fib@scale\endcsname\relax
- \let\fib@@scale\@empty
+\expandafter\ifx\csname ibycus@scale\endcsname\relax
+ \let\ibycus@@scale\@empty
\else
- \edef\fib@@scale{s*[\csname fib@scale\endcsname]}%
+ \edef\ibycus@@scale{s*[\csname ibycus@scale\endcsname]}%
\fi
-\DeclareFontFamily{U}{fib}{}
-\DeclareFontShape{U}{fib}{m}{n}{<-> \fib@@scale fibr84}{}
-\DeclareFontShape{U}{fib}{m}{sl}{<-> \fib@@scale fibo84}{}
-\DeclareFontShape{U}{fib}{b}{n}{<-> \fib@@scale fibb84}{}
-\DeclareFontShape{U}{fib}{m}{it}{<-> ssub * fib/m/sl}{}
-\DeclareFontShape{U}{fib}{bx}{n}{<-> ssub * fib/b/n}{}
-%</ufib>
+\DeclareFontFamily{LGI}{fib}{}
+\DeclareFontShape{LGI}{fib}{m}{n}{<-> \ibycus@@scale fibr84}{}
+\DeclareFontShape{LGI}{fib}{m}{sl}{<-> \ibycus@@scale fibo84}{}
+\DeclareFontShape{LGI}{fib}{b}{n}{<-> \ibycus@@scale fibb84}{}
+\DeclareFontShape{LGI}{fib}{m}{it}{<-> ssub * fib/m/sl}{}
+\DeclareFontShape{LGI}{fib}{bx}{n}{<-> ssub * fib/b/n}{}
+%</lgifib>
% \end{macrocode}
%
+%
+%
+% \subsection{Notes for class and package writers}
+% To change the font family used for Greek passages, redefine the
+% macro \cmd{\ibycusdefault} accordingly. Macro packages should use |\def| rather
+% than |\renewcommand|; thus, they can be loaded before as well as after
+% \path{ibycus.ldf}.
+%
+% To make the command \cmd{\setgreekfontscale} work, font definition files for
+% LGI-encoded font families must evaluate the macro \cmd{\ibycus@scale}
+% in the same way as the above \path{lgifib.fd}.
+%
% \Finale
%
% \iffalse
diff --git a/Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.ins b/Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.ins
index 7c44023af54..a146790579c 100644
--- a/Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.ins
+++ b/Master/texmf-dist/source/latex/ibycus-babel/ibycus-babel.ins
@@ -4,7 +4,8 @@
\generate{%
\file{ibycus.ldf}{\from{ibycus-babel.dtx}{ibycus}}
- \file{ufib.fd}{\from{ibycus-babel.dtx}{ufib}}
+ \file{lgifib.fd}{\from{ibycus-babel.dtx}{lgifib}}
+ \file{lgienc.def}{\from{ibycus-babel.dtx}{lgienc}}
}
\endbatchfile