1 The Danish language

The file danish.dtx^{1} defines all the language definition macros for the Danish language.

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

"| disable ligature at this position.

"- an explicit hyphen sign, allowing hyphenation in the

rest of the word. "" like "-, but producing no hyphen sign (for words that should break at some sign such as “entrada/salida.”

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

Table 1: The extra definitions made by danish.ldf

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{danish}\captionsdanish

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

 3 \ifx\l@danish\@undefined
 4  \@nopatterns{Danish}
 5  \adddialect\l@danish0\fi

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

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

 6 \addto\captionsdanish{%
 7 \def\prefacename{Forord}%
 8 \def\refname{Litteratur}%
 9 \def\abstractname{Resum\'e}%
10 \def\bibname{Litteratur}%
11 \def\chaptername{Kapitel}%
12 \def\appendixname{Bilag}%
13 \def\contentsname{Indhold}%
14 \def\listfigurename{Figurer}%
15 \def\listtablename{Tabeller}%
16 \def\indexname{Indeks}%
17 \def\figurename{Figur}%
18 \def\tablename{Tabel}%
19 \def\partname{Del}%

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

A contribution was made by Henning Larsen (larsen@cernvm.cern.ch)

20 \def\enclname{Vedlagt}%
21 \def\ccname{Kopi til}%   or    Kopi sendt til
22 \def\headtoname{Til}% in letter
23 \def\pagename{Side}%
24 \def\seename{Se}%
25 \def\alsoname{Se ogs{\aa}}%
26 \def\proofname{Bevis}%
27 }%

\datedanish The macro \datedanish redefines the command \today to produce Danish dates.

28 \def\datedanish{%
29 \def\today{\number\day.~\ifcase\month\or
30 januar\or februar\or marts\or april\or maj\or juni\or
31 juli\or august\or september\or oktober\or november\or december\fi
32 \space\number\year}}

\extrasdanish \noextrasdanish The macro \extrasdanish will perform all the extra definitions needed for the Danish language. The macro \noextrasdanish is used to cancel the actions of

\extrasdanish.

Danish typesetting requires \frencspacing to be in effect.

33 \addto\extrasdanish{\bbl@frenchspacing}
34 \addto\noextrasdanish{\bbl@nonfrenchspacing}

For Danish 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 danish group of shorthands should be used.

35 \initiate@active@char{"}
36 \addto\extrasdanish{\languageshorthands{danish}}
37 \addto\extrasdanish{\bbl@activate{"}}
38 %\addto\noextrasdanish{\bbl@deactivate{"}}

First we define access to the low opening double quote and guillemets for quotations,

39 \declare@shorthand{danish}{"`}{%
40 \textormath{\quotedblbase{}}{\mbox{\quotedblbase}}}
41 \declare@shorthand{danish}{"'}{%
42 \textormath{\textquotedblleft{}}{\mbox{\textquotedblleft}}}
43 \declare@shorthand{danish}{"<}{%
44 \textormath{\guillemotleft{}}{\mbox{\guillemotleft}}}
45 \declare@shorthand{danish}{">}{%
46 \textormath{\guillemotright{}}{\mbox{\guillemotright}}}

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

47 \declare@shorthand{danish}{"-}{\allowhyphens-\allowhyphens}
48 \declare@shorthand{danish}{""}{\hskip\z@skip}
49 \declare@shorthand{danish}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
50 \declare@shorthand{danish}{"=}{\penalty\@M-\hskip\z@skip}

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

51 \declare@shorthand{danish}{"|}{%
52 \textormath{\discretionary{-}{}{\kern.03em}}{}}

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.

53 \ldf@finish{danish}

54 ⟨/code⟩