> From: Tommaso Cucinotta <[email protected]>
>
> Interestingly, at the end of the document you point out yourself that the
>generated
> latex is relatively "unstable", i.e., a small user action and it doesn't
>compile anymore.
Sorry, it turns out the condition I gave for a compile failure in that document
is wrong, in fact it has nothing to do with prettyref. It happens even if you
just have ERT "\textsuperscript{\ref{fn:Foo}}", so I think it is an
incompatibility between hyperref and textsuperscript.
Actually prettyref makes it possible to work around this problem:
\newrefformat{fn}{\hyperref[#1]{\textsuperscript{\ref*{#1}}}}
As a bonus, the link is now the whole line height, as it should be. And with
this idea you can make links to e.g. "Theorem 1" span the whole width of the
reference automatically:
\newrefformat{thm}{\hyperref[#1]{Theorem~\ref*{#1}}}
Of course, now this doesn't compile if you don't use hyperref, but you can
could
choose between these and the non-hyperref versions in your preamble using
\@ifpackageloaded{hyperref} { hyperref versions } { normal versions }
> In fact, also checking back the checkbox above does not make it compile (but
>if you
> customize the preamble you expect you're going through this, don't you ?)
If you want to be robust, you could always use \@ifpackageloaded{prettyref}.
Doing this for both prettyref and hyperref, you could make a module for
formatted footnote references that works in all conditions. To me, this seems
like the easier solution.
> that's also why I proposed that patch as an optional additional entry, which
>allows
> to go for the old way, if preferred.
Using formatted references is optional too! Plus, the "lack of awareness"
problem I mentioned is because there are already lots of reference options in
LyX. Adding another one, even optional, just makes this problem worse.
As I said, it's just my opinion. As I've not contributed to LyX, I realise that
I might be sounding ungrateful, and I'm sorry for that. But writing code for
one
thing (equation refs) that's already solved and another thing (footnote refs)
that could be solved with a module seems like overkill.
Jim