\ProvidesPackage{SLOverline}

%%%SLOverline%%%
%A macro for producing non-manual marking overlining and NMM labels
%for signed language linguistics
%%%%%%%%%%%%%%%%%
%  Just add \usepackage{SLOverline}
% Customization:
% Everyone likes everything just their own way.  Some things you might want
% to play with:
% * Signs are set to print as smallcaps with \textsc.  If you want to change
% this, remove \textsc from both the line that prints the sign [line 47]  AND 
% the line that sets the width of \sloverlinetext [line 45].  If you add formatting
% to the sign in either place, add it to the other too, or else you won't get
% the right length overbar
% * The NMM label is set to print as \small. If you want to change that, 
% do so where it's printed at the end [l. 55], and also where the width of \slnmmtext 
% is set [l. 46]
% * You can change the height over the overline by changing the optional
% argument of \rule - default is 1.6ex.  You'll want to change the height
% the NMM label prints at, too
% * You can change the height at which the NMM label prints by changing the 
% value of the first argument in \raisebox
% * If you want your NMM label to be further left or right, reduce or increase
% the \hspace-ing in the last line
%
% Usage:
% \sloverline{sign}{nmmlabel}
% e.g. \sloverline{what}{wh} produces (approximately):
%     wh
% ------
% WHAT
% you can put multiple words in the first argument slot.
% to make an example where not every word is marked, you'll have to end the
% \sloverline and start it again where you want it back:
% \sloverline{these words are overlined}{wh} \textsc{these are not} \sloverline{these are}{wh}
%%%%%%%%%%%%%%%
%And now the actual macro:
%%%%%%%%%%%%%%%

%Overlining for signed languages
\newlength{\sloverlinetext}\newlength{\slnmmtext} %create lengths we'll set
\newcommand{\sloverline}[2]%
%set the width of the overline to the width of the sign (in smallcaps):
{\settowidth{\sloverlinetext}{\textsc{#1}}%
\settowidth{\slnmmtext}{\small#2}%set width of the NMM label
\textsc{#1}% print the sign
%hspace to the left the width of the sign
%so we start printing the overline at the left edge of the sign
\hspace{-\sloverlinetext}%
%draw the overline the length of \sloverline, 1.6e high, 1pt thick
\rule[1.6ex]{\sloverlinetext}{1pt}
%print the NMM label 2.1ex high, skooched over from the right by
%the length of the NMM label plus a bit
\raisebox{2.1ex}{\hspace{-\slnmmtext}\hspace{-.75ex}\small#2}}

