1

I am editing a text that has a few articles in Devanagari and the rest in English. The opening and closing quotation marks are not displayed correctly. I have gone through most of the discussion on this site, but the problem persists.

\documentclass[paper=17cm:24cm,11pt,DIV=12,BCOR=10mm,headinclude=true,pagesize=false,headings=small,table]{scrbook}
\usepackage[frame,a4,center]{crop}

\usepackage{xspace}

\usepackage{hyperref}
\usepackage{csquotes}
\usepackage{newunicodechar}

\addtokomafont{disposition}{\rmfamily}
\renewcommand{\sffamily}{\rmfamily}

\usepackage{xunicode}
\usepackage{fontspec}
\usepackage[osf]{libertine}

\usepackage{polyglossia}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt

\setdefaultlanguage[variant=uk]{english}
\setmainfont{Linux Libertine O}
\newfontfamily\ef{Linux Libertine O}
\setotherlanguage{sanskrit}
\newfontfamily\devanagarifont[Script=Devanagari,Mapping=devanagarinumerals]{Sanskrit2003}
\font\df="Sanskrit 2003:script=devanagari" at 12pt
\font\dfs="Sanskrit 2003:script=devanagari" at 10pt
\setotherlanguage{tibetan}
\newfontfamily\tf {Kailasa}
\newfontfamily\stsong{STSong}
\newcommand\chinese[1]{{\stsong #1}}
\begin{document}

\df {अधुना कवेः कुलनाम विमर्शितव्यम्~। अत्र विद्येते द्वौ पाठौ ``उदुम्बरनामान" इति ``डम्बरनामान" इति च~।}


\ef {In a way, we can say that ``Jain poetics" is not given proper attention in the entire history of Sanskrit poetics on which scholars of the rank of Mahāmahopādhyāya Kane }

\end{document}
3
  • Please also specify which engine you are using for this, is is XeLaTeX?
    – daleif
    Mar 23, 2021 at 10:54
  • @daleif, yes, XeLaTex Mar 23, 2021 at 12:10
  • 1
    First of all: You are loading csquotes, but you do not use it. You still hard-code the quotation marks as ``Jain poetics" and do not use csquotes' features such as \enquote{Jain poetics}. Secondly, csquotes needs more than just font switching: it reacts to language switching. So \df to switch the font is not enough, you need to switch the language as well. Lastly, I don't think csquotes actually supports any Indic language at the moment. So you'd have to configure it for Devanagari quotation marks first.
    – moewe
    Mar 24, 2021 at 6:53

1 Answer 1

6

There are three main obstacles for csquotes in the code shown in the question

  1. The code loads csquotes but then does not use it. It still 'hard-codes' the quotation marks with

    ``Jain poetics"
    

    You want to use csquotes facilities like \enquote

    \enquote{Jain poetics}
    
  2. csquotes only adapts to language changes, not to font changes. Currently the code just switches font with \df, but not language. You want to try something like

    \begin{document}
    \begin{sanskrit}
     अधुना कवेः कुलनाम विमर्शितव्यम्~। अत्र विद्येते द्वौ पाठौ
     \enquote{उदुम्बरनामान} इति \enquote{डम्बरनामान} इति च~।
    \end{sanskrit}
    
    In a way, we can say that \enquote{Jain poetics} is not given proper attention
    in the entire history of Sanskrit poetics on which scholars
    of the rank of Mahāmahopādhyāya Kane
    \end{document}
    

    But you will also need to use the csquotes option autostyle for csquote to adapt to all language changes in your document.

  3. csquotes does not have a configuration for Sanskrit quotation marks. So you have to supply one yourself. I couldn't find something when I googled for Sanskrit quotation marks, so you will have to fill in the correct characters yourself in

    \DeclareQuoteStyle{sanskrit}
      {<outer left>}
      {<outer right>}
      {<inner left>}
      {<inner right>}
    

    Note that your Sanskrit font must contain the characters you use. That was a problem in the code from the question as well: Your Sanskrit font doesn't have the characters for `` and ", so you just get empty boxes.

In total, here is what the code could look like (but you need to adjust the \DeclareQuoteStyle{sanskrit})

\documentclass{article}
\usepackage{fontspec}
\usepackage[osf]{libertine}
\usepackage{polyglossia}
\usepackage[autostyle=true]{csquotes}
\usepackage{hyperref}

\setdefaultlanguage[variant=uk]{english}

\setotherlanguage{sanskrit}
\newfontfamily\devanagarifont[Script=Devanagari,Mapping=devanagarinumerals]
  {NotoSansDevanagari-Regular.ttf}

\DeclareQuoteStyle{sanskrit}
  {<outer left>}
  {<outer right>}
  {<inner left>}
  {<inner right>}

\begin{document}
\begin{sanskrit}
 अधुना कवेः कुलनाम विमर्शितव्यम्~। अत्र विद्येते द्वौ पाठौ
 \enquote{उदुम्बरनामान} इति \enquote{डम्बरनामान} इति च~।
\end{sanskrit}

In a way, we can say that \enquote{Jain poetics} is not given proper attention
in the entire history of Sanskrit poetics on which scholars
of the rank of Mahāmahopādhyāya Kane
\end{document}

Nice quotation marks in English text, garbled placeholders in Sanskrit passage.

1
  • Thanks. I had indeed used \enquote{} for the English part, but it did not solve the problem at that time. Now it is working. Mar 25, 2021 at 6:25

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.