Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel: Strange bookmarks characters in arabic pdf #13

Closed
seloumi opened this issue Jan 28, 2018 · 1 comment
Closed

babel: Strange bookmarks characters in arabic pdf #13

seloumi opened this issue Jan 28, 2018 · 1 comment

Comments

@seloumi
Copy link

seloumi commented Jan 28, 2018

Brief outline of the bug

I have the following example, the headings on bookmarks when opening pdf file show strange characters unlike if we use bidi

Minimal example showing the bug

\RequirePackage{latexbug}      
\documentclass[a4paper]{book}
\usepackage{hyperref}
\usepackage[english, bidi=basic-r, layout=counters]{babel}
\babelprovide[import=ar, main]{arabic}
\babelfont{rm}{Amiri}

\begin{document}
\tableofcontents
\chapter{مقدمة}
\chapter{نظرة عامة}
\section{وجه التسمية}
\section{تاريخ}
\subsection{التيار الكهربائي}
\subsection{جدول التوزيع الإلكتروني}
\end{document}

With bidi

\RequirePackage{latexbug}      
\documentclass[a4paper]{book}
\usepackage{hyperref}
\usepackage{fontspec}
\usepackage[rldocument]{bidi}
\setmainfont[Script=Arabic]{Amiri}

\begin{document}
\tableofcontents
\chapter{مقدمة}
\chapter{نظرة عامة}
\section{وجه التسمية}
\section{تاريخ}
\subsection{التيار الكهربائي}
\subsection{جدول التوزيع الإلكتروني}
\end{document}

Log file (required) and possibly PDF file

Bookmarks with babel
result_with_babel

Bookmarks with bidi
result_with_bidi

@eg9
Copy link
Contributor

eg9 commented Jan 28, 2018

This is no LaTeX bug. Just load hyperref after babel with the unicode option.

\documentclass[a4paper]{book}
\usepackage[english, bidi=basic-r, layout=counters]{babel}
\usepackage[unicode]{hyperref}
\babelprovide[import=ar, main]{arabic}
\babelfont{rm}{Amiri}

screen shot 2018-01-28 at 16 59 31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants