Richard Heck a écrit :
On 11/03/2010 01:28 PM, Jean-Pierre Chrétien wrote:
I forgot to mention that I could make convert_prettyref.patch work.
So what is the idea behind this one? It seems to have a few different
parts.
I know there is a part/par chap/cha issue here somewhere. But I'm not
sure if lyx2lyx is the right place to address it. Can you tell me
exactly what the issue now is and where we stand with it?
I investigated this issue en bit more, but we discussed it already:
http://thread.gmane.org/gmane.editors.lyx.devel/126059
http://thread.gmane.org/gmane.editors.lyx.devel/128006
Prefixes for labels of chapters and parts are cha: and par: for lyx-1.6.x and
earlier, prettyref knows only chapters (unless a user defines
\newrefformat{par}{...}).
Starting with lyx-2.0, with a new document, labels are chap:, but remain as par:
(I guess for compatibility with prettyref), so that checking "Use refstyle" with
a reference to a chapter results in a ?? (unknown reference to cha:xxx).
Last march, the first refstyle patch (which wiped out completely prettyref) that
you proposed used convert_prettyref to subsitute all cha: and par: as chap: and
part:.
I just reused your code (and some I added at the time) to be sure that no trace
of cha: and par: is left in document format 404 and higher. I added also the
step to deal with user-defined \newrefformat{xxx} where xxx is cha or par.
Strings are looked for in the preamble, hoping that nobody has put them in the
document body.
I put the right code in revert_refstyle to go back to the old syntax (I guess
revert_spmething is used by lyx2lyx to go back to older formats ? I tested it
against this, going back to format 402).
Seems that I missed the fact that an new chapter label in lyx-2.0 will read
cha:xxx, this need to be corrected. Looking at the code:
$ grep RefPrefix lib/layouts/* |grep cha
lib/layouts/stdrefprefix.inc: RefPrefix cha
lib/layouts/tufte-book.layout: RefPrefix chap
seems that lib/layouts/stdrefprefix.inc should be patched, and tufte in not
coherent anyway.
--
Jean-Pierre