Hello Danie,

LyX <http://www.lyx.org> is a highly integrated frontend to LaTeX, maybe
you are aware of its existence and have used it already.

The software currently provides support for basic labels and crossrefs
in LaTeX, and some features of more sophisticated cross referencing,
namely varioref and prettyref (and nameref in the next release).

The LyX developers are currently considering replacing prettyref by
refstyle in the coming release lyx-2.0.0. As one of the basic
principles of LyX development is that this should not change the
layout of already existing printed documents, you may imagine that
this raises a number of questions.

As a plain user (and a member of the team maintaining the French
translations of the interface, doc and web site), I was particularly
interested in this change because prettyref is not internationalized,
and in addition prettyref used with French babel creates an error due to
the character ":" being made active to manage the spacing before the
semi-colon. So I wrote a test file including various labels and cross
referencing using varioref, prettyref and refstyle, and I tested this
file with the planned patch replacing prettyref by refstyle, both in
English and in French.

So on behalf of the developers, I contact you to discuss the odds and
ends of refstyle implementation in LyX. Most the the discussions that
took place already can be found there: - threads on the lyx-devel
mailing list about the patches:
http://thread.gmane.org/gmane.editors.lyx.devel/114398
http://thread.gmane.org/gmane.editors.lyx.devel/126059
http://thread.gmane.org/gmane.editors.lyx.devel/128006 - discussion
about the prettyref bug in French http://www.lyx.org/trac/ticket/6609
I will summarize the discussion hereunder.

First of all, this table reflects the differences between prettyref
and restyle (the discussion is currently restricted to this single
issue):

+-----------------+------------------------------------------------+
|   prettyref     |                    refstyle                    |
+-----------------+------------------------------------------------+
+------+----------+-------+-----------------+----------------------+
| eq   |          |  eq   | [eE]quation{s}  |                      |
+------+----------+-------+-----------------+----------------------+
| lem  |  Lemma   |       |                 |                      |
+------+----------+-------+-----------------+----------------------+
| thm  | Theorem  |       |                 |                      |
+------+----------+-------+-----------------+----------------------+
| cha  | Chapter  | chap  | [cC]hapter{s}   |                      |
+------+----------+-------+-----------------+----------------------+
| sec  | Section  | sec   | [sS]ection{s}   | adds § before number |
+------+----------+-------+-----------------+----------------------+
| tab  |  Table   | tab   |  [tT]able{s}    |                      |
+------+----------+-------+-----------------+----------------------+
| fig  | Figure   | fig   |  [fF]igure{s}   |                      |
+------+----------+-------+-----------------+----------------------+
|      |          | part  |   [pP]art{s}    |                      |
+------+----------+-------+-----------------+----------------------+
|      |          |  fn   |   [nN]ote{s}    |                      |
+------+----------+-------+-----------------+----------------------+

To summarize these differences:
 1/ refstyle adds strings for equations
 2/ refstyle does not know theorems and lemmas
 3/ refstyle adds a paragraph sign before number
 4/ keyword for chapters is chap instead of cha
 5/ prettyref does not know parts and footnotes

Layout of existing documents can be maintained for 1-3 by creating a
specific refstyle.ref file as explained in section 1 of the refstyle
doc. Item 4 needs rewriting of the document to substitute keywords.
Item 5 needs care only if prettyref \newrefformat commands have been
issued by users to add commands to the small set provided by prettyref
(but this one is more complicated due to the various way to do this -
either on a document basis or on a class or package basis).  In
addition, LyX implements a large variety of theorem-like constructs,

During my test for French use of refstyle, I tried to use the
\usepackage[noconfig]{refstyle}
\input{myrefstyle.ref}
structure to add French translations to the existing set (see attached file).
This approach failed because of the line \DeclareLangOpt{french}{\RSfrench}
which creates a compilation error.
I had to rename locally myrefstyle.ref as refstyle.cfg:
http://www.lyx.org/trac/attachment/ticket/6609/refstyle.cfg
to get my enhancements working.

It seems therefore that no local solution exists to add new languages
to the existing set: the refstyle.cfg file itself must be modified.
The problem there is the time required for an updated version of
refstyle to appear in all TeX distributions.

The other constructs needed to integrate refstyle to LyX can be done
by several ways
 1 - by enhancing refstyle.cfg itself with all the
needed constructs for each and every type of cross-reference;
 2 - by distributing a ref file, e.g. lyxrefstyle.ref, which contains
all the required constructs unknown to refstyle.cfg, for each and every type
of cross-reference;
 3 - by enhancing the latex preamble with the basic
refstyle constructs, dedicating to the modular structure of LyX the
variety of theorem-like references (and maybe others): these specific
refstyle commands would be loaded only when needed by an environment.

In any case, I guess that refstyle could profit by the large set
of LyX translators available for the interface, see e.g.
http://www.lyx.org/I18n

I hope I covered fairly well the discussions that took place on the
developers' list. What is your opinion about the various points that I
raised ?

Regards

--
Jean-Pierre





Reply via email to