On 02/04/2011 4:31 AM, Philippe Charpentier wrote:
Le 01/04/2011 19:32, Philippe Charpentier a écrit :
On 01/04/2011 12:36:34 Julien Rioux wrote:
refstyle is activated in Document Settings, on the first page.
OK (I did not see it...)
This shows that documents produced by previous versions of LyX *and a
nonstandard prettyref.sty* cannot be correctly compiled
by LyX 2.0.
and breaks ascending compatibility
The great goal, of course, is to have all previous documents translated
to the latest version of LyX and produces the same output.
So, for one, documents which were already using prettyref will keep on
using prettyref. New documents can use refstyle, which
means that also french documents can use formatted references. The move
to refstyle was in part because refstyle allows ":" in
labels>even in french document. Could you please check if that indeed
works for you? (it does here) If it works we can worry
about how to convert your document to using refstyle, and perhaps even
do this automatically with some added code in the
lyx2lyx converter, although this depends on how many different modified
versions of prettyref.sty are out there.
Regards,
Julien
Of course refstyle works well (except for some translations) on my
system. But to get the output given by prettyref using refstyle the
document has to be modified: all the definitions \newref.... has to be
redefine using the definitions \newrefformat... (including those which
are in prettyref.sty)
for example:
\newrefformat{sec}{Section \ref{#1}}
(which is defined in prettyref.sty)
has to be define for refstyle by:
\newref{sec}{%
name = Section~,
refcmd = {\ref{#1}}}
(which is not the default in refstyle)
Certainly this is easy to do automatically with documents produced by
old lyx versions. But, people which was using prettyref with previous
lyx version (and writing in french) will be obliged to use refstyle and
the output will be really different than the one given by prettyref
(without speaking of the automatic translations of the prefix with
refstyle...) and then they will be obliged to learn refstyle and to
modify the preamble of the document...
PhC
Dear Philippe,
I think you do agree that standard prettyref.sty doesn't work with
French documents. Also, prettyref.sty does not offer any translation
except for English. Therefore french users of previous versions of LyX
could not use the "Formatted Ref" fonctionality without using both
a) a *modified* version of prettyref.sty
b) preamble code for the translations
We can deal with (b) by morphing prettyref syntax to refstyle. I was
pretty sure there was some lyx2lyx code for that, but I am not so sure
anymore (Richard would know for sure). You have a valid point about the
default prettyref declarations that lie in prettyref.sty itself, but I
think Richard has addressed that by shipping a refstyle.cfg file which
mirror the style of prettyref.
But for (a), I can't even start to imagine how many different ways you
could modify prettyref.sty to work with french. I could change the
prefix separator from ":" to "|", "-", "_", "`", "=", "}{", what have
you.... I think you propose that "|" should be considered a prefix
separator, but what if I already had both ":" and "|" in one of my label
e.g. "fig:1|2|3" I don't see a good way to deal with it and would be
happy to hear your suggestions.
Certainly you had to learn to use the preamble already, at least because
of (b). So I also don't see this as a valid point. The new refstyle
support makes "Formatted Ref" and French documents work together out of
the box.
--
Julien