I have many equation occurrences in a long document, where LyX automatically cross-referenced its equations with \ref{}
rather than \eqref{}
. I want all references to be in parenthesis.
A few solutions occur to me, and I need help with a smart solution.
-
The tedious solution is to go to every equation and click on it, and choose the Format to be ("<"reference">").
-
A smarter solution would be to open the lyx source and replace all \ref with \eqref. I'm avoiding this for now because it's easy but stupid.
-
The smartest solution I'm looking for is a command like
\renewcommand{\ref}[1]{(\eqref{#1})}
to put in the preamble. But this doesn't work.
Is there something to put in the preamble to make all \ref{}
be put in parentheses?
Best Answer
If the numbers of all cross-refernces, and not just those to equations, should be encased in round parentheses, you may achieve by inserting the following instructions in your document's preamble.
Here's a full MWE (but without screenshot);