I'm using Lyx and every time I try to enter a numbered equation, the number comes as (1), nothing else. I'm using Insert->Math->numbered equation. What do I do?

The code

Lyx output

  • 1
  • 1
    Since this is obviously not the default behaviour, it is not going to be possible to help you without seeing a minimal example we can use to reproduce the problem. Ideally, this means the .tex code for a minimal document which shows the problem. If you can't manage that, you can post the .lyx source for such a document instead. The disadvantage is that fewer readers will be able to help you with the .lyx source than will be able to do so if you post the .tex code.
    – cfr
    Dec 8 '15 at 0:22
  • @EthanBolker Should it? I don't see how that addresses the issue here. Of course, it is hard to know when so little information is provided in this question. But it does not seem obviously related in any especially close way.
    – cfr
    Dec 8 '15 at 0:23
  • @cfr I don't know lyx, and have no idea why the default behavior differs, and there's no MWE (as you note), I wrote the comment on the small chance that manually adding a label might make the problem go away. I can just delete the comment when it's clearly not useful. Dec 8 '15 at 0:38

This is a long-standing bug in LyX. The reason it exists is that when you add an equation, LyX runs LaTeX in the background to generate a preview of the equation. But because it does not want to rerun the previews of all of the other equations (because of performance considerations), only the new equation is compiled and thus there is one equation and it receives a "1". There are a few workarounds:

  1. Don't worry about it: The behavior you describe is only for LyX's display. The PDF output is correct.
  2. Turn off instant preview: Tools > Preferences > Look & Feel > Display and turn "Instant preview" to either "Off" or "No math".
  3. You can force a regeneration of all previews (and thus all equations will be regenerated at the same time and have the correct number) by doing e.g. zoom in. This workaround might only work for LyX 2.2.0 (we are almost in beta by the way if you want to test!).
  4. You can save your .lyx file, exit LyX and reopen. The previews should be correct.
  • It's strange, since I don't face the above problem. Is it possible that this bug affects Lyx only under window (i am using linux)
    – Yorgos
    Dec 8 '15 at 9:39
  • @Yorgos do you have instant preview enabled? If so, make one equation, let it preview, then make a separate numbered equation. I imagine you will see a "1". If not, then maybe there is a fix for the bug that somehow is working magically for you so we'd like to know about it.
    – scottkosty
    Dec 8 '15 at 18:49
  • no,my instant preview is off. I thought it was on by default :P
    – Yorgos
    Dec 9 '15 at 8:24
  • @Yorgos ah, no. Actually, I think it is good to leave it off if you are fine with it. There are issues like this one and also if you click somewhere, with instant preview off it takes you exactly to the correct place.
    – scottkosty
    Dec 9 '15 at 15:57
  • How do we add aligned equations in lyx . (For IEEE Transaction document)?
    – Trect
    May 5 '17 at 13:42

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.