1

When I use \section{abcd} in this document, I get a polyglossia error. The document without \section{} compiles normally. Kindly help.

\documentclass[letterpaper, 10pts]{scrartcl}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage[Latin,Devanagari]{ucharclasses}
\setmainfont{Charis SIL}
% Maybe Sanskrit 2003 doesn't need the following line;
% in this case change \devanagarifont in the \setTransitions
% commands to \normalfont
\newfontfamily{\devanagarifont}{Sanskrit 2003}
% choose the font for English
\newfontfamily{\englishfont}[Ligatures=TeX]{Charis SIL}
\setmainlanguage{hindi}
\setotherlanguage{english}
\setTransitionsFor{Latin}
  {\hyphenrules{english}\englishfont}
  {\hyphenrules{hindi}\devanagarifont}
\setTransitionsFor{Devanagari}
  {\hyphenrules{hindi}\devanagarifont}
  {\hyphenrules{english}\englishfont}
%----------------------------------------------------------------------------------------------
\usepackage{fancyhdr, tikz, eso-pic}
\usepackage[pdfauthor={Vaibhav Banait},%
pdftitle={Consultation},%
pagebackref=true,%
]{hyperref}
\usepackage[headsep=3 cm,top=5 cm, bottom=5 cm, footskip=1 cm]{geometry}
%\usepackage{bookman}
\AddToShipoutPicture{%
  \AtTextUpperLeft{%
    \makebox(420,75)[lt]{%
      \small%
      \begin{tabular}{@{}*{3}{p{3.5cm}}@{}}%
      \textbf{Name}\newline\mypatient&%
      \textbf{Date of birth}\newline\mydate&%
      \textbf{Address}\newline\myaddress%
      \end{tabular}%
}}}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LO]{{\large  DR ABCD} \\ MD, DNB, DM\\Gastroenterologist\\ Reg No XXXX}
    \fancyhead[RO]{{\large DR CDEF }\\ MBBS, DOMS \\Eye surgeon \\ Reg No 2000/xx/xx}
\renewcommand{\footrulewidth}{0.4pt}%
\fancyfoot[CO]{{\scshape XXXX CLINIC}\\ 148, XXX Nagar,\\  CITY 75 \\ Phone: xxxxxxxxx, 0986xxxxxx6}

\usepackage{titling}
\posttitle{\par\end{center}}
\setlength{\droptitle}{-80pt}
\title{}
\author{}
\begin{document}
\section{History}

 % Here is the error. Remove section to compile normally***********

नई दिल्ली, भारत की राजधानी है। कुल ४२.७ वर्ग किमी क्षेत्रफल के साथ, नई दिल्ली दिल्ली महानगर 
के भीतर आता है और यहाँ पर भारत सरकार और दिल्ली सरकार के सभी प्रशासनिक भवन स्थित हैं।

New Delhi is the capital of India, and the seat of executive, legislative, and judiciary 
branches of the Government of India. It also serves as the centre of the Government of the 
National Capital Territory of Delhi. New Delhi is situated within the metropolis of Delhi 
and is one of the eleven districts of Delhi National Capital Territory.

नई दिल्ली, भारत की राजधानी है। कुल ४२.७ वर्ग किमी क्षेत्रफल के साथ, नई दिल्ली दिल्ली महानगर 
के भीतर आता है और यहाँ पर भारत सरकार और दिल्ली सरकार के सभी प्रशासनिक भवन स्थित हैं।

\end{document}
  • 2
    How do you compile? What is the error message you get? Suppose that not all here have sanskrit installed ... – Mensch Sep 20 '14 at 18:12
  • polyglossia: The current roman font does not contain the Devana(polyglossia) Please define \devanagarifont with \newfontfamily. \section*{hgh} – Vaibhav Sep 20 '14 at 19:09
  • compiled xelatex – Vaibhav Sep 20 '14 at 19:10
  • 2
    This is actually due to the class you are using. If you want to use your \englishfont for the headers, you need to set something like \setkomafont{disposition}{\englishfont} (or \englishfont\bfseries, etc.). – jon Sep 20 '14 at 19:52
1

Something as simple as \setkomafont{disposition}{\englishfont} will allow this document to compile without error (though currently the commands \mypatient, \mydate, and \myaddress are also undefined).

If I make the changes described or implied above, this works:

\documentclass[letterpaper, 10pts]{scrartcl}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage[Latin,Devanagari]{ucharclasses}
\setmainfont{Charis SIL}
% Maybe Sanskrit 2003 doesn't need the following line;
% in this case change \devanagarifont in the \setTransitions
% commands to \normalfont
\newfontfamily{\devanagarifont}{Sanskrit 2003}
% choose the font for English
\newfontfamily{\englishfont}[Ligatures=TeX]{Charis SIL}
\setmainlanguage{hindi}
\setotherlanguage{english}
\setTransitionsFor{Latin}
  {\hyphenrules{english}\englishfont}
  {\hyphenrules{hindi}\devanagarifont}
\setTransitionsFor{Devanagari}
  {\hyphenrules{hindi}\devanagarifont}
  {\hyphenrules{english}\englishfont}
%----------------------------------------------------------------------------------------------
\usepackage{fancyhdr, tikz, eso-pic}
\usepackage[pdfauthor={Vaibhav Banait},%
pdftitle={Consultation},%
pagebackref=true,%
]{hyperref}
\usepackage[headsep=3 cm,top=5 cm, bottom=5 cm, footskip=1 cm]{geometry}
%\usepackage{bookman}
\AddToShipoutPicture{%
  \AtTextUpperLeft{%
    \makebox(420,75)[lt]{%
      \small%
      \begin{tabular}{@{}*{3}{p{3.5cm}}@{}}%%
% \mypatient, \mydate, and \myaddress are undefined:
      \textbf{Name}\newline mypatient&%
      \textbf{Date of birth}\newline mydate&%
      \textbf{Address}\newline myaddress%
      \end{tabular}%
}}}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LO]{{\large  DR ABCD} \\ MD, DNB, DM\\Gastroenterologist\\ Reg No XXXX}
    \fancyhead[RO]{{\large DR CDEF }\\ MBBS, DOMS \\Eye surgeon \\ Reg No 2000/xx/xx}
\renewcommand{\footrulewidth}{0.4pt}%
\fancyfoot[CO]{{\scshape XXXX CLINIC}\\ 148, XXX Nagar,\\  CITY 75 \\ Phone: xxxxxxxxx, 0986xxxxxx6}

\usepackage{titling}
\posttitle{\par\end{center}}
\setlength{\droptitle}{-80pt}
\title{}
\author{}

% Key addition:
\setkomafont{disposition}{\englishfont}

\begin{document}
\section{History}

 % Here is the error. Remove section to compile normally***********

नई दिल्ली, भारत की राजधानी है। कुल ४२.७ वर्ग किमी क्षेत्रफल के साथ, नई दिल्ली दिल्ली महानगर
के भीतर आता है और यहाँ पर भारत सरकार और दिल्ली सरकार के सभी प्रशासनिक भवन स्थित हैं।

New Delhi is the capital of India, and the seat of executive, legislative, and judiciary
branches of the Government of India. It also serves as the centre of the Government of the
National Capital Territory of Delhi. New Delhi is situated within the metropolis of Delhi
and is one of the eleven districts of Delhi National Capital Territory.

नई दिल्ली, भारत की राजधानी है। कुल ४२.७ वर्ग किमी क्षेत्रफल के साथ, नई दिल्ली दिल्ली महानगर
के भीतर आता है और यहाँ पर भारत सरकार और दिल्ली सरकार के सभी प्रशासनिक भवन स्थित हैं।

\end{document}

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.