David Hewitt wrote:


I am working on physics thesis  and I would
like to know how I could display the number of formerly used equations
so that I do not always have to view the pdf-file if I want to refer to
a certain equation.
You should use labels for that instead of numbering. Then you can access to the labeled equation list via the cross reference dialog.


I have a related question, but it's not critical. In my dissertation LyX
file I have a bunch of display style equations with numbers and labels.
However, the numbers displayed by LyX are almost never right. Sometimes it
will open the file and each equation will be number '1', sometimes they'll
number by chapter, sometimes a few have '??' instead of numbers. I've gotten
used to it, and using labels means it doesn't much matter, but it's odd. The
PDF output is fine.

Any ideas?

It might be related that sometimes footnote references (label footnote, then
cross-reference it) also show up as '??' but output fine.

All of this is in Koma-script book class.



Dave,

I can confirm that the on-screen numbering of the third equation (which should be 1.3) is initially 0.1, subsequently 0.3. I'm not sure if that's related to the other numbering issue or a bug.

The general issue of numbering on screen not matching numbering in the output is a consequence of how IP is implemented. When IP is on, LyX will write a temporary file named #lyxpreview.tex in the temp directory (where # is a counter), hit it with LaTeX, and copy bits of the DVI into the GUI. When you first load a document, all the math insets go into one preview file. If you then add or edit math insets, I think they each get their own file. At any rate, LyX matches the document class of the preview file to that of your source document, and copies all (I think) of the headers, but it does not include any text other than the math insets. In particular, it doesn't include \chapter, \section etc. Ergo, when LaTeX does the IP run, it gets the numbering wrong.

I've submitted a bug report on this (#4596). I did a little test in which I manually inserted section commands in the IP .tex file. The DVI looked right (equations correctly numbered, no extraneous text), but I don't think there's a way to get LyX to inhale my DVI so I can't be sure it works. The other question is how hard it would be to include all the section stuff in the IP file. (I wouldn't think very hard, assuming the user doesn't declare his own non-standard sections in the preamble.)

As to the removal of equation numbers, M-m n or Edit -> Math -> Toggle numbering will do the trick. Note that if you insert a label and then toggle off numbering, the label gets erased.

/Paul

Reply via email to