-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverlay.sty
More file actions
25 lines (18 loc) · 853 Bytes
/
overlay.sty
File metadata and controls
25 lines (18 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
\ProvidesPackage{overlay}[2011/03/01 v1.00 Overlays]
% overlay.sty - overlay and align two symbols, respecting styles
% Courtesy of Jeremy Gibbons: http://www.tug.org/TUGboat/hiw/hey-3n2.ps
\def\overlay#1#2{\mathpalette\@overlay{{#1}{#2}{\hfil}{\hfil}}}
\def\loverlay#1#2{\mathpalette\@overlay{{#1}{#2}{}{\hfil}}}
\def\roverlay#1#2{\mathpalette\@overlay{{#1}{#2}{\hfil}{}}}
% calls to \@overlay look like
% \@overlay\textstyle{{x}{y}{\hfil}{\hfil}}
\def\@overlay#1#2{\@@overlay#1#2}
% strip brackets from 2nd arg, to get
% \@@overlay\textstyle{x}{y}{\hfil}{\hfil}
\def\@@overlay#1#2#3#4#5{{%
\def\overlaystyle{#1}%
\setbox0=\hbox{\m@th$\overlaystyle#2$}%
\setbox1=\hbox{\m@th$\overlaystyle#3$}%
\ifdim \wd0<\wd1 \setbox2=\box1 \setbox1=\box0 \setbox0=\box2\fi
% \box0 is now the wider box
\rlap{\hbox to\wd0{#4\box1\relax#5}}\box0}}