On 23/05/2011 5:22 PM, Ruida Yun wrote:
Hi all,
I'm writing my dissertation using Lyx2.0 with the built-in thesis template.
The preamble in thesis template define
\renewcommand{\figureautorefname}{Fig.\negthinspace} to change the
default Figure to Fig. while referencing the figure. However, I found
out the it doesn't work for my me. Please find the attached file to
see the problem.
I've googled this problem for a while but couldn't find a solution.
Any suggestion would be more than welcome.
Thanks a lot!
Ruida
This extract:
% increase link area for cross-references and autoname them
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
from your preamble is an old trick to change the normal reference
format, which appear as "<reference>" in the cross-ref dialog of LyX,
into named references. Named references are now supported by LyX so it
is no longer necessary to use this trick. Simply use the "Formatted
reference" format in the cross-ref dialog. We should probably remove
this trick from places where it is used in LyX's docs and templates.
Named references are provided by one of these latex packages: either
prettyref or refstyle. This is configurable in the "Doucment class" options.
Using prettyref you can write in your preamble:
\newrefformat{fig}{Fig.~\ref{#1}}
If you are using hyperref and you want the "Fig." part to be clickable
also, instead use this:
\newrefformat{fig}{\hyperref[#1]{Fig.~\ref*{#1}}}
I do not know at the moment how to customize refstyle, but it should be
possible to do so in a similar way.
--
Julien