%%
%% This is file `mathswap.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tudscr-mathswap.dtx  (with options: `package')
%% 
%% ============================================================================
%% 
%%  TUD-KOMA-Script
%%  Copyright (c) Falk Hanisch <tudscr[at]gmail.com>, 2012-2014
%% 
%% ============================================================================
%% 
%%  This work may be distributed and/or modified under the conditions of the
%%  LaTeX Project Public License, version 1.3c of the license. The latest
%%  version of this license is in http://www.latex-project.org/lppl.txt and
%%  version 1.3c or later is part of all distributions of LaTeX 2005/12/01
%%  or later and of this work. This work has the LPPL maintenance status
%%  "author-maintained". The current maintainer and author of this work
%%  is Falk Hanisch.
%% 
%% ----------------------------------------------------------------------------
%% 
%%  Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
%%  Version 1.3c, verteilt und/oder veraendert werden. Die neuste Version
%%  dieser Lizenz ist http://www.latex-project.org/lppl.txt und Version 1.3c
%%  ist Teil aller Verteilungen von LaTeX 2005/12/01 oder spaeter und dieses
%%  Werks. Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained",
%%  wird somit allein durch den Autor verwaltet. Der aktuelle Verwalter und
%%  Autor dieses Werkes ist Falk Hanisch.
%% 
%% ============================================================================
%% 
%%% From File: tudscr-mathswap.dtx
\NeedsTeXFormat{LaTeX2e}[2011/06/27]
\ProvidesPackage{mathswap}[%
  2014/12/17 v2.02 TUD-KOMA-Script
  package
  (swap mathematical separators)%
]
\newcommand*\@commaswap{,}
\newcommand*\commaswap[1]{\gdef\@commaswap{#1}\ignorespaces}
\newcommand*\@dotswap{\,}
\newcommand*\dotswap[1]{\gdef\@dotswap{#1}\ignorespaces}
\newcommand*\ms@commachar{}
\newcommand*\ms@dotchar{}
\AtBeginDocument{%
  \DeclareMathSymbol{\ms@comma}{\mathord}{letters}{"3B}%
  \mathchardef\ms@commachar\mathcode\expandafter`,%
  \mathcode\expandafter`,="8000%
  \DeclareMathSymbol{\ms@dot}{\mathord}{letters}{"3A}%
  \mathchardef\ms@dotchar\mathcode\expandafter`.%
  \mathcode\expandafter`.="8000%
  \mathswapon%
}
\newcommand*\mathswapon{%
  \def\ms@commaswap{\@commaswap}%
  \def\ms@dotswap{\@dotswap}%
}
\newcommand*\mathswapoff{%
  \def\ms@commaswap{\ms@commachar}%
  \def\ms@dotswap{\ms@dotchar}%
}
\newcommand*\ms@commaswap{}
\newcommand*\ms@dotswap{}
\newcommand*\ms@token{}
\begingroup%
  \catcode`,=\active%
  \gdef,{\futurelet\ms@token\ms@smartcomma}%
  \catcode`.=\active%
  \gdef.{\futurelet\ms@token\ms@smartdot}%
\endgroup%
\def\ms@smartcomma{\ms@ifnum{\ms@commaswap}{\ms@commachar}}
\def\ms@smartdot{\ms@ifnum{\ms@dotswap}{\ms@dotchar}}
\def\ms@ifnum#1#2{%
  \ifx\ms@token0\ms@@ifnum{#1}\else%
  \ifx\ms@token1\ms@@ifnum{#1}\else%
  \ifx\ms@token2\ms@@ifnum{#1}\else%
  \ifx\ms@token3\ms@@ifnum{#1}\else%
  \ifx\ms@token4\ms@@ifnum{#1}\else%
  \ifx\ms@token5\ms@@ifnum{#1}\else%
  \ifx\ms@token6\ms@@ifnum{#1}\else%
  \ifx\ms@token7\ms@@ifnum{#1}\else%
  \ifx\ms@token8\ms@@ifnum{#1}\else%
  \ifx\ms@token9\ms@@ifnum{#1}\else%
  #2%
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
}
\def\ms@@ifnum#1{%
  \begingroup%
  \mathcode\expandafter`,=\the\ms@comma%
  \mathcode\expandafter`.=\the\ms@dot%
  #1%
  \endgroup%
}
\endinput
%%
%% End of file `mathswap.sty'.
