From 19aab736e4eb33e056b7d327f466c79e34e6a86f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 8 May 2013 22:03:33 -0400 Subject: [PATCH] local_cmmds.tex: Only equations need (value) in \iref We want `Eqn. (a)` and `Fig. b`, not `Fig. (b)`. --- src/local_cmmds.tex | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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 -- 2.26.2