Is there a good way to use the package romanbar also for page numbering, with compatibility to hyperref?

The following example works without hyperref but not with it.





It would even better to activate this with \pagenumbering{Roman}.

This is just an example. I know that changing \thepage in that way is probably not a good idea.


Page labels are only text strings, thus additional bars of package romanbar are not supported. but they can easily be disabled:


(Instead of \@firstofone also \@empty or \relax can be used.)

| improve this answer | |
  • Good to know that there is a macro like \pdfstringdefDisableCommands – ypid Jun 23 '13 at 12:01

I simplified the usage by converting answer 1 into a LaTeX package. See romanbarpagenumber on CTAN.

% And after \begin{document}
| improve this answer | |

Thanks. I just found out that I can also redefined \pagemark which is a bit more elegant.

I use this to set \pagemark when ever the \pagenumbering is expanded.

    %\renewcommand*{\pagemark}{\Roman@bar{\Roman{page}}}% not added by \pageref.

Edit: After all redefining \thepage seams to be the best way because it is also used by \pageref. Thanks again Heiko Oberdiek.

| improve this answer | |
  • \Roman@bar will not be added for Roman page numbers referenced via \pageref. – Heiko Oberdiek Jun 23 '13 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.