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}
Salim Bou
  • 17,021
  • 2
  • 31
  • 76

1 Answers1

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}
Salim Bou
  • 17,021
  • 2
  • 31
  • 76