AndyClifton / accessibility

A CTAN-compliant version of the LaTeX `accessibility` package
37 stars 6 forks source link

Doesn't work with roman numerals #22

Open AndyClifton opened 4 years ago

AndyClifton commented 4 years ago

Using page numbers as references within the stack in the accessibility.dtx file causes trouble when pages have no numbering or use roman numerals.

Instead of using \thepage, consider using \count1 as the page marker, e.g. replace

/Pg \pdfpageref\thepage \space \space 0 R %

with

/Pg \pdfpageref\count1 \space \space 0 R %

Note that we also have to then fix hyperref:

% The count1to package confuses hyperref (see hyperref README), so fix \theH<...>:
\@ifpackageloaded{hyperref}{%
  \AtBeginDocument{%
    \ifthenelse{\isundefined{\theHchapter}}{\newcommand{\theHchapter}{0}}{}%
    \renewcommand*{\theHsection}{\theHchapter.\arabic{section}}%
    \renewcommand*{\theHsubsection}{\theHsection.\arabic{subsection}}%
    \renewcommand*{\theHsubsubsection}{\theHsubsection.\arabic{subsubsection}}%
    \renewcommand*{\theHparagraph}{\theHsubsubsection.\arabic{paragraph}}%
    \renewcommand*{\theHsubparagraph}{\theHparagraph.\arabic{subparagraph}}%
  }%
}%
AndyClifton commented 4 years ago

Seems like there might be an attempt to fix this already with the mypagecounter:

\newcounter{mypage}%
\setcounter{mypage}{\@ne}%

Need to check where the new page hooks are. See https://tex.stackexchange.com/questions/345348/different-page-numbering-in-appendices-while-keeping-main-numbering for more details.