The Neptune LogoNEPTUNE

Labels and Cross-references

Slightly modified \xlabel{...} is used in place of \label{...} with the same functionality. In the same vein, \xref{...} takes the role of \ref{...}. The cross-ref command, \xref{...} accepts more than one label as its argument and the output will be sorted and compressed if needed.

As you’re aware, two TEX runs are needed to fix cross-references to newly inserted objects correctly.

Cross-ref commands:

  • \xref{clm1} Claim 3.2 [Default string + counter]
  • \xref{clm1,clm2} Claims 3.2 and 3.3 [Default string + counters]
  • \xref{clm3,clm2,clm4} Claims 3.2—3.4 [Default string + counters, sorted and compressed]
  • \nxref{clm1} 3.2 [Only counter]
  • \xref[env=Postulate]{clm1} Postulate 3.2 [Custom string + counter]
A command to avoid sorting citations in a particular \xref command:
  • \xref[nosort]{label1,label2}
Global commands:
  • \norefsort Do not sort the ref values in the document.
  • \refsort Sort the ref values in the document (default).

Cross-ref Options

  • id=<id> Add custom id (applicable only during XML generation).
  • num=<number> Add custom number instead of default counter.
  • env=<env string> Add custom environment string.
  • nolink Remove link.
  • noenv Remove string.
  • noctr Remove counter.
  • sort Sort the values in current xref command alone (in a non-sorted surrounding).
  • nosort Do not sort the values in current xref command alone (in a sorted surrounding).
  • sfx Add suffix to the counter.
  • pfx Add prefix to the counter.
  • linkstr={<link string>} Change default string in a multi-label \xref{...} command. Default is and, at times, users might need to change it to through and the like.
  • range Provides range of references if labels for begin and end refs are provided, separated by comma.

Examples for ranged xref

  • \xref[range]{fig1,fig4} Figs. 1—4
  • \xref[range]{eqn1,eqn5} Eqs. (1)—(5)
  • \nxref[range]{eqn1,eqn5} (1)—(5) [without the string Eqs.]
  • \xref[range,linkstr={ through }]{fig1,fig8} Figs. 1 through 8
  • \nxref[linkstr={ through }]{eqn1,eqn2,eqn3,eqn4} (1) through (4) [no range option used, hence need to provide all labels.]
  • \nxref[range,linkstr={ through }]{eqn1,eqn4} (1) through (4) [ range option used, hence need to provide only begin and end labels alone, linkstr changed.]