# page headings in scrbook and xepersian

I found the page about page numbers in xepersian, but the problem seems to be more general. I cannot get the page headings with scrpage2 in the KomaScript classes to work. I tried the following:

\documentclass{scrbook}

\usepackage{hyperref}

\usepackage{xepersian}\renewcommand{\thepage}{\texorpdfstring{\lr{\arabic{page}}}{\arabic{page}}}

\usepackage{scrpage2}

\begin{document}
\begin{latin}

\chapter{First Chapter}

\section{Test 1}
Text

\newpage

\section{Test 2}

Text 2

\newpage

\section{Test 3}

\end{latin}

\end{document}


But this gives me Persian characters in the header.

-
Make a bug report in github.com/vafa/xepersian/issues but I do not promise updating xepersian package unless there is some donations to the project –  Vafa Nov 4 '12 at 11:31

Adding \ohead{\lr{\headmark}} to your preamble (after loading scrpage2) seems to do the trick.

\documentclass{scrbook}

\usepackage{hyperref}

\usepackage{xepersian}

\renewcommand{\thepage}{\texorpdfstring{\lr{\arabic{page}}}{\arabic{page}}}

\usepackage{scrpage2}

\begin{document}

\begin{latin}

\chapter{First Chapter}

\section{Test 1}

Text

\newpage

\section{Test 2}

Text 2

\newpage

\section{Test 3}

\end{latin}

\end{document}


Output (p. 2):

-