4

I am using XeLaTeX (TeX Live 2012 on Windows) and my Sanskrit document is entirely in Devanagari. Even the page numbers, section numbers and section names are in Devanagari. I use fancyhdr but quite strangely, the size of the output of lhead and rhead is different. While lhead's text is small, that of rhead is large except for the subsection numbers. How can I control the size of the rhead to make it the same as lhead? Here is a working example.

\documentclass{article}
\usepackage{lipsum}
\usepackage{polyglossia}
\usepackage{fancyhdr}
\setmainlanguage{hindi}
\setotherlanguage{english}
\setmainfont[Script=Devanagari]{Arial Unicode MS} 
\newfontfamily\devanagarifont[Script=Devanagari]{Arial Unicode MS}
\newfontfamily{\englishfont}{Times New Roman}
\newcommand{\devanagarinumeral}[1]{%
   \devanagaridigits{\number\csname c@#1\endcsname}}
\usepackage{hyperref}
\begin{document}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\fancyhf{}
\lhead{\fancyplain{}{अमुकग्रन्थे}} 
\rhead{\fancyplain{}{\rightmark}}
\cfoot{\fancyplain{}{\thepage}}
\renewcommand{\thesection}{\devanagarinumeral{section}} 
\renewcommand{\thesubsection}{\small{\devanagarinumeral{section}.\devanagarinumeral{subsection}}}   
\renewcommand{\thepage}{\Large \devanagarinumeral{page}}
\section[\texorpdfstring{\Large प्रथमोऽध्यायः}{Chapter 1}]{प्रथमोऽध्यायः}
\subsection[\texorpdfstring{\Large प्रथमः पादः}{Part 1}]{प्रथमः पादः}
\begin{english}
\lipsum[1-10]
\end{english}
\end{document}
4

You have used \Large in

\section[\texorpdfstring{\Large प्रथमोऽध्यायः}{Chapter 1}]{प्रथमोऽध्यायः}

The optional argument is used for running headings. If you remove \Large, the problem is solved. Similarly in

\renewcommand{\thesubsection}{\small{\devanagarinumeral{section}.\devanagarinumeral{subsection}}}   
\renewcommand{\thepage}{\Large \devanagarinumeral{page}}

the \small and \Large are unnecessary.

Full code:

\documentclass{article}
\usepackage{lipsum}
\usepackage{polyglossia}
\usepackage{fancyhdr}
\setmainlanguage{hindi}
\setotherlanguage{english}
\setmainfont[Script=Devanagari]{Arial Unicode MS}
\newfontfamily\devanagarifont[Script=Devanagari]{Arial Unicode MS}
\newfontfamily{\englishfont}{Times New Roman}
\newcommand{\devanagarinumeral}[1]{%
   \devanagaridigits{\number\csname c@#1\endcsname}}
\usepackage{hyperref}
\begin{document}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\fancyhf{}
\lhead{{अमुकग्रन्थे}}
\rhead{{\normalsize\rightmark}}
\cfoot{{\thepage}}
\renewcommand{\thesection}{\devanagarinumeral{section}}
\renewcommand{\thesubsection}{{\devanagarinumeral{section}.\devanagarinumeral{subsection}}}
\renewcommand{\thepage}{\devanagarinumeral{page}}
\section[\texorpdfstring{प्रथमोऽध्यायः}{Chapter 1}]{प्रथमोऽध्यायः}
\subsection[\texorpdfstring{\Large प्रथमः पादः}{Part 1}]{प्रथमः पादः}
\begin{english}
\lipsum[1-10]
\end{english}
\end{document}

enter image description here

  • Thank you so much Harish! That worked. I might have mixed up the optional and mandatory section command arguments. – user22209 Nov 3 '13 at 21:13

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.