# [texhax] Hyperref and subfig

Christopher Skeels Chris.Skeels at unimelb.edu.au
Sun Aug 5 12:27:41 CEST 2012

Dear All,

I have updated the hyperref bundle so that I now have hyper ref v6.82v, an update from v6.82q.  The update is dated 2012/07/29.  Part of this update has seen nameref.sty updated.  In particular, the function \strip at period from nameref.sty has been (slightly) redefined and and, importantly, renamed \NR at strip@period.  So now the hyperref specific code in subfig.sty no longer works, as \strip at period is now undefined.  Specifically, I now get the following error message when compiling a file that has not had this problem before:

! Undefined control sequence.
<recently read> \strip at period

l.1732 ...degraphics{PowerSESDGM2}\label{fig:pc5}}

For my current purposes I can workaround the problem by reverting to the older version of hyperref.  However, this doesn't seem to be a great longer term solution and ideally it would be better to find a patch for subfig.  There is a second complication that arises, this paper is co-authored with someone whose tex installation won't be updated any time soon and so any solution that I find has to be aware of the version of nameref.sty that will actually be loaded and react accordingly.  I have tried something like to following, to appear in the preamble after both subfig and then hyperref have been loaded:*

\makeatletter
\AtBeginDocument{\@ifpackagelater{nameref}{2012/07/28}{\def\strip at period#1.\relax#2\@nil{#1}}{\relax}}
\makeatother

This throws a different error, namely:

! Argument of \strip at period has an extra }.
<inserted text>
\par
l.1732 ...degraphics{PowerSESDGM2}\label{fig:pc5}}

My knowledge of TeX is proving insufficient to see what is wrong here.  Any help would be greatly appreciated.

Cheers, Chris.

* This is the original definition of \strip at period.  I have also tried to give the definition of \NR at strip@period but the outcome is pretty much the same.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20120805/1417a416/attachment.html>