Latex Equation Numbering: Change eqref to "eqn.

  • Context: LaTeX 
  • Thread starter Thread starter Apteronotus
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion revolves around modifying the way equations are referenced in LaTeX documents. Participants explore methods to change the output of equation references from the default format to a custom format that includes the prefix "eqn." before the equation number.

Discussion Character

  • Technical explanation

Main Points Raised

  • One participant inquires about changing the output of the \eqref{} command to display as "(eqn. 1)" instead of "(1)".
  • Another participant suggests using the \ref keyword with manual parentheses to achieve the desired format, indicating that using (eqn. \ref{abc}) would work.
  • A third participant confirms that the suggested method works for their needs.
  • A further suggestion involves creating a macro, \newcommand\eqnrf[1]{(eqn.~\ref{#1})}, to streamline the process of referencing equations in the desired format.
  • One participant notes that using macros may be considered "sloppy" since it diverges from the standard naming convention of equations.

Areas of Agreement / Disagreement

Participants generally agree on the methods proposed for changing the equation reference format, though there is a note of caution regarding the use of macros and their implications.

Contextual Notes

There is an implicit assumption that participants are familiar with LaTeX syntax and the implications of modifying reference commands. The discussion does not resolve the potential drawbacks of using macros versus standard referencing methods.

Apteronotus
Messages
201
Reaction score
0
Hi, when I want to reference an equation in my latex file I use "eqref{}" with produces "(1)".
I would like to change this so that it appears as "(eqn. 1)"

Is there any way to get the desired affect?

Thanks in advance,
 
Physics news on Phys.org
The only way i know how to do that is to go back to using the /ref keyword and put parens around it, yourself. For example, instead of \eqref{abc}, use (eqn. \ref{abc}).
 
Yes, that works.
Thank you.
 
Alternatively, you can use macros. Add something like

Code:
\newcommand\eqnrf[1]{(eqn.~\ref{#1})}

into your preamble. Then,

Code:
\eqnrf{abc}

will produce something like (eqn. 1)

(Of course, it's a little sloppy to do things like that, since the equation is called (1): you should say something like "eqn. (1)")
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 20 ·
Replies
20
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K