Am Donnerstag, 17. August 2006 16:46 schrieb Florian Schroff:
> Hi,
> I was wondering if there is a way to add additional options in the 
selection
> dialog. currently there is:
> - reference
> - (reference)
> ...
> - Formatted reference

No, that is not possible without source code change.

> I'd like to have at least one additional entry which results in 
\Prettyref
> instead of \prettyref. Furthermore,
> it would be nice to have \vref \vpageref to select.

\vref and \vpageref seem to be supported in the code. Do they not appear in 
the dialog?

> I did a short browse on the code, however couldn't figure out how it 
works,
> I can't imagine it being to complicated (and there isn't a configuration
> option for that is there ;-))

No, there is not. If you want to have a look at this, these are the 
interesting files:

src/insets/insetref.h
src/insets/insetref.C

These deal with reading and writing the LyX file, export to LaTeX and 
onscreen display. Here you have to add the new types. If you can live 
without GUI support then that is enough ;-)

src/frontends/controllers/ControlRef.h
src/frontends/controllers/ControlRef.C

These provide the connection between the LyX kernel and the frontend. You 
will probably not need to touch them.

src/frontends/qt2/QRefDialog.h
src/frontends/qt2/QRefDialog.C
src/frontends/qt2/QRef.h
src/frontends/qt2/QRef.C

These implement the logic of the references dialog. You may or may not need 
to touch these, I don't know.

src/frontends/qt2/ui/QRefDialogBase.ui

This is probably the most important file for you. Here you will need to add 
the new options. This file is best edited in qt3 designer, but you can 
also use vim if you prefer ;-)

If you want to have a go and experience problems or do not understand 
something, please don't hesitate to ask. It would be very nice if you 
could add support for some of these reference types. That would make a 
nice addition to LyX, and this kind of stuff is especially suited for 
somebody who does not know much about the LyX internals, because the code 
is isolated.
Note however that we will not be able to put it in the official 1.4.x 
series, because it is a file format change, so it would go to 1.5. We 
would also need lyx2lyx support, but I can take care of that.


Georg

Reply via email to