[texhax] Problem with the xr-hyper package

José Carlos Santos jcsantos at fc.up.pt
Sun May 18 11:16:40 CEST 2014


On 17/05/2014 17:21, Heiko Oberdiek wrote:

>> --------------------------- A.tex ---------------------------
>> \documentclass{book}
>> \usepackage{hyperref}
>> \newcommand*{\newchapter}[1]{\chapter[\texorpdfstring{\MakeUppercase{#1}}{#1}]{#1}}
>>
>> \begin{document}
>> \newchapter{ABC}\label{cha}
>> A
>> \end{document}
>> -------------------------------------------------------------
>
> The following change solves the issue:
>
> \pdfstringdefDisableCommands{\let\MakeUppercase\relax}
> \newcommand*{\newchapter}[1]{\chapter{#1}}
>
>> --------------------------- B.tex ---------------------------
>> \documentclass[article]{memoir}
>> \usepackage{amsmath}
>> \usepackage{xr-hyper}
>> \usepackage{hyperref}
>> \externaldocument{A}
>> \begin{document}
>> \chapter{\nameref{cha}}
>> \end{document}
>> -------------------------------------------------------------
>
> Or package zref-xr is more powerful and should be more robust then xr-hyper:
>
> \documentclass[article]{memoir}
> \usepackage{amsmath}
> \usepackage{hyperref}
>
> \usepackage{nameref}% explicit, zref-xr needs to see it
> \usepackage{zref-xr}
> \zxrsetup{tozreflabel=false, toltxlabel}
> \zexternaldocument*{A}
>
> \begin{document}
> \chapter{\nameref{cha}}
> \end{document}

Thanks a lot.

Best regards,

Jose Carlos Santos




More information about the texhax mailing list