local_cmmds.tex: Only equations need (value) in \iref
authorW. Trevor King <wking@tremily.us>
Thu, 9 May 2013 02:03:33 +0000 (22:03 -0400)
committerW. Trevor King <wking@tremily.us>
Thu, 9 May 2013 02:06:53 +0000 (22:06 -0400)
We want `Eqn. (a)` and `Fig. b`, not `Fig. (b)`.

src/local_cmmds.tex

index 32d0e7e537d0a0f6c36209b04a043076b44305f7..cf1f8b9830ddc23eff1d27a7f1e79af84b8cc222 100644 (file)
@@ -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