Expand description
\eqref{eq:euler}: a reference to an equation line that shows its number and
nothing else, (13) where \ref{eq:euler} shows Eq.~(13).
The command belongs to the math feature because what it refers to,
one line of a display-math environment, belongs to that feature. It takes
one label, whose label type (the part before the colon; see reference
points, labels and
anchors)
must be eq (TARGET_TYPE), the label type that an equation line accepts
(LABEL_TYPES). A label of any other type is an Error at the command
(NotAnEquation, flm.math.eqref-not-an-equation), and the command then
shows the label’s text, unlinked, as an unresolved reference does.
§What the command shows
An \eqref shows what \ref[noprefix] shows for the same label: the number
the document gave the line, between the parentheses of the equation counter
style (COUNTER_STYLE) and without the prefix words;
for a line with a \tag, the tag’s content; and when the label refers to no
equation line, or the references feature is not registered, the label as
written, unlinked. The default rule RULE does not decide this itself: it
calls the references feature’s function for reference commands,
lower_reference, so that \eqref and \ref always show a label the same
way. Unlike a \ref with one label, an \eqref adds none of the texts that
RefsConfig writes around a
single reference (one_pre, one_post): it shows the number and nothing
else.
§Recomposing to LaTeX
On the latex-recomposed backend, LATEX_RULE writes \eqref{…} around
the label’s safe label, the key under which the recomposed LaTeX writes every
label (SafeLabels), and
requests the LaTeX package amsmath, which defines \eqref. The numbering is
LaTeX’s there, so the compiled document shows the number LaTeX gave the
equation, not the one FLM computed.
An \eqref whose label no equation line carries is written under the safe
label assigned to that label, as every reference to a missing label is, and
LaTeX reports it as an undefined reference. A label of a type other than eq
is the same Error as on every other backend, and the label is written as the
document wrote it, never as the safe label of the construct that carries that label, so
a recomposed \eqref never points at a heading.
The label is read as characters first, as a \ref’s is
(read_target_at_lowering). A label that holds a placeholder of a user
definition’s template cannot be read that way; the uses of such a definition
are then expanded instead of written as calls, and the label of an expanded
use is written through target_spelling. That function also handles a
label that appears only inside a synthesized
value (a small tree that
a stage builds during a run): it reads the label’s name from the references
feature’s value names table (ValueSafeLabels, flm.labels.safe.value).
§Without the references feature
The rules read the tables of the references feature optionally, under peer
declarations (PeerName): when that
feature is registered, the stages that write the tables run before the rules;
when it is not, the command shows its label as the document wrote it,
unlinked. A registry with mathematics and without references therefore
renders an \eqref instead of refusing the plan.
Rendering reports nothing about the missing references feature; the registry
build has already reported one Note for each unresolved peer declaration. The
check of the label type reads what the author wrote, before any table is read, so
\eqref{eq:euler} in such a registry shows eq:euler unlinked and reports
nothing, and only a label of another type is an Error.
§Map of the module
EQREF,element,EqrefElement,args— the element, its only element value and its arguments;eqref_targetreads the label of a node.RULE,EqrefRule,LATEX_RULE,EqrefLatexRule,rules— the two lowering rules and their bodies.NotAnEquation— the condition of a label of the wrong type.register— registers the element, the rules and the peer declarations.
Structs§
- Eqref
Element - The data of the element value of
flm.math.eqref, and the element’sReferencingaspect: it declares the reference site (RefSite) of an\eqrefnode, a place that refers to a reference point. - Eqref
Latex Rule - The body of
LATEX_RULE:\eqrefaround the label’s safe label, and a request for the LaTeX packageamsmath. See the module documentation, Recomposing to LaTeX. - Eqref
Rule - The body of
RULE: it shows the line’s number through the references feature’slower_reference, and reportsNotAnEquationfor a label of another type. See the module documentation, What the command shows. - NotAn
Equation - Condition
flm.math.eqref-not-an-equation(an Error): the label of an\eqrefdoes not have the label typeeq.
Constants§
- EQREF
- The name of the element of
\eqref,flm.math.eqref. Its element value carries anEqrefElement, which is also the element’sReferencingaspect. - LATEX_
COMMAND - The LaTeX command that the recomposed LaTeX writes,
eqref: theamsmathpackage’s reference to an equation, which prints the number in parentheses. - LATEX_
RULE - The name of the recomposition rule of
EQREFfor thelatex-recomposedbackend,flm.math.eqref.lower.latex-recomposed, whose body isEqrefLatexRule. - RULE
- The name of the default lowering rule of
EQREFon every backend,flm.math.eqref.lower.default, whose body isEqrefRule. - TARGET_
TYPE - The label type that the label of an
\eqrefmust have,eq: the type of the labels an equation line accepts.
Functions§
- args
- The arguments of
\eqref: its one label. There are no display options, because an\eqrefalways shows the number alone. - element
- The element value of every
\eqrefnode. It is one shared value, so that no second element value namedflm.math.eqrefis ever created. - eqref_
target - The label of an
\eqrefnode: its argument read as characters, trimmed of the whitespace around it, and parsed when the text has the formtype:label.Nonewhennodeis not an\eqref, or when its argument holds a placeholder of a user definition’s template that was not expanded: such an argument has no characters to read, declares no reference site, and nothing is reported for it. - register
- Registers
\eqref: peer declarations (PeerName) of the references feature’s resolutions table and value names, the element and its element type’s text, and its two rules. - rules
- The two rules of
\eqref, ready to be registered:RULE, the default on every backend, andLATEX_RULE, the default on thelatex-recomposedbackend only.