4

Dear Ladies and Gentlemen,

If polyglossia is used with hyperref and the main language is set to Arabic, a rtl language, the file does not compile, as can be seen in the below example. If the main language is ltr, there is no problem. Does anybody know a solution to this problem?

With best wishes and thanks for your interest.

\documentclass[11pt,a4paper,twoside]{article}

\usepackage{polyglossia}

\usepackage[xetex]{hyperref}

\setmainlanguage{arabic}
\setmainfont[Script=Arabic,Scale=1.4]{Scheherazade}

\setotherlanguage{english}

\newfontfamily\arabicfont[Script=Arabic,Scale=1.4]{Scheherazade}
\newfontfamily\englishfont[Mapping=tex-text,Renderer=ICU]{Charis SIL}



\begin{document}

السلام عليكم

\begin{english}
\url{https://www.google.de}
\end{english}


\end{document}
  • Can you show us the error message. – Salim Bou Aug 16 '16 at 16:31
  • The console says that the current roman font does not contain the arabic script – Jens Bakker Aug 16 '16 at 18:07
2

You can use \href instead of \url in this case \englishfont is used for hyperlink text.

\documentclass[11pt,a4paper,twoside]{article}
\usepackage{hyperref}
\usepackage{polyglossia}


\setmainlanguage{arabic}
\setotherlanguage{english}

\newfontfamily\arabicfont[Script=Arabic,Scale=1.4]{Scheherazade}
\newfontfamily\englishfont[Mapping=tex-text,Renderer=ICU]{Charis SIL}



\begin{document}

السلام عليكم

\begin{english}
\href{https://www.google.de}{www.google.de}
\end{english}


\end{document} 

Or just add

\let\arabicfonttt\ttfamily

Code

\documentclass[11pt,a4paper,twoside]{article}
\usepackage{hyperref}
\usepackage{polyglossia}


\setmainlanguage{arabic}
\setotherlanguage{english}

\newfontfamily\arabicfont[Script=Arabic,Scale=1.4]{Scheherazade}
\newfontfamily\englishfont[Mapping=tex-text,Renderer=ICU]{Charis SIL}

\let\arabicfonttt\ttfamily

\begin{document}

السلام عليكم

\begin{english}
\hrl{https://www.google.de}
\end{english}


\end{document}
  • dear salim bou, thank you very much for your advice, it works fine. – Jens Bakker Aug 18 '16 at 18:20

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.