/usr/share/perl5/LaTeXML/Package/babel.def.ltxml is in latexml 0.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | # -*- mode: Perl -*-
# /=====================================================================\ #
# | babel.def | #
# | Implementation for LaTeXML | #
# |=====================================================================| #
# | Part of LaTeXML: | #
# | Public domain software, produced as part of work done by the | #
# | United States Government & not subject to copyright in the US. | #
# |---------------------------------------------------------------------| #
# | Thanks to the arXMLiv group for initial implementation | #
# | http://arxmliv.kwarc.info/ | #
# | Released to the Public Domain | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <bruce.miller@nist.gov> #_# | #
# | http://dlmf.nist.gov/LaTeXML/ (o o) | #
# \=========================================================ooo==U==ooo=/ #
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;
# I think we can best just read the current babel.def
# and then proceed with some strategic redefinitions.
# We should also be able to directly process the
# <language>.ldf files.
InputDefinitions('babel', type => 'def', noltxml => 1);
# We want to use unicode wherever possible and
# avoid the contrived positioning of glyphs to synthesize funny chars.
DefPrimitiveI('\dj', undef, "\x{0111}");
DefPrimitiveI('\DJ', undef, "\x{0110}");
DefPrimitiveI('\ij', undef, "ij");
DefPrimitiveI('\IJ', undef, "IJ");
DefPrimitiveI('\flq', undef, "\x{2039}");
DefPrimitiveI('\frq', undef, "\x{203A}");
DefPrimitiveI('\flqq', undef, UTF(0xAB));
DefPrimitiveI('\frqq', undef, UTF(0xBB));
DefPrimitiveI('\glq', undef, "\x{201A}");
DefPrimitiveI('\grq', undef, "\x{2019}");
DefPrimitiveI('\glqq', undef, "\x{201E}");
DefPrimitiveI('\grqq', undef, "\x{201D}");
DefPrimitiveI('\SS', undef, "SS");
DefPrimitiveI('\guilsinglleft', undef, "\x{2039}");
DefPrimitiveI('\guilsinglright', undef, "\x{203A}");
DefPrimitiveI('\guillemotleft', undef, UTF(0xAB));
DefPrimitiveI('\guillemotright', undef, UTF(0xBB));
# And just shutup about hyphenation patterns
DefMacro('\@nopatterns{}', '');
# This is a guess of the languages (and sometimes dialects)
# represented in the various *.ldf found on my system at this time.
our $bbl_language_map = {
albanian => 'sq', # albanian
acadian => 'fr-CA', # frenchb; Should this get a more specific region?
afrikaans => 'af', # dutch
american => 'en-US', # english
australian => 'en-AU', # english
austrian => 'de-AT', # germanb
bahasa => 'in', # bahasai
bahasai => 'in', # bahasai
bahasam => 'ms', # bahasam
basque => 'eu', # basque
breton => 'br', # breton
bulgarian => 'bg', # bulgarian
brazil => 'pt-BR', # portuges
brazilian => 'pt-BR', # portuges
british => 'en-GB', # english',
canadian => 'en-CA', # english
canadien => 'fr-CA', # frenchb
catalan => 'ca', # catalan
croatian => 'hr', # croatian
czech => 'cs', # czech
danish => 'da', # danish
dutch => 'nl', # dutch
english => 'en', # english
esperanto => 'eo', # esperanto
estonian => 'et', # estonian
finnish => 'fi', # finnish
francais => 'fr', # frenchb
french => 'fr', # frenchb
frenchb => 'fr', # frenchb
friulan => 'fur', # friulan
galician => 'gl', # galician
georgian => 'ka', # georgian
german => 'de', # germanb
germanb => 'de', # germanb
ngermanb => 'de', # ngermanb
greek => 'el', # greek
hebrew => 'he', # hebrew
hindi => 'hi', # hindi
hungarian => 'hu', # magyar
icelandic => 'is', # icelandic
indon => 'in', # bahasai
indonesian => 'in', # bahasai
interlingua => 'ia', # interlingua
irish => 'ga', # irish
italian => 'it', # italian
kurmanji => 'kmr', # kurmanji (Northern Kurdish)
latin => 'la', # latin
lowersorbian => 'dsb', # lsorbian
malay => 'ms', # bahasam
meyalu => 'ms', # bahasam
naustrian => 'de-AT', # naustrian
newzealand => 'en-NZ', # english
ngermanb => 'de', # ngermanb
ngerman => 'de', # ngerman
norsk => 'nn', # norsk
nswissgerman => 'gsw', # nswissgerman
nynorsk => 'nn', # norsk
piedmontese => 'pms', # piedmontese (Piemontese)
polish => 'pl', # polish
polutonikogreek => 'el', # greek
portuges => 'pt', # portuges
portuguese => 'pt', # portuges
romanian => 'ro', # romanian
romansh => 'rm', # romansh
russian => 'ru', # russianb
russianb => 'ru', # russianb
samin => 'se', # samin (Northern Sami)
scottish => 'gd', # scottish
serbianc => 'sr', # serbianc
serbian => 'sr', # serbian
slovak => 'sk', # slovak
slovene => 'sl', # slovene
spanish => 'es', # spanish
swedish => 'sv', # swedish
swissgerman => 'gsw', # swissgerman
thai => 'th', # thai
turkish => 'tr', # turkish
UKenglish => 'en-GB', # english
ukraineb => 'uk', # ukraineb
ukrainian => 'uk', # ukraineb
usorbian => 'hsb', # usorbian
uppersorbian => 'hsb', # usorbian
USenglish => 'en-US', # english
vietnamese => 'vi', # vietnamese
vietnam => 'vi', # vietnam
welsh => 'cy', # welsh
};
Let('\ltx@save@bbl@switch', '\bbl@switch');
Let('\ltx@save@select@language', '\select@language');
Let('\ltx@save@foreign@language', '\foreign@language');
# Overkill; redefine ALL these since we never know which one will
# be used in various babel versions.
# \bbl@switch is only used in newer babels(?)
RawTeX(<<'EoTeX');
\def\select@language#1{\ltx@save@select@language{#1}\ltx@bbl@select@language{#1}}
\def\foreign@language#1{\ltx@save@foreign@language{#1}\ltx@bbl@select@language{#1}}
\def\bbl@switch#1{\ltx@save@bbl@switch{#1}\ltx@bbl@select@language{#1}}
EoTeX
DefPrimitive('\ltx@bbl@select@language{}', sub {
my ($stomach, $language) = @_;
$language = ToString(Expand($language));
my $iso = $$bbl_language_map{$language};
MergeFont(language => $iso) if $iso;
return; });
# pretend we've got hyphenation patterns for ANY language.
DefMacro('\iflanguage{}', <<'EoTeX');
\expandafter\ifx\csname l@#1\endcsname\relax
\expandafter\newlanguage\csname l@#1\endcsname\fi
\expandafter\edef\expandafter\@@@@lang\expandafter{\csname l@#1\endcsname}
\ifnum\csname l@#1\endcsname=\language
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
EoTeX
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1;
|