Created
February 23, 2012 18:40
-
-
Save arnested/1894271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% \iffalse meta-comment | |
% | |
% Copyright 1989-2004 Johannes L. Braams and any individual authors | |
% listed elsewhere in this file. All rights reserved. | |
% | |
% This file is part of the Babel system. | |
% -------------------------------------- | |
% | |
% It may be distributed and/or modified under the | |
% conditions of the LaTeX Project Public License, either version 1.3 | |
% of this license or (at your option) any later version. | |
% The latest version of this license is in | |
% http://www.latex-project.org/lppl.txt | |
% and version 1.3 or later is part of all distributions of LaTeX | |
% version 2003/12/01 or later. | |
% | |
% This work has the LPPL maintenance status "maintained". | |
% | |
% The Current Maintainer of this work is Johannes Braams. | |
% | |
% The list of all files belonging to the LaTeX base distribution is | |
% given in the file `manifest.bbl. See also `legal.bbl' for additional | |
% information. | |
% | |
% The list of derived (unpacked) files belonging to the distribution | |
% and covered by LPPL is defined by the unpacking scripts (with | |
% extension .ins) which are part of the distribution. | |
% \fi | |
% \CheckSum{511} | |
% | |
% \iffalse | |
% Tell the \LaTeX\ system who we are and write an entry on the | |
% transcript. | |
%<*dtx> | |
\ProvidesFile{faroese.dtx} | |
%</dtx> | |
%<code>\ProvidesLanguage{faroese} | |
%\fi | |
%\ProvidesFile{faroese.dtx} | |
[2004/11/30 v1.1g Faroese support from the babel system] | |
%\iffalse | |
%% File faroese.dtx | |
%% Babel package for LaTeX version 2e | |
%% Copyright (C) 1989--2004 | |
%% by Johannes Braams, TeXniek | |
% | |
%% Faroese Language Definition File | |
%% Copyright (C) 1996--2004 | |
%% by Einar \'Arnason <einar@lif.hi.is> | |
%% Johannes Braams, TeXniek | |
% | |
%% Please report errors to: Einar \'Arnason | |
%% einar at lif.hi.is | |
%% or to: J.L. Braams | |
%% babel at braams.cistron.nl | |
%% | |
%% Copyright © 2003-2004, Jacob Sparre Andersen, Linux-áhugafelagið | |
% | |
%<*filedriver> | |
\documentclass{ltxdoc} | |
\usepackage[T1]{fontenc} | |
\usepackage[faroese,english]{babel} | |
\font\manual=logo10 % font used for the METAFONT logo, etc. | |
\newcommand*\MF{{\manual META}\-{\manual FONT}} | |
\newcommand*\TeXhax{\TeX hax} | |
\newcommand*\babel{\textsf{babel}} | |
\newcommand*\langvar{$\langle \it lang \rangle$} | |
\newcommand*\note[1]{} | |
\newcommand*\Lopt[1]{\textsf{#1}} | |
\newcommand*\file[1]{\texttt{#1}} | |
\begin{document} | |
\begin{center} | |
\textbf{\Large A Babel language definition file for | |
Faroese}\\[3mm]^^A\] | |
Einar \'Arnason\\ | |
\texttt{einar@lif.hi.is} | |
\end{center} | |
\DocInput{faroese.dtx} | |
\end{document} | |
%</filedriver> | |
%\fi | |
% \GetFileInfo{faroese.dtx} | |
% | |
% \section{The Faroese language} | |
% | |
% \subsection{Overview} | |
% | |
% The file \file{\filename}\footnote{The file described in this | |
% section has version number \fileversion\ and was last revised on | |
% \filedate. } defines all the language definition macros for | |
% the Faroese language | |
% | |
% Customization for the Faroese language was made following | |
% several official and semiofficial publications~\cite{74:_augl, | |
% 77:_augl,88:_reglur,94:_si,97:_forst_fs}. These publications do | |
% not always agree and we indicate those instances. | |
% | |
% For this language the character |"| is made active. In | |
% table~\ref{tab:faroese-extras} an overview is given of its | |
% purpose. | |
% \begin{table}[htb] | |
% \begin{center} | |
% \begin{otherlanguage*}{faroese} | |
% \begin{tabular}{lp{8cm}} | |
% \verb="|= & 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 a compound word mark without a breakpoint. \\ | |
% |"=| & for a compound word mark with a breakpoint, allowing | |
% hyphenation in the composing words. \\ | |
% |"`| & for Faroese left double quotes (looks like ,,). \\ | |
% |"'| & for Faroese right double quotes. \\ | |
% |">| & for Faroese `french' left double quotes | |
% (similar to $>>$).\\ | |
% |"<| & for Faroese `french' right double quotes | |
% (similar to $<<$).\\ | |
% |"o| & for old Faroese "o \\ | |
% |"O| & for old Faroese "O \\ | |
% |"ó| & for old Faroese "ó \\ | |
% |"Ó| & for old Faroese "Ó \\ | |
% |"e| & for old Faroese "e \\ | |
% |"E| & for old Faroese "E \\ | |
% |"é| & for old Faroese "é \\ | |
% |"É| & for old Faroese "É \\ | |
% |\tala| & for typesetting numbers\\ | |
% |\grada| & for the `degree' symbol\\ | |
% |\gradur| & for `degrees', e.g. 5~\gradur C\\ | |
% |\upp| & for textsuperscript \\ | |
% \end{tabular} | |
% \end{otherlanguage*} | |
% \caption{The shorthands and extra definitions made | |
% by \file{faroese.ldf}}\label{tab:faroese-extras} | |
% \end{center} | |
% \end{table} | |
% The shorthands in table~\ref{tab:faroese-extras} can also be | |
% typeset by using the commands in | |
% table~\ref{tab:faroese-commands}. | |
% \begin{table}[htb] | |
% \begin{center} | |
% \begin{otherlanguage*}{faroese} | |
% \begin{tabular}{lp{8cm}} | |
% |\ilqq| & for Faroese left double quotes | |
% (looks like ,,). \\ | |
% |\irqq| & for Faroese right double quotes | |
% (looks like ``). \\ | |
% |\ilq| & for Faroese left single quotes | |
% (looks like ,). \\ | |
% |\irq| & for Faroese right single quotes | |
% (looks like `). \\ | |
% |\iflqq| & for Faroese `french' left double quotes | |
% (similar to $>>$).\\ | |
% |\ifrqq| & for Faroese `french' right double quotes | |
% (similar to $<<$).\\ | |
% |\ifrq| & for Faroese `french' right single quotes | |
% (similar to $<$).\\ | |
% |\iflq| & for Faroese `french' left single quotes | |
% (similar to $>$). \\ | |
% |\dq| & the original quotes character (|"|). \\ | |
% |\oob| & for old Faroese "o \\ | |
% |\Oob| & for old Faroese "O \\ | |
% |\ooob| & for old Faroese "ó \\ | |
% |\OOob| & for old Faroese "Ó \\ | |
% |\eob| & for old Faroese "e \\ | |
% |\Eob| & for old Faroese "E \\ | |
% |\eeob| & for old Faroese "é \\ | |
% |\EEob| & for old Faroese "É \\ | |
% \end{tabular} | |
% \end{otherlanguage*} | |
% \caption{Commands which produce quotes and old Faroese | |
% diacritics, defined by | |
% \file{faroese.ldf}}\label{tab:faroese-commands} | |
% \end{center} | |
% \end{table} | |
% | |
% \begin{thebibliography}{1} | |
% | |
% \bibitem{88:_reglur} | |
% Alþingi. | |
% \newblock {\em Reglur um frágang þingskjala og prentun umræðna}, | |
% 1988. | |
% | |
% \bibitem{74:_augl} | |
% Auglýsing um greinarmerkjasetningu. | |
% \newblock Stj.tíð B, nr. 133/1974, 1974. | |
% | |
% \bibitem{77:_augl} | |
% Auglýsing um breyting auglýsingu nr. 132/1974 um íslenska | |
% stafsetningu. | |
% \newblock Stj.tíð B, nr. 261/1977, 1977. | |
% | |
% \bibitem{unknown72:_first_gramm_treat} | |
% Einar Haugen, editor. | |
% \newblock {\em First Grammatical Treatise}. | |
% \newblock Longman, London, 2 edition, 1972. | |
% | |
% \bibitem{97:_forst_fs} | |
% Staðlaráð Íslands og Fagráð í upplýsingatækni, Reykjavík. | |
% \newblock {\em Forstaðall FS 130:1997}, 1997. | |
% | |
% \bibitem{94:_si} | |
% STRÍ Staðlaráð Íslands. | |
% \newblock {\em SI - kerfið}, 2 edition, 1994. | |
% | |
% \end{thebibliography} | |
% | |
% \StopEventually{} | |
% | |
% | |
% \subsection{\TeX{}nical details} | |
% | |
% When this file was read through the option \Lopt{faraoese} we make | |
% it behave as if \Lopt{faroese} was specified. | |
% | |
% \begin{macrocode} | |
\def\bbl@tempa{faroese} | |
\ifx\CurrentOption\bbl@tempa | |
\def\CurrentOption{faroese} | |
\fi | |
% \end{macrocode} | |
% | |
% The macro |\LdfInit| takes care of preventing that this file is | |
% loaded more than once, checking the category code of the | |
% \texttt{@} sign, etc. | |
% \begin{macrocode} | |
%<*code> | |
\LdfInit\CurrentOption{captions\CurrentOption} | |
% \end{macrocode} | |
% | |
% When this file is read as an option, i.e., by the |\usepackage| | |
% command, \texttt{faroese} will be an `unknown' language, so we | |
% have to make it known. So we check for the existence of | |
% |\l@faroese| to see whether we have to do something here. | |
% | |
% \begin{macrocode} | |
\ifx\l@faroese\@undefined | |
\@nopatterns{Faroese} | |
\adddialect\l@faroese0 | |
\fi | |
% \end{macrocode} | |
% | |
% \begin{macro}{\if@Two@E} | |
% We will need a new `if' : |\if@Two@E| is true if and only if | |
% \LaTeXe{} is running \emph{not} in compatibility mode. It is | |
% used in the definitions of the command |\tala| and |\upp|. | |
% The definition is somewhat complicated, due to the fact that | |
% |\if@compatibility| is not recognized as a |\if| in | |
% \LaTeX-2.09 based formats. | |
% \begin{macrocode} | |
\newif\if@Two@E \@Two@Etrue | |
\def\@FI@{\fi} | |
\ifx\@compatibilitytrue\@undefined | |
\@Two@Efalse \def\@FI@{\relax} | |
\else | |
\if@compatibility \@Two@Efalse \fi | |
\@FI@ | |
% \end{macrocode} | |
% \end{macro} | |
% | |
% | |
% \begin{macro}{\extrasfaroese} | |
% \begin{macro}{\noextrasfaroese} | |
% | |
% The macro |\extrasfaroese| | |
% will perform all the extra definitions needed for the Faroese | |
% language. The macro |\noextrasfaroese| is used to cancel the | |
% actions of |\extrasfaroese|. | |
% | |
% For Faroese the \texttt{"} character is | |
% made active. This is done once, later on its definition may vary. | |
% \begin{macrocode} | |
\initiate@active@char{"} | |
\@namedef{extras\CurrentOption}{% | |
\languageshorthands{faroese}} | |
\expandafter\addto\csname extras\CurrentOption\endcsname{% | |
\bbl@activate{"}} | |
% \end{macrocode} | |
% Don't forget to turn the shorthands off again. | |
% \begin{macrocode} | |
\addto\noextrasfaroese{\bbl@deactivate{"}} | |
% \end{macrocode} | |
% | |
% The faroese hyphenation patterns can be used with | |
% |\lefthyphenmin| and |\righthyphenmin| set to~2. | |
% \begin{macrocode} | |
\providehyphenmins{\CurrentOption}{\tw@\tw@} | |
% \end{macrocode} | |
% \end{macro} | |
% \end{macro} | |
% | |
% The code above is necessary because we need an extra active | |
% character. This character is then used as indicated in | |
% table~\ref{tab:faroese-commands}. | |
% | |
% To be able to define the function of |"|, we first define a | |
% couple of `support' macros. | |
% | |
% \subsection{Captionnames and date} | |
% | |
% The next step consists of defining the Faroese equivalents for | |
% the \LaTeX{} captionnames. | |
% | |
% \begin{macro}{\captionsfaroese} | |
% The macro |\captionsfaroese| will define all strings used | |
% used in the four standard document classes provided | |
% with \LaTeX. | |
% \begin{macrocode} | |
\@namedef{captions\CurrentOption}{% | |
\def\prefacename{Form^^e1li}% | |
\def\refname{Heimildir}% | |
\def\abstractname{^^datdr^^e1ttur}% | |
\def\bibname{Heimildir}% | |
\def\chaptername{Kapittul}% | |
\def\appendixname{Vi^^f0auki}% | |
\def\contentsname{Innihaldsyvirlit}% | |
\def\listfigurename{Myndaskr^^e1}% | |
\def\listtablename{T^^f6fluskr^^e1}% | |
\def\indexname{Atri^^f0isor^^f0askr^^e1}% | |
\def\figurename{Mynd}% | |
\def\tablename{Tafla}% | |
\def\partname{Hluti}% | |
\def\enclname{Hj^^e1lagt}% | |
\def\ccname{Samrit}% | |
\def\headtoname{Til:}% in letter | |
\def\pagename{Bla^^f0s^^ed^^f0a}% | |
\def\seename{Sj^^e1}% | |
\def\alsoname{Sj^^e1 einnig}% | |
\def\proofname{S^^f6nnun}% | |
\def\glossaryname{Or^^f0al^^fdsingar}% <-- Needs translation | |
} | |
% \end{macrocode} | |
% \end{macro} | |
% | |
% \begin{macro}{\datefaroese} | |
% The macro |\datefaroese| redefines the command |\today| | |
% to produce Faroese dates. | |
% \begin{macrocode} | |
\def\datefaroese{% | |
\def\today{\number\day.~\ifcase\month\or | |
januar\or februar\or mars\or apr^^edl\or mai\or juni\or | |
juli\or august\or september\or oktober\or november\or desember\fi | |
\space\number\year}} | |
% \end{macrocode} | |
% \end{macro} | |
% | |
% | |
% \subsection{Faroese quotation marks} | |
% | |
% | |
% \begin{macro}{\dq} | |
% We save the original double quote character in |\dq| to keep | |
% it available, the math accent |\"| can now be typed as |"|. | |
% \begin{macrocode} | |
\begingroup \catcode`\"12 | |
\def\x{\endgroup | |
\def\@SS{\mathchar"7019 } | |
\def\dq{"}} | |
\x | |
% \end{macrocode} | |
% \end{macro} | |
% | |
% Now we can define the faroese and faroese `french' quotes. | |
% The faroese `french' guillemets are the reverse of french | |
% guillemets. We define single faroese `french' quotes for | |
% compatibility. Shorthands are provided for a number of different | |
% quotation marks, which make them useable both outside and | |
% inside mathmode. | |
% | |
% \begin{macrocode} | |
\let\ilq\grq | |
\let\irq\grq | |
\let\iflq\frq | |
\let\ifrq\flq | |
\let\ilqq\glqq | |
\let\irqq\grqq | |
\let\iflqq\frqq | |
\let\ifrqq\flqq | |
% \end{macrocode} | |
% | |
% \begin{macrocode} | |
\declare@shorthand{faroese}{"`}{\glqq} | |
\declare@shorthand{faroese}{"'}{\grqq} | |
\declare@shorthand{faroese}{">}{\frqq} | |
\declare@shorthand{faroese}{"<}{\flqq} | |
% \end{macrocode} | |
% and some additional commands: | |
% \begin{macrocode} | |
\declare@shorthand{faroese}{"-}{\nobreak\-\bbl@allowhyphens} | |
\declare@shorthand{faroese}{"|}{% | |
\textormath{\nobreak\discretionary{-}{}{\kern.03em}% | |
\bbl@allowhyphens}{}} | |
\declare@shorthand{faroese}{""}{\hskip\z@skip} | |
\declare@shorthand{faroese}{"~}{\textormath{\leavevmode\hbox{-}}{-}} | |
\declare@shorthand{faroese}{"=}{\nobreak-\hskip\z@skip} | |
% \end{macrocode} | |
% | |
% | |
% \subsection{Old Faroese} | |
% \label{oldfaroese} | |
% | |
% In old Faroese some letters have special diacritical marks, | |
% described for example in \emph{First Grammatical | |
% Treatise}~\cite{unknown72:_first_gramm_treat,97:_forst_fs}. We | |
% provide these in the \texttt{T1} encoding with the `ogonek'. The | |
% ogonek is placed with the letters `o', and `O', `ó' and `Ó', `e' | |
% and `E', and `é' and `É'. Shorthands are provided for these as | |
% well. | |
% | |
% The following code by Leszek Holenderski lifted from | |
% \texttt{polish.dtx} is designed to position the diacritics | |
% correctly for every font in every size. These macros need a | |
% few extra dimension variables. | |
% | |
% \begin{macrocode} | |
\newdimen\pl@left | |
\newdimen\pl@down | |
\newdimen\pl@right | |
\newdimen\pl@temp | |
% \end{macrocode} | |
% | |
% \begin{macro}{\sob} | |
% The macro |\sob| is used to put the `ogonek' in the right | |
% place. | |
% | |
% \begin{macrocode} | |
\def\sob#1#2#3#4#5{%parameters: letter and fractions hl,ho,vl,vo | |
\setbox0\hbox{#1}\setbox1\hbox{\k{}}\setbox2\hbox{p}% | |
\pl@right=#2\wd0 \advance\pl@right by-#3\wd1 | |
\pl@down=#5\ht1 \advance\pl@down by-#4\ht0 | |
\pl@left=\pl@right \advance\pl@left by\wd1 | |
\pl@temp=-\pl@down \advance\pl@temp by\dp2 \dp1=\pl@temp | |
\leavevmode | |
\kern\pl@right\lower\pl@down\box1\kern-\pl@left #1} | |
% \end{macrocode} | |
% \end{macro} | |
% | |
% \begin{macro}{\oob} | |
% \begin{macro}{\Oob} | |
% \begin{macro}{\ooob} | |
% \begin{macro}{\OOob} | |
% \begin{macro}{\eob} | |
% \begin{macro}{\Eob} | |
% \begin{macro}{\eeob} | |
% \begin{macro}{\EEob} | |
% \begin{macrocode} | |
\DeclareTextCommand{\oob}{T1}{\sob {o}{.85}{0}{.04}{0}} | |
\DeclareTextCommand{\Oob}{T1}{\sob {O}{.7}{0}{0}{0}} | |
\DeclareTextCommand{\ooob}{T1}{\sob {^^f3}{.85}{0}{.04}{0}} | |
\DeclareTextCommand{\OOob}{T1}{\sob {^^d3}{.7}{0}{0}{0}} | |
\DeclareTextCommand{\eob}{T1}{\sob {e}{1}{0}{.04}{0}} | |
\DeclareTextCommand{\Eob}{T1}{\sob {E}{1}{0}{.04}{0}} | |
\DeclareTextCommand{\eeob}{T1}{\sob {^^e9}{1}{0}{.04}{0}} | |
\DeclareTextCommand{\EEob}{T1}{\sob {^^c9}{1}{0}{.04}{0}} | |
% \end{macrocode} | |
% \end{macro} | |
% \end{macro} | |
% \end{macro} | |
% \end{macro} | |
% \end{macro} | |
% \end{macro} | |
% \end{macro} | |
% \end{macro} | |
% | |
% \begin{macrocode} | |
\declare@shorthand{faroese}{"o}{\oob} | |
\declare@shorthand{faroese}{"O}{\Oob} | |
\declare@shorthand{faroese}{"^^f3}{\ooob} | |
\declare@shorthand{faroese}{"^^d3}{\OOob} | |
\declare@shorthand{faroese}{"e}{\eob} | |
\declare@shorthand{faroese}{"E}{\Eob} | |
\declare@shorthand{faroese}{"^^e9}{\eeob} | |
\declare@shorthand{faroese}{"^^c9}{\EEob} | |
% \end{macrocode} | |
% | |
% \subsection{Formatting numbers} | |
% \label{numbers} | |
% | |
% This section is lifted from \texttt{frenchb.dtx} by D. Flipo. | |
% In English the decimal part starts with a point and thousands | |
% should be separated by a comma: an approximation of $1000\pi$ | |
% should be inputed as |$3{,}141.592{,}653$| in math-mode and | |
% as |3,141.592,653| in text. | |
% | |
% In Faroese the decimal part starts with a comma and thousands | |
% should be separated by a space~\cite{88:_reglur} or by a | |
% period~\cite{97:_forst_fs}; we have the space. The above | |
% approximation of $1000\pi$ should be inputed as | |
% |$3\;141{,}592\;653$| in math-mode and as something like | |
% |3~141,592~653| in text. Braces are mandatory around the comma in | |
% math-mode, the reason is mentioned in the \TeX{}book p.~134: | |
% the comma is of type |\mathpunct| (thus normally followed by a | |
% space) while the point is of type |\mathord| (no space added). | |
% | |
% Thierry Bouche suggested that a second type of comma, of type | |
% |\mathord| would be useful in math-mode, and proposed to | |
% introduce a command (named |\decimalsep| in this package), | |
% the expansion of which would depend on the current language. | |
% | |
% Vincent Jalby suggested a command |\nombre| to conveniently | |
% typeset numbers: inputting |\nombre{3141,592653}| either in | |
% text or in math-mode will format this number properly according | |
% to the current language (Faroese or non-Faroese). We use | |
% |\nombre| to define command |\tala| in Faroese. | |
% | |
% |\tala| accepts an optional argument which happens to be | |
% useful with the extension `dcolumn', it specifies the decimal | |
% separator used in the \emph{source code}: | |
% |\newcolumntype{d}{D{,}{\decimalsep}{-1}}| \\ | |
% |\begin{tabular}{|d|}\hline | \\ | |
% | 3,14 \\ | \\ | |
% | \tala[,]{123,4567} \\ | \\ | |
% | \tala[,]{9876,543}\\\hline| \\ | |
% |\end{tabular} | \\ | |
% will print a column of numbers aligned on the decimal point | |
% (comma or point depending on the current language), each slice | |
% of 3 digits being separated by a space or a comma according to | |
% the current language. | |
% | |
% \begin{macro}{\decimalsep} | |
% \begin{macro}{\thousandsep} | |
% We need a internal definition, valid in both text and math-mode, | |
% for the comma (|\@comma@|) and another one for the unbreakable | |
% fixed length space (no glue) used in Faroese (|\f@thousandsep|). | |
% | |
% The commands |\decimalsep| and |\thousandsep| get default | |
% definitions (for the English language) when |faroese| is loaded; | |
% these definitions will be updated when the current language is | |
% switched to or from Faroese. | |
% \begin{macrocode} | |
\mathchardef\m@comma="013B \def\@comma@{\ifmmode\m@comma\else,\fi} | |
\def\f@thousandsep{\ifmmode\mskip5.5mu\else\penalty\@M\kern.3em\fi} | |
\newcommand{\decimalsep}{.} \newcommand{\thousandsep}{\@comma@} | |
\expandafter\addto\csname extras\CurrentOption\endcsname{% | |
\def\decimalsep{\@comma@}% | |
\def\thousandsep{\f@thousandsep}} | |
\expandafter\addto\csname noextras\CurrentOption\endcsname{% | |
\def\decimalsep{.}% | |
\def\thousandsep{\@comma@}} | |
% \end{macrocode} | |
% \end{macro} | |
% \end{macro} | |
% | |
% \begin{macro}{\tala} | |
% The decimal separator used when \emph{inputing} a number | |
% with |\tala| \emph{has to be a comma}. | |
% |\tala| splits the inputed number into two parts: what | |
% comes before the first comma will be formatted by | |
% \cs{@integerpart} while the rest (if not empty) will be | |
% formatted by \cs{@decimalpart}. Both parts, once formatted | |
% separately will be merged together with between them, either | |
% the decimal separator \cs{decimalsep} or (in \LaTeXe{} | |
% \emph{only}) the optional argument of |\tala|. | |
% | |
% \begin{macrocode} | |
\if@Two@E | |
\newcommand{\tala}[2][\decimalsep]{% | |
\def\@decimalsep{#1}\@tala#2\@empty,\@empty,\@nil} | |
\else | |
\newcommand{\tala}[1]{% | |
\def\@decimalsep{\decimalsep}\@tala#1\@empty,\@empty,\@nil} | |
\fi | |
\def\@tala#1,#2,#3\@nil{% | |
\ifx\@empty#2% | |
\@integerpart{#1}% | |
\else | |
\@integerpart{#1}\@decimalsep\@decimalpart{#2}% | |
\fi} | |
% \end{macrocode} | |
% The easiest bit is the decimal part: | |
% We attempt to read the first four digits of the decimal part, if | |
% it has less than 4 digits, we just have to print them, otherwise | |
% |\thousandsep| has to be appended after the third digit, and the | |
% algorithm is applied recursively to the rest of the decimal part. | |
% \begin{macrocode} | |
\def\@decimalpart#1{\@@decimalpart#1\@empty\@empty\@empty} | |
\def\@@decimalpart#1#2#3#4{#1#2#3% | |
\ifx\@empty#4% | |
\else | |
\thousandsep\expandafter\@@decimalpart\expandafter#4% | |
\fi} | |
% \end{macrocode} | |
% Formatting the integer part is more difficult because the slices | |
% of 3 digits start from the \emph{bottom} while the number is | |
% read from the top! | |
% This (tricky) code is borrowed from David Carlisle's comma.sty. | |
% \begin{macrocode} | |
\def\@integerpart#1{\@@integerpart{}#1\@empty\@empty\@empty} | |
\def\@@integerpart#1#2#3#4{% | |
\ifx\@empty#2% | |
\@addthousandsep#1\relax | |
\else | |
\ifx\@empty#3% | |
\@addthousandsep\@empty\@empty#1#2\relax | |
\else | |
\ifx\@empty#4% | |
\@addthousandsep\@empty#1#2#3\relax | |
\else | |
\@@integerpartafterfi{#1#2#3#4}% | |
\fi | |
\fi | |
\fi} | |
\def\@@integerpartafterfi#1\fi\fi\fi{\fi\fi\fi\@@integerpart{#1}} | |
\def\@addthousandsep#1#2#3#4{#1#2#3% | |
\if#4\relax | |
\else | |
\thousandsep\expandafter\@addthousandsep\expandafter#4% | |
\fi} | |
% \end{macrocode} | |
% \end{macro} | |
% | |
% \subsection{Extra utilities} | |
% | |
% We now provide the Faroese user with some extra utilities. | |
% | |
% \begin{macro}{\upp} | |
% |\upp| is for typesetting superscripts. |\upp| relies on | |
% \begin{macro}{\upp@size} | |
% The internal macro |\upp@size| holds the size at which the | |
% superscript will be typeset. The reason for this is that we have | |
% to specify it differently for different formats. | |
% \begin{macrocode} | |
\ifx\sevenrm\@undefined | |
\ifx\@ptsize\@undefined | |
\let\upp@size\small | |
\else | |
\ifx\selectfont\@undefined | |
% \end{macrocode} | |
% In this case the format is the original \LaTeX-2.09: | |
% \begin{macrocode} | |
\ifcase\@ptsize | |
\let\upp@size\ixpt\or | |
\let\upp@size\xpt\or | |
\let\upp@size\xipt | |
\fi | |
% \end{macrocode} | |
% When |\selectfont| is defined we probably have NFSS available: | |
% \begin{macrocode} | |
\else | |
\ifcase\@ptsize | |
\def\upp@size{\fontsize\@ixpt{10pt}\selectfont}\or | |
\def\upp@size{\fontsize\@xpt{11pt}\selectfont}\or | |
\def\upp@size{\fontsize\@xipt{12pt}\selectfont} | |
\fi | |
\fi | |
\fi | |
\else | |
% \end{macrocode} | |
% If we end up here it must be a plain based \TeX{} format, so: | |
% \begin{macrocode} | |
\let\upp@size\sevenrm | |
\fi | |
% \end{macrocode} | |
% \end{macro} | |
% Now we can define |\upp|. When \LaTeXe{} runs in | |
% compatibility mode (\LaTeX-2.09 emulation), |\textsuperscript| is | |
% also defined, but does no good job, so we give two different | |
% definitions for |\upp| using |\if@Two@E|. | |
% \begin{macrocode} | |
\if@Two@E | |
\DeclareRobustCommand*{\upp}[1]{\textsuperscript{#1}} | |
\else | |
\DeclareRobustCommand*{\upp}[1]{% | |
\leavevmode\raise1ex\hbox{\upp@size#1}} | |
\fi | |
% \end{macrocode} | |
% | |
% \end{macro} | |
% | |
% Some definitions for special characters. | |
% |\grada| needs a special treatment: it is |\char6| | |
% in T1-encoding and |\char23| in OT1-encoding. | |
% \begin{macrocode} | |
\ifx\fmtname\LaTeXeFmtName | |
\DeclareTextSymbol{\grada}{T1}{6} | |
\DeclareTextSymbol{\grada}{OT1}{23} | |
\else | |
\def\T@one{T1} | |
\ifx\f@encoding\T@one | |
\newcommand{\grada}{\char6} | |
\else | |
\newcommand{\grada}{\char23} | |
\fi | |
\fi | |
% \end{macrocode} | |
% | |
% \begin{macro}{\gradur} | |
% Macro for typesetting the abbreviation for `degrees' (as in | |
% `degrees Celsius'). As the bounding box of the character `degree' | |
% has \emph{very} different widths in CMR/DC and PostScript fonts, | |
% we fix the width of the bounding box of |\gradur| to 0.3\,em, | |
% this lets the symbol `degree' stick to the preceding | |
% (e.g., |45\gradur|) or following character (e.g., |20~\gradur C|). | |
% \begin{macrocode} | |
\DeclareRobustCommand*{\gradur}{% | |
\leavevmode\hbox to 0.3em{\hss\grada\hss}} | |
% \end{macrocode} | |
% \end{macro} | |
% | |
% 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 | |
% \texttt{@} to its original value. | |
% \begin{macrocode} | |
\ldf@finish\CurrentOption | |
%</code> | |
% \end{macrocode} | |
% | |
% \Finale | |
%% | |
%% \CharacterTable | |
%% {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 | |
%% 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 | |
%% Digits \0\1\2\3\4\5\6\7\8\9 | |
%% Exclamation \! Double quote \" Hash (number) \# | |
%% Dollar \$ Percent \% Ampersand \& | |
%% Acute accent \' Left paren \( Right paren \) | |
%% Asterisk \* Plus \+ Comma \, | |
%% Minus \- Point \. Solidus \/ | |
%% Colon \: Semicolon \; Less than \< | |
%% Equals \= Greater than \> Question mark \? | |
%% Commercial at \@ Left bracket \[ Backslash \\ | |
%% Right bracket \] Circumflex \^ Underscore \_ | |
%% Grave accent \` Left brace \{ Vertical bar \| | |
%% Right brace \} Tilde \~} | |
%% | |
\endinput |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment