% Copyright 2008-2012 Claudio Beccari
% Licence LPPL
%
% This extension is for using the aspect ratio symbol in math mode and in
% text mode by means of the command \AR.
%
%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{ar}[2012/01/23 v.2.0 Aspect Ratio symbol: CM, TX, PX styles]
\newif\ifCM\newif\ifTM\newif\ifPA
\CMfalse\TMfalse\PAfalse
\DeclareOption{CM}{\CMtrue\TMfalse\PAfalse}
\DeclareOption{TM}{\TMtrue\PAfalse\CMfalse}
\DeclareOption{TX}{\TMtrue\PAfalse\CMfalse}
\DeclareOption{PA}{\PAtrue\CMfalse\TMfalse}
\DeclareOption{PX}{\PAtrue\CMfalse\TMfalse}
\ExecuteOptions{CM}
\ProcessOptions*\relax
\ifCM
  \DeclareFontFamily{U}{ar}{}
  \DeclareFontShape{U}{ar}{m}{it}%
       {<5><6><7><8><9>gen*ar%
        <10-12>ar10%
        <12-> ar12%
        }{}
  \DeclareFontShape{U}{ar}{b}{it}%
       {<5><6><7><8><9>gen*arb%
        <10-12>arb10%
        <12-> arb12%
        }{}
  \DeclareFontShape{U}{ar}{bx}{it}{<->ssub*ar/b/it}{}
  \DeclareFontShape{U}{ar}{m}{n}{<->ssub*ar/m/it}{}
  \DeclareFontShape{U}{ar}{bx}{n}{<->ssub*ar/b/it}{}

\DeclareFontFamily{U}{ARss}{}
  \DeclareFontShape{U}{ARss}{m}{it}{<-> arssi10}{}%
  \DeclareFontShape{U}{ARss}{m}{n}{<->ssub*ARss/m/it}{}%
  \DeclareFontShape{U}{ARss}{m}{sl}{<->ssub*ARss/m/it}{}%
  \DeclareFontShape{U}{ARss}{b}{it}{<-> arssbi10}{}%
  \DeclareFontShape{U}{ARss}{b}{sl}{<->ssub*ARss/b/it}{}%
  \DeclareFontShape{U}{ARss}{b}{n}{<->ssub*ARss/b/it}{}%
  \DeclareFontShape{U}{ARss}{bx}{sl}{<->ssub*ARss/b/it}{}%
  \DeclareFontShape{U}{ARss}{bx}{it}{<->ssub*ARss/b/it}{}%
  \DeclareFontShape{U}{ARss}{bx}{n}{<->ssub*ARss/b/it}{}%

\DeclareFontFamily{U}{ARtt}{}
  \DeclareFontShape{U}{ARtt}{m}{it}{<-> artti10}{}%
  \DeclareFontShape{U}{ARtt}{b}{it}{<->ssub*ARtt/m/it}{}%
  \DeclareFontShape{U}{ARtt}{bx}{it}{<->ssub*ARtt/m/it}{}%
\fi
%
\ifTM
\def\mar@scale{.90}%         12pt design size; other sizes simply scaled
\DeclareFontFamily{U}{ar}{}
  \DeclareFontShape{U}{ar}{m}{it}{<->s*[\mar@scale]amarri}{}%
  \DeclareFontShape{U}{ar}{b}{it}{<->s*[\mar@scale]amarbi}{}%
  \DeclareFontShape{U}{ar}{bx}{it}{<->ssub*ar/b/it}{}%
\DeclareFontFamily{U}{ARss}{}
  \DeclareFontShape{U}{ARss}{m}{it}{<->ssub*ar/m/it}{}
  \DeclareFontShape{U}{ARss}{b}{it}{<->ssub*ar/b/it}{}
  \DeclareFontShape{U}{ARss}{bx}{it}{<->ssub*ar/b/it}{}
\DeclareFontFamily{U}{ARtt}{}
  \DeclareFontShape{U}{ARtt}{m}{it}{<->ssub*ar/m/it}{}
  \DeclareFontShape{U}{ARtt}{b}{it}{<->ssub*ar/b/it}{}
  \DeclareFontShape{U}{ARtt}{bx}{it}{<->ssub*ar/b/it}{}
\fi
%
\ifPA
\def\apar@scale{1.00}%         10pt design size; other sizes simply scaled
\DeclareFontFamily{U}{ar}{}
  \DeclareFontShape{U}{ar}{m}{it}{<->s*[\apar@scale]aparri}{}%
  \DeclareFontShape{U}{ar}{b}{it}{<->s*[\apar@scale]aparbi}{}%
  \DeclareFontShape{U}{ar}{bx}{it}{<->ssub*ar/b/it}{}%
\DeclareFontFamily{U}{ARss}{}
  \DeclareFontShape{U}{ARss}{m}{it}{<->ssub*ar/m/it}{}
  \DeclareFontShape{U}{ARss}{b}{it}{<->ssub*ar/b/it}{}
  \DeclareFontShape{U}{ARss}{bx}{it}{<->ssub*ar/b/it}{}
\DeclareFontFamily{U}{ARtt}{}
  \DeclareFontShape{U}{ARtt}{m}{it}{<->ssub*ar/m/it}{}
  \DeclareFontShape{U}{ARtt}{b}{it}{<->ssub*ar/b/it}{}
  \DeclareFontShape{U}{ARtt}{bx}{it}{<->ssub*ar/b/it}{}
\fi


\newcommand*\ARm{\mathchoice
	{\hbox{\fontencoding{U}\fontfamily{ar}\fontsize{\tf@size}{\f@baselineskip}\fontshape{it}\selectfont A}}%
	{\hbox{\fontencoding{U}\fontfamily{ar}\fontsize{\tf@size}{\f@baselineskip}\fontshape{it}\selectfont A}}%
	{\hbox{\fontencoding{U}\fontfamily{ar}\fontsize{\sf@size}{\f@baselineskip}\fontshape{it}\selectfont A}}%
	{\hbox{\fontencoding{U}\fontfamily{ar}\fontsize{\ssf@size}{\f@baselineskip}\fontshape{it}\selectfont A}}}

\newcommand*\ARmb{\mathchoice
	{\hbox{\fontencoding{U}\fontfamily{ar}\fontseries{b}\fontsize{\tf@size}{\f@baselineskip}\fontshape{it}\selectfont A}}%
	{\hbox{\fontencoding{U}\fontfamily{ar}\fontseries{b}\fontsize{\tf@size}{\f@baselineskip}\fontshape{it}\selectfont A}}%
	{\hbox{\fontencoding{U}\fontfamily{ar}\fontseries{b}\fontsize{\sf@size}{\f@baselineskip}\fontshape{it}\selectfont A}}%
	{\hbox{\fontencoding{U}\fontfamily{ar}\fontseries{b}\fontsize{\ssf@size}{\f@baselineskip}\fontshape{it}\selectfont A}}}

% Serifed
\DeclareRobustCommand{\AR}{\ifmmode\ARm\else{\fontencoding{U}\fontfamily{ar}\fontshape{it}\selectfont A}\fi}
\DeclareRobustCommand{\ARb}{\ifmmode\ARmb\else{\fontencoding{U}\fontfamily{ar}\fontshape{it}\fontseries{b}\selectfont A}\fi}
% Sans serif
\DeclareRobustCommand{\ARss}{\ifmmode\ARm\else{\fontencoding{U}\fontfamily{ARss}\fontshape{it}\selectfont A}\fi}
\DeclareRobustCommand{\ARssb}{\ifmmode\ARmb\else{\fontencoding{U}\fontfamily{ARss}\fontshape{it}\fontseries{b}\selectfont A}\fi}
% Monospaced
\DeclareRobustCommand{\ARtt}{\ifmmode\ARm\else{\fontencoding{U}\fontfamily{ARtt}\fontshape{it}\selectfont A}\fi}




\endinput
