LyX somehow can't use eqref. (I use version 2.0.2 and wouldn't want to update, if possible, since I've set up everything in a very specific way and wouldn't like a new version to perhaps tamper with that.)
So when I want parenthesis around a number that references some equation, LyX actually uses (\ref{...}). This is annoying, because in propositions and theorem (e.g. from the AMS environment), where everything is emphasized, the number that references is emphasized too - whereas by using eqref (which can be inserted using "evil red code") this wouldn't be the case.

Now in this answer of mine it was indicated, by using an additional package, how to make the number that ref displays always non-emphasized - but the problem remains the the parenthesis are emphaszied.

Is there a way to also make the paranthesis non-emphasized (or ideally get Lyx to use \eqref without "evil red code" ?
The solution from this answer unfortunately doesn't work for me, as it produces an error.

  • Does the doc use amsmath in the first place? Without it there is no reason for LyX to use it. – daleif Nov 9 '14 at 11:24
  • My impression is that this is more a question about the innards of LyX, so it's better to ask it in a specialized LyX forum. – egreg Nov 9 '14 at 13:00

For the solution to your problem: go to Document > Settings and uncheck "Use refstyle (not prettyref) for cross-references. See the screenshot below

enter image description here

Now some picky comments (feel free to skip these):

In regards to "LyX somehow can't use eqref", I don't agree (see the solution above). Did you mean that as a question? I like to help users ask clearer questions. I understand that it is difficult for many non-native speakers and they seem to appreciate suggestions. The way I would phrase this is "Can LyX somehow use eqref?"

Also, in your posts can you please give minimal examples? See here for more information: http://wiki.lyx.org/FAQ/MinimalExample

Thank you for giving the version of LyX that you are using. It is often also useful to say what operating system you are using and its version (e.g. "Ubuntu 14.04").

And my last bit of unsolicited advice is in response to your statement that you do not want to upgrade (note that you are using a version of LyX that is 3 years old). If you plan on using computers for a while it is very stressful to not have a backup plan. That is, I would suggest investing time into setting up your computer such that if you install a new version and that version does not work for you you can easily go back to what you had before. I've never had problems with this on Linux, and it is nice because it is never stressful to decide "should I upgrade or not?" because I can always go back. I imagine that Mac and Windows have ways of dealing with such concerns also. That said, if you don't have such a setup, I agree with you that you could run into problems when upgrading LyX.

  • Does this method use \eqref just for equations and \ref for the other cross references? – egreg Nov 9 '14 at 17:28
  • @egreg If you choose "(<Reference>)" for the particular reference (by right-clicking) and you have the setting I described above as unchecked, \eqref will be used for any reference (I believe), such as a reference to a label that is in a caption in a figure float. Is that bad? Should it only be used for equations? – scottkosty Nov 9 '14 at 17:43
  • Yes, it's bad: \eqref adds parentheses that are generally unwanted for references to non equations. – egreg Nov 9 '14 at 17:46
  • @egreg I see. Well, LyX does things a little strange (as usual): as far as the user knows, they are choosing between parentheses or no parentheses. They do not choose \eqref vs. (\ref) (except through the Document Settings). So it works like this: when you insert a reference, the default is no parentheses. If they choose the "(<Reference>)" option, it is because they go out of their way to choose to have parentheses. In this case, if "Use refstyle" is not selected, then eqref is used. Does that make sense? If not, I can add a more detailed description in my answer. – scottkosty Nov 9 '14 at 17:59
  • I'm not sure to have understood how it works. If it's impossible to have \ref for some references and \eqref for others is a notable weakness of the software. – egreg Nov 9 '14 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.