summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/sanitize-umlaut/sanitize-umlaut.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/sanitize-umlaut/sanitize-umlaut.sty')
-rw-r--r--Master/texmf-dist/tex/latex/sanitize-umlaut/sanitize-umlaut.sty88
1 files changed, 88 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/sanitize-umlaut/sanitize-umlaut.sty b/Master/texmf-dist/tex/latex/sanitize-umlaut/sanitize-umlaut.sty
new file mode 100644
index 00000000000..d48a86874a0
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/sanitize-umlaut/sanitize-umlaut.sty
@@ -0,0 +1,88 @@
+%% The LaTeX package sanitize-umlaut - version 1.00 (2016/05/28)
+%% sanitize-umlaut.sty: Sanitize umlauts for makeindex
+%%
+%% --------------------------------------------------------------------------------------
+%% Copyright (c) 2016 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% --------------------------------------------------------------------------------------
+%%
+%% This work 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 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% This work consists of all files listed in README
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{sanitize-umlaut}[2016/05/28 version 1.00 sanitize umlauts]
+
+\def\define@unicode@char#1#2{%
+ \@namedef{u8:\detokenize{#1}}{#2}%
+}
+
+\begingroup
+\catcode`\"=12
+
+\gdef\sanitize@umlaut@utfviii{%
+ \define@unicode@char{^^c3^^a4}{"a}%
+ \define@unicode@char{^^c3^^b6}{"o}%
+ \define@unicode@char{^^c3^^bc}{"u}%
+ \define@unicode@char{^^c3^^84}{"A}%
+ \define@unicode@char{^^c3^^96}{"O}%
+ \define@unicode@char{^^c3^^9c}{"U}%
+ \define@unicode@char{^^c3^^9f}{"s}%
+}
+
+\gdef\sanitize@umlaut@latini{%
+ \DeclareInputText{228}{"a}%
+ \DeclareInputText{246}{"o}%
+ \DeclareInputText{252}{"u}%
+ \DeclareInputText{196}{"A}%
+ \DeclareInputText{214}{"O}%
+ \DeclareInputText{220}{"U}%
+ \DeclareInputText{223}{"s}%
+}
+
+\gdef\sanitize@umlaut@applemac{%
+ \DeclareInputText{138}{"a}%
+ \DeclareInputText{154}{"o}%
+ \DeclareInputText{159}{"u}%
+ \DeclareInputText{128}{"A}%
+ \DeclareInputText{133}{"O}%
+ \DeclareInputText{134}{"U}%
+ \DeclareInputText{167}{"s}%
+}
+
+\endgroup
+
+
+\ifdefined\inputencodingname
+ \def\@tempa{utf8}\ifx\inputencodingname\@tempa
+ \let\sanitize@umlaut\sanitize@umlaut@utfviii
+ \PackageInfo{sanitize-umlaut}{encoding utf8 selected}
+ \else\def\@tempa{latin1}\ifx\inputencodingname\@tempa
+ \let\sanitize@umlaut\sanitize@umlaut@latini
+ \PackageInfo{sanitize-umlaut}{encoding latin1 selected}
+ \else\def\@tempa{ansinew}\ifx\inputencodingname\@tempa
+ \let\sanitize@umlaut\sanitize@umlaut@latini
+ \PackageInfo{sanitize-umlaut}{encoding latin1 selected}
+ \else\def\@tempa{cp1252}\ifx\inputencodingname\@tempa
+ \let\sanitize@umlaut\sanitize@umlaut@latini
+ \PackageInfo{sanitize-umlaut}{encoding latin1 selected}
+ \else\def\@tempa{applemac}\ifx\inputencodingname\@tempa
+ \let\sanitize@umlaut\sanitize@umlaut@applemac
+ \PackageInfo{sanitize-umlaut}{encoding applemac selected}
+ \else
+ \def\sanitize@umlaut{}%
+ \PackageWarning{sanitize-umlaut}{encoding \inputencodingname\space is not supported}
+ \fi\fi\fi\fi\fi
+\else
+ \let\sanitize@umlaut\sanitize@umlaut@utfviii
+ \PackageWarning{sanitize-umlaut}{encoding unknown. utf8 is selected as fallback (possibly nonsense)}
+\fi
+
+\AtBeginDocument{\edef\@sanitize{\unexpanded\expandafter{\@sanitize}\unexpanded\expandafter{\sanitize@umlaut}}}