michael papenfus wrote:
Hi,
I am inserting a few tables I created using the ctable package.
These tables are inserted into my lyx document directly as Tex (ERT).
I include label=tab:Table X in the ctable options, but when I attempt
to insert a cross-reference the labels I created in ctable do not
appear in the cross-reference list.
Is there a work around for this?
I could also just manually include the cross reference but I prefer
that it be automated.
The LyX cross reference dialog can only see LyX labels,
i.e. labels inserted with insert->label.

You made your tables using ERT. So there are two ways to
solve this:

1) Create the cross reference with ERT also, because your label
   is made with ERT. This obviously works, but you get more ERT.

2) Insert your labels using insert->label, don't create the
   label with ERT. Now, you can't insert a label inside ERT,
   but you can break your big table ERT into two consecutive
   ERTs, and insert the LyX label between them. (The LyX
   label is exported as a \label command when you run pdflatex)

  Take care so you don't press enter (makes a paragraph break)
  between the two ERTs, as that will cause trouble.

  Example - the brackets just show insets, and should
  not be entered into the document:
  ERT[\mytable{...\caption{captiontext] lyxlabel[tablelabel] ERT[}}]

  Notice the unbalanced braces in each ERT - that is OK
  because the two ERTs balance each other. But this breaks
  badly if you press enter between the two ERTs.

Helge Hafting

Reply via email to