%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% citeright.sty -- a package for aliasing and specifying citations using natbib.
%
% Copyright 2025 by Jason Overfelt <overfelt@oakland.edu>
% Based on code from the StackExchange user egreg in the following post:
% https://tex.stackexchange.com/questions/87168/natbib-cite-with-abbreviation.
%
% This package provides the command \citeright{}{} for exercising citation 
% practices that respect the naming conventions of cited authors.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% 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
% version 2005/12/01 or later.
%  
% This work has the LPPL maintenance status “maintained”.
% 
% The Current Maintainer of this work is Jason Overfelt.
%
% This work consists of the file citeright.sty and the documentation files
% citeright.tex and citeright.pdf along with the support file references.bib.
%
% Version 1.0.0 2025/06/10
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{citeright}[2025/06/06 citeright package version 1.0.0]
\RequirePackage{etoolbox}

% Conditional to control citation context as the bibliography or elsewhere
	\newif\ifinbibliography
	\AtBeginDocument{\inbibliographyfalse}
	\pretocmd{\thebibliography}{\inbibliographytrue}{}{}

% Definition of \citeright{#1}{#2} command
	\DeclareRobustCommand\citeright[2]{%
		\ifinbibliography #1%
		\else #2%
		\fi}

\endinput