From: W. Trevor King Date: Thu, 9 May 2013 02:03:33 +0000 (-0400) Subject: local_cmmds.tex: Only equations need (value) in \iref X-Git-Tag: v1.0~221 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=19aab736e4eb33e056b7d327f466c79e34e6a86f;p=thesis.git local_cmmds.tex: Only equations need (value) in \iref We want `Eqn. (a)` and `Fig. b`, not `Fig. (b)`. --- diff --git a/src/local_cmmds.tex b/src/local_cmmds.tex index 32d0e7e..cf1f8b9 100644 --- a/src/local_cmmds.tex +++ b/src/local_cmmds.tex @@ -4,9 +4,16 @@ \makeatother % An reference index from an unspecified source -% usage: \iref{value} -% for example: \iref{75} -\newcommand{\iref}[1]{(#1)} +% usage: \iref{environment}{value} +% for example: \iref{equation}{75} +\newcommand{\iref}[2]{% + \switch% + \case{\isequal{#1}{equation}}% + ({#2})% + \otherwise% + {#2}% + \endswitch% +} % A formatted reference from an unspecified source % usage: \fref{environment}{value} @@ -14,9 +21,9 @@ \newcommand{\fref}[2]{% \switch% \case{\isequal{#1}{equation}}% - Eqn.~\iref{#2}% + Eqn.~\iref{#1}{#2}% \case{\isequal{#1}{figure}}% - Fig.~\iref{#2}% + Fig.~\iref{#1}{#2}% \otherwise% \PackageError{fref}{ \MessageBreak