% aroundset.sty
% from http://www.jokr.de/stefan/
% File created by Stefan Krause -- version 1.2.
% Allows to place content around a mathematical object.
% You may access
%  \aroundset{}{}{}{}{}
%  \subaroundset{}{}{}{}{}
% from this document.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{aroundset}[2009/01/29]
\RequirePackage{calc,ifthen}
\newlength{\aroundsetwidth}
\newcommand{\aroundset}[5]{{%
 \setlength{\aroundsetwidth}{\widthof{$\scriptstyle#1$}-\widthof{$\scriptstyle#2$}}%
 {\vphantom{#3}}%
 _{\ifthenelse{\aroundsetwidth<0}{\hspace*{-\aroundsetwidth}}{}#1\vphantom{#4}}%
 ^{\ifthenelse{\aroundsetwidth>0}{\hspace*{\aroundsetwidth}}{}#2\vphantom{#5}}%
 #3%
 _{\vphantom{#1}#4}%
 ^{\vphantom{#2}#5}%
}}
\newcommand{\subaroundset}[5]{{%
 \setlength{\aroundsetwidth}{\widthof{$\scriptscriptstyle#1$}-\widthof{$\scriptscriptstyle#2$}}%
 {\vphantom{#3}}%
 _{\ifthenelse{\aroundsetwidth<0}{\hspace*{-\aroundsetwidth}}{}#1\vphantom{#4}}%
 ^{\ifthenelse{\aroundsetwidth>0}{\hspace*{\aroundsetwidth}}{}#2\vphantom{#5}}%
 #3%
 _{\vphantom{#1}#4}%
 ^{\vphantom{#2}#5}%
}}
