[texhax] Hyperref query

Vafa Khalighi vafakh84 at gmail.com
Tue May 11 13:10:11 CEST 2010


As in polyglossia, if you create abjad numbering say by:

\documentclass{article}
\usepackage{hyperref}
\usepackage{etoolbox}
\makeatletter
\providecommand*{\xpg at warning}[1]{%
   \PackageWarning{some dummy package}%
   {#1}}
\ifcsdef{abjad}{}{%
\def\abjad#1{%
\ifnum#1>1999 \xpg at warning{Illegal value (#1) for abjad numeral} {#1}
\else
  \ifnum#1<\z@\space\xpg at warning{Illegal value (#1) for abjad numeral}%
  \else
    \ifnum#1<10\expandafter\abj at num@i\number#1%
    \else
      \ifnum#1<100\expandafter\abj at num@ii\number#1%
      \else
        \ifnum#1<\@m\expandafter\abj at num@iii\number#1%
        \else
          \ifnum#1<\@M\expandafter\abj at num@iv\number#1%since #1<2000, we
must have 1000
          \fi
        \fi
      \fi
    \fi
  \fi
\fi
}
\def\abjad at zero{}
\def\abj at num@i#1{%
  \ifcase#1\or الف\or ب\or ج\or د%
           \or ه\char"200D\or و\or ز\or ح\or ط\fi
  \ifnum#1=\z@\abjad at zero\fi}
\def\abj at num@ii#1{%
  \ifcase#1\or ی\or ک\or ل\or م\or ن%
           \or س\or ع\or ف\or ص\fi
  \ifnum#1=\z@\fi\abj at num@i}
\def\abj at num@iii#1{%
  \ifcase#1\or ق\or ر\or ش\or ت\or ث%
            \or خ\or ذ\or ض\or ظ\fi
  \ifnum#1=\z@\fi\abj at num@ii}
\def\abj at num@iv#1{%
  \ifcase#1\or غ\fi
  \ifnum#1=\z@\fi\abj at num@iii}
}
   \let\@latinalph\@alph%
   \let\@latinAlph\@Alph%
   \let\@alph\abjad%
   \let\@Alph\abjad%

\makeatother
\begin{document}
\tableofcontents
\section{Test}
\newpage
\appendix
\section{Another Test}
\end{document}

Then the section entry in the toc, does not link to the section in the
appendix or if it links, it links to the first section. Could you please
explain why this happens and if there could be a clean solution to this
situation.

-- 
Best wishes,
Vafa Khalighi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20100511/00f707e9/attachment.html>


More information about the texhax mailing list