On 2019-04-22 16:24:55,[email protected] worte:
>On Mon, Apr 22, 2019 at 03:13:58PM +0800, Jinsong Zhao wrote:
>> Hi there,
>>
>> In a manual, I use the following code with XeTeX to create links for
>> cross-reference. If the #1 contains an underscore ("_"), the link
>> generated dose not work.
>
>Note that underscore ('_') is a special character in TeX (and thus
>in LaTeX. Perhaps this is at the root of your problem?
>
>Cheers
>-- tomás
Maybe, but I don't know.
Here is a MWE. On page two, if you click on "not_work", you will find that you
can not jump to page one. But "work" let you back.
Any solution? Thanks.
Best,
Jinsong
\input texinfo
@tex
\gdef\linkcolor{0 .5 0}
\gdef\urlcolor{0 0 .5}
\gdef\mmref#1#2{%
{\leavevmode%
\special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
<< /S /GoTo /D (#1) >> >>}%
}%
\setcolor{\linkcolor}%
#2%
\endlink%
}
@end tex
@macro mref {nodename}
@code{@mmref{\nodename\}{\nodename\}}
@end macro
@anchor{work}
This is a node that can be reached.
@anchor{not_work}
This is a node that can not be reached.
@page
now we jump back, @mref{work} and @mref{not_work}.
@bye