1 % \iffalse meta-comment
3 % Copyright 1989-2005 Johannes L. Braams and any individual authors
4 % listed elsewhere in this file. All rights reserved.
6 % This file is part of the Babel system.
7 % --------------------------------------
9 % It may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3 or later is part of all distributions of LaTeX
15 % version 2003/12/01 or later.
17 % This work has the LPPL maintenance status "maintained".
19 % The Current Maintainer of this work is Johannes Braams.
21 % The list of all files belonging to the Babel system is
22 % given in the file `manifest.bbl. See also `legal.bbl' for additional
25 % The list of derived (unpacked) files belonging to the distribution
26 % and covered by LPPL is defined by the unpacking scripts (with
27 % extension .ins) which are part of the distribution.
31 % Tell the \LaTeX\ system who we are and write an entry on the
34 \ProvidesFile{norsk.dtx}
36 %<code>\ProvidesLanguage{norsk}
38 %\ProvidesFile{norsk.dtx}
39 [2012/08/06 v2.0i Norsk support from the babel system]
42 %% Babel package for LaTeX version 2e
43 %% Copyright (C) 1989 - 2005
44 %% by Johannes Braams, TeXniek
46 %% Please report errors to: J.L. Braams
47 %% babel at braams.cistron.nl
49 % This file is part of the babel system, it provides the source
50 % code for the Norwegian language definition file. Contributions
51 % were made by Haavard Helstrup (HAAVARD@CERNVM) and Alv Kjetil
52 % Holme (HOLMEA@CERNVM); the `nynorsk' variant has been supplied by
53 % Per Steinar Iversen (iversen@vxcern.cern.ch) and Terje Engeset
54 % Petterst (TERJEEP@VSFYS1.FI.UIB.NO)
56 % Rune Kleveland (runekl at math.uio.no) added the shorthand
59 \documentclass{ltxdoc}
60 \newcommand*\TeXhax{\TeX hax}
61 \newcommand*\babel{\textsf{babel}}
62 \newcommand*\langvar{$\langle \it lang \rangle$}
63 \newcommand*\note[1]{}
64 \newcommand*\Lopt[1]{\textsf{#1}}
65 \newcommand*\file[1]{\texttt{#1}}
71 % \GetFileInfo{norsk.dtx}
73 % \changes{norsk-1.0a}{1991/07/15}{Renamed \file{babel.sty} in
75 % \changes{norsk-1.1a}{1992/02/16}{Brought up-to-date with babel 3.2a}
76 % \changes{norsk-1.1c}{1993/11/11}{Added a couple of translations
77 % (from Per Norman Oma, TeX@itk.unit.no)}
78 % \changes{norsk-1.2a}{1994/02/27}{Update for \LaTeXe}
79 % \changes{norsk-1.2d}{1994/06/26}{Removed the use of \cs{filedate}
80 % and moved identification after the loading of \file{babel.def}}
81 % \changes{norsk-1.2h}{1996/07/12}{Replaced \cs{undefined} with
82 % \cs{@undefined} and \cs{empty} with \cs{@empty} for consistency
84 % \changes{norsk-1.2h}{1996/10/10}{Moved the definition of
85 % \cs{atcatcode} right to the beginning.}
88 % \section{The Norwegian language}
90 % The file \file{\filename}\footnote{The file described in this
91 % section has version number \fileversion\ and was last revised on
92 % \filedate. Contributions were made by Haavard Helstrup
93 % (\texttt{HAAVARD@CERNVM)} and Alv Kjetil Holme
94 % (\texttt{HOLMEA@CERNVM}); the `nynorsk' variant has been supplied
95 % by Per Steinar Iversen \texttt{iversen@vxcern.cern.ch}) and Terje
96 % Engeset Petterst (\texttt{TERJEEP@VSFYS1.FI.UIB.NO)}; the
97 % shorthand definitions were provided by Rune Kleveland
98 % (\texttt{runekl@math.uio.no}).} defines all the language definition
99 % macros for the Norwegian language as well as for an alternative
100 % variant `nynorsk' of this language.
102 % For this language the character |"| is made active. In
103 % table~\ref{tab:norsk-quote} an overview is given of its purpose.
106 % \begin{tabular}{lp{.7\textwidth}}
107 % |"ff|& for |ff| to be hyphenated as |ff-f|,
108 % this is also implemented for b, d, f, g, l, m, n,
109 % p, r, s, and t. (|o"ppussing|) \\
110 % |"ee|& Hyphenate |"ee| as |\'e-e|. (|komit"een|) \\
111 % |"-| & an explicit hyphen sign, allowing hyphenation in the
112 % composing words. Use this for compound words when the
113 % hyphenation patterns fail to hyphenate
114 % properly. (|alpin"-anlegg|) \\
115 % \verb="|= & Like |"-|, but inserts 0.03em space. Use it if
116 % the compound point is spanned by a ligature.
117 % (\verb=hoff"|intriger=) \\
118 % |""| & Like |"-|, but producing no hyphen sign.
120 % |"~| & Like |-|, but allows no hyphenation at all. (|E"~cup|)\\
121 % |"=| & Like |-|, but allowing hyphenation in the composing
122 % words. (|marksistisk"=leninistisk|) \\
123 % |"<| & for French left double quotes (similar to $<<$). \\
124 % |">| & for French right double quotes (similar to $>>$). \\
126 % \caption{The extra definitions made
127 % by \file{norsk.sty}}\label{tab:norsk-quote}
130 % \changes{norsk-2.0a}{1998/06/24}{Describe the use of double quote as
133 % Rune Kleveland distributes a Norwegian dictionary for ispell
134 % (570000 words). It can be found at
135 % |http://www.uio.no/~runekl/dictionary.html|.
137 % This dictionary supports the spellings |spi"sslede| for
138 % `spisslede' (hyphenated spiss-slede) and other such words, and
139 % also suggest the spelling |spi"sslede| for `spisslede' and
144 % The macro |\LdfInit| takes care of preventing that this file is
145 % loaded more than once, checking the category code of the
146 % \texttt{@} sign, etc.
147 % \changes{norsk-1.2h}{1996/11/03}{Now use \cs{LdfInit} to perform
151 \LdfInit\CurrentOption{captions\CurrentOption}
154 % When this file is read as an option, i.e. by the |\usepackage|
155 % command, \texttt{norsk} will be an `unknown' language in which
156 % case we have to make it known. So we check for the existence of
157 % |\l@norsk| to see whether we have to do something here.
159 % \changes{norsk-1.0c}{1991/10/29}{Removed use of \cs{@ifundefined}}
160 % \changes{norsk-1.1a}{1992/02/16}{Added a warning when no hyphenation
161 % patterns were loaded.}
162 % \changes{norsk-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to produce
165 \ifx\l@norsk\@undefined
167 \adddialect\l@norsk0\fi
170 % \begin{macro}{\norskhyphenmins}
171 % Some sets of Norwegian hyphenation patterns can be used with
172 % |\lefthyphenmin| set to~1 and |\righthyphenmin| set to~2, but
173 % the most common set |nohyph.tex| can't. So we use
174 % |\lefthyphenmin=2| by default.
175 % \changes{norsk-1.2f}{1995/07/02}{Added setting of hyphenmin
177 % \changes{norsk-2.0a}{1998/06/24}{Changed setting of hyphenmin
179 % \changes{norsk-2.0e}{2000/09/22}{Now use \cs{providehyphenmins} to
180 % provide a default value}
182 \providehyphenmins{\CurrentOption}{\tw@\tw@}
186 % Now we have to decide which version of the captions should be
187 % made available. This can be done by checking the contents of
190 \def\bbl@tempa{norsk}
191 \ifx\CurrentOption\bbl@tempa
194 % The next step consists of defining commands to switch to (and
195 % from) the Norwegian language.
197 % \begin{macro}{\captionsnorsk}
198 % The macro |\captionsnorsk| defines all strings used
199 % in the four standard documentclasses provided with \LaTeX.
200 % \changes{norsk-1.1a}{1992/02/16}{Added \cs{seename}, \cs{alsoname} and
202 % \changes{norsk-1.1b}{1993/07/15}{\cs{headpagename} should be
204 % \changes{norsk-1.2f}{1995/07/02}{Added \cs{proofname} for
206 % \changes{norsk-1.2g}{1996/04/01}{Replaced `Proof' by its
208 % \changes{norsk-2.0e}{2000/09/20}{Added \cs{glossaryname}}
209 % \changes{norsk-2.0g}{1996/04/01}{Replaced `Glossary' by its
213 \def\prefacename{Forord}%
214 \def\refname{Referanser}%
215 \def\abstractname{Sammendrag}%
216 \def\bibname{Bibliografi}% or Litteraturoversikt
217 % or Litteratur or Referanser
218 \def\chaptername{Kapittel}%
219 \def\appendixname{Tillegg}% or Appendiks
220 \def\contentsname{Innhold}%
221 \def\listfigurename{Figurer}% or Figurliste
222 \def\listtablename{Tabeller}% or Tabelliste
223 \def\indexname{Register}%
224 \def\figurename{Figur}%
225 \def\tablename{Tabell}%
227 \def\enclname{Vedlegg}%
228 \def\ccname{Kopi sendt}%
229 \def\headtoname{Til}% in letter
232 \def\alsoname{Se ogs\aa{}}%
233 \def\proofname{Bevis}%
234 \def\glossaryname{Ordliste}%
240 % For the `nynorsk' version of these definitions we just add a
243 \adddialect\l@nynorsk\l@norsk
246 % \begin{macro}{\captionsnynorsk}
247 % The macro |\captionsnynorsk| defines all strings used in the four
248 % standard documentclasses provided with \LaTeX, but using a
249 % different spelling than in the command |\captionsnorsk|.
250 % \changes{norsk-1.1a}{1992/02/16}{Added \cs{seename}, \cs{alsoname} and
252 % \changes{norsk-1.1b}{1993/07/15}{\cs{headpagename} should be
254 % \changes{norsk-1.2g}{1996/04/01}{Replaced `Proof' by its
256 % \changes{norsk-2.0e}{2000/09/20}{Added \cs{glossaryname}}
257 % \changes{norsk-2.0g}{1996/04/01}{Replaced `Glossary' by its
259 % \changes{norks-2.0h}{2001/01/12}{Changed \cs{ccname} and \cs{alsoname}}
261 \def\captionsnynorsk{%
262 \def\prefacename{Forord}%
263 \def\refname{Referansar}%
264 \def\abstractname{Samandrag}%
265 \def\bibname{Litteratur}% or Litteraturoversyn
267 \def\chaptername{Kapittel}%
268 \def\appendixname{Tillegg}% or Appendiks
269 \def\contentsname{Innhald}%
270 \def\listfigurename{Figurar}% or Figurliste
271 \def\listtablename{Tabellar}% or Tabelliste
272 \def\indexname{Register}%
273 \def\figurename{Figur}%
274 \def\tablename{Tabell}%
276 \def\enclname{Vedlegg}%
277 \def\ccname{Kopi til}%
278 \def\headtoname{Til}% in letter
280 \def\seename{Sj\aa{}}%
281 \def\alsoname{Sj\aa{} \`{o}g}%
282 \def\proofname{Bevis}%
283 \def\glossaryname{Ordliste}%
289 % \begin{macro}{\datenorsk}
290 % The macro |\datenorsk| redefines the command |\today| to produce
292 % \changes{norsk-1.2i}{1997/10/01}{Use \cs{edef} to define
293 % \cs{today} to save memory}
294 % \changes{norsk-1.2i}{1998/03/28}{use \cs{def} instead of \cs{edef}}
295 % \changes{norsk-2.0i}{2012/08/06}{Removed extra space after `desember'}
297 \@namedef{date\CurrentOption}{%
298 \def\today{\number\day.~\ifcase\month\or
299 januar\or februar\or mars\or april\or mai\or juni\or
300 juli\or august\or september\or oktober\or november\or
306 % \begin{macro}{\extrasnorsk}
307 % \begin{macro}{\extrasnynorsk}
308 % The macro |\extrasnorsk| will perform all the extra definitions
309 % needed for the Norwegian language. The macro |\noextrasnorsk| is
310 % used to cancel the actions of |\extrasnorsk|.
312 % Norwegian typesetting requires |\frencspacing| to be in effect.
314 \@namedef{extras\CurrentOption}{\bbl@frenchspacing}
315 \@namedef{noextras\CurrentOption}{\bbl@nonfrenchspacing}
320 % For Norsk the \texttt{"} character is made active. This is done
321 % once, later on its definition may vary.
322 % \changes{norsk-2.0a}{1998/06/24}{Made double quote character active}
324 \initiate@active@char{"}
325 \expandafter\addto\csname extras\CurrentOption\endcsname{%
326 \languageshorthands{norsk}}
327 \expandafter\addto\csname extras\CurrentOption\endcsname{%
330 % Don't forget to turn the shorthands off again.
331 % \changes{norsk-2.0c}{1999/12/17}{Deactivate shorthands ouside of
334 \expandafter\addto\csname noextras\CurrentOption\endcsname{%
338 % The code above is necessary because we need to define a number of
339 % shorthand commands. These sharthand commands are then used as
340 % indicated in table~\ref{tab:norsk-quote}.
342 % To be able to define the function of |"|, we first define a
343 % couple of `support' macros.
346 % We save the original double quote character in |\dq| to keep
347 % it available, the math accent |\"| can now be typed as |"|.
349 \begingroup \catcode`\"12
351 \def\@SS{\mathchar"7019 }
357 % Now we can define the discretionary shorthand commands.
358 % The number of words where such hyphenation is required is for
361 % \begin{tabular}{*{11}c}
362 % b&d&f &g&k &l &n&p &r&s &t \\
363 % 4&4&15&3&43&30&8&12&1&33&35
366 % taken from a list of 83000 ispell-roots.
368 % \changes{norsk-2.0d}{2000/02/29}{Shorthands are the same for both
369 % spelling variants, no need to use \cs{CurrentOption}}
371 \declare@shorthand{norsk}{"b}{\textormath{\bbl@disc b{bb}}{b}}
372 \declare@shorthand{norsk}{"B}{\textormath{\bbl@disc B{BB}}{B}}
373 \declare@shorthand{norsk}{"d}{\textormath{\bbl@disc d{dd}}{d}}
374 \declare@shorthand{norsk}{"D}{\textormath{\bbl@disc D{DD}}{D}}
375 \declare@shorthand{norsk}{"e}{\textormath{\bbl@disc e{\'e}}{}}
376 \declare@shorthand{norsk}{"E}{\textormath{\bbl@disc E{\'E}}{}}
377 \declare@shorthand{norsk}{"F}{\textormath{\bbl@disc F{FF}}{F}}
378 \declare@shorthand{norsk}{"g}{\textormath{\bbl@disc g{gg}}{g}}
379 \declare@shorthand{norsk}{"G}{\textormath{\bbl@disc G{GG}}{G}}
380 \declare@shorthand{norsk}{"k}{\textormath{\bbl@disc k{kk}}{k}}
381 \declare@shorthand{norsk}{"K}{\textormath{\bbl@disc K{KK}}{K}}
382 \declare@shorthand{norsk}{"l}{\textormath{\bbl@disc l{ll}}{l}}
383 \declare@shorthand{norsk}{"L}{\textormath{\bbl@disc L{LL}}{L}}
384 \declare@shorthand{norsk}{"n}{\textormath{\bbl@disc n{nn}}{n}}
385 \declare@shorthand{norsk}{"N}{\textormath{\bbl@disc N{NN}}{N}}
386 \declare@shorthand{norsk}{"p}{\textormath{\bbl@disc p{pp}}{p}}
387 \declare@shorthand{norsk}{"P}{\textormath{\bbl@disc P{PP}}{P}}
388 \declare@shorthand{norsk}{"r}{\textormath{\bbl@disc r{rr}}{r}}
389 \declare@shorthand{norsk}{"R}{\textormath{\bbl@disc R{RR}}{R}}
390 \declare@shorthand{norsk}{"s}{\textormath{\bbl@disc s{ss}}{s}}
391 \declare@shorthand{norsk}{"S}{\textormath{\bbl@disc S{SS}}{S}}
392 \declare@shorthand{norsk}{"t}{\textormath{\bbl@disc t{tt}}{t}}
393 \declare@shorthand{norsk}{"T}{\textormath{\bbl@disc T{TT}}{T}}
395 % We need to treat |"f| a bit differently in order to preserve the
397 % \changes{norsk-2.0b}{1999/11/19}{Copied the coding for \texttt{"f}
398 % from germanb.dtx version 2.6g}
400 \declare@shorthand{norsk}{"f}{\textormath{\bbl@discff}{f}}
401 \def\bbl@discff{\penalty\@M
402 \afterassignment\bbl@insertff \let\bbl@nextff= }
405 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
406 {\relax\discretionary{ff-}{f}{ff}\allowhyphens}{f\bbl@nextff}}
409 % We now define the French double quotes and some commands
410 % concerning hyphenation:
411 % \changes{norsk-2.0b}{1999/11/22}{added the french double quotes}
412 % \changes{norsk-2.0d}{2000/01/28}{Use \cs{bbl@allowhyphens} in
415 \declare@shorthand{norsk}{"<}{\flqq}
416 \declare@shorthand{norsk}{">}{\frqq}
417 \declare@shorthand{norsk}{"-}{\penalty\@M\-\bbl@allowhyphens}
418 \declare@shorthand{norsk}{"|}{%
419 \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}%
421 \declare@shorthand{norsk}{""}{\hskip\z@skip}
422 \declare@shorthand{norsk}{"~}{\textormath{\leavevmode\hbox{-}}{-}}
423 \declare@shorthand{norsk}{"=}{\penalty\@M-\hskip\z@skip}
426 % The macro |\ldf@finish| takes care of looking for a
427 % configuration file, setting the main language to be switched on
428 % at |\begin{document}| and resetting the category code of
429 % \texttt{@} to its original value.
430 % \changes{norsk-1.2h}{1996/11/03}{Now use \cs{ldf@finish} to wrap up}
432 \ldf@finish\CurrentOption
439 %% {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
440 %% 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
441 %% Digits \0\1\2\3\4\5\6\7\8\9
442 %% Exclamation \! Double quote \" Hash (number) \#
443 %% Dollar \$ Percent \% Ampersand \&
444 %% Acute accent \' Left paren \( Right paren \)
445 %% Asterisk \* Plus \+ Comma \,
446 %% Minus \- Point \. Solidus \/
447 %% Colon \: Semicolon \; Less than \<
448 %% Equals \= Greater than \> Question mark \?
449 %% Commercial at \@ Left bracket \[ Backslash \\
450 %% Right bracket \] Circumflex \^ Underscore \_
451 %% Grave accent \` Left brace \{ Vertical bar \|
452 %% Right brace \} Tilde \~}