同一文档中的梵语 Devanāgarī 连字和音译

同一文档中的梵语 Devanāgarī 连字和音译

有没有办法在 Devanāgarī 和 IAST 的梵文排版之间切换,并保持自动连字?请参阅以下示例:

\documentclass{memoir}
\usepackage{polyglossia}
\usepackage{fontspec}
\setdefaultlanguage{english}
\setotherlanguage{sanskrit}
\newfontfamily\sanskritfont{Latin Modern Roman}


% The following does not activate Sanskrit hyphenation:
\newfontfamily
\sanskritdeva[Script=Devanagari,Mapping=RomDev,Scale=2.2]{Sanskrit 2003}
\newcommand{\sd}[1]{{\sanskritdeva{#1}}}

\begin{document}

\begin{sanskrit}
athety ayam adhikārārthaḥ. yogānuśāsanaṃ śāstram adhikṛtaṃ veditavyam. yogaḥ samādhiḥ. sa ca sārvabhaumaś cittasya dharmaḥ. kṣiptaṃ mūḍhaṃ vikṣiptam ekāgraṃ niruddham iti cittabhūmayaḥ. tatra vikṣipte cetasi vikṣepopasarjanībhūtaḥ samādhir na yogapakṣe vartate. yas tv ekāgre cetasi sadbhūtam arthaṃ pradyotayati kṣiṇoti ca kleśān karmabandhanāni ślathayati nirodham abhimukhaṃ karoti sa saṃprajñāto yoga ity ākhyāyate. sa ca vitarkānugato vicārānugata ānandānugato 'smitānugata ity upariṣṭān nivedayiṣyāmaḥ. sarvavṛttinirodhe tv asaṃprajñātaḥ samādhiḥ. 1.1
\end{sanskrit}


\sd{athety ayam adhikārārthaḥ. yogānuśāsanaṃ śāstram adhikṛtaṃ veditavyam. yogaḥ samādhiḥ. sa ca sārvabhaumaś cittasya dharmaḥ. kṣiptaṃ mūḍhaṃ vikṣiptam ekāgraṃ niruddham iti cittabhūmayaḥ. tatra vikṣipte cetasi vikṣepopasarjanībhūtaḥ samādhir na yogapakṣe vartate. yas tv ekāgre cetasi sadbhūtam arthaṃ pradyotayati kṣiṇoti ca kleśān karmabandhanāni ślathayati nirodham abhimukhaṃ karoti sa saṃprajñāto yoga ity ākhyāyate. sa ca vitarkānugato vicārānugata ānandānugato 'smitānugata ity upariṣṭān nivedayiṣyāmaḥ. sarvavṛttinirodhe tv asaṃprajñātaḥ samādhiḥ. 1.1}

\end{document}

在此处输入图片描述

而在以下文档中,

\documentclass{memoir}
\usepackage{polyglossia}
\usepackage{fontspec}
\setdefaultlanguage{english}
\setotherlanguage{sanskrit}
\newfontfamily\sanskritfont[Script=Devanagari,Mapping=RomDev,Scale=2.2]{Sanskrit 2003}

\begin{document}

\begin{sanskrit}
athety ayam adhikārārthaḥ. yogānuśāsanaṃ śāstram adhikṛtaṃ veditavyam. yogaḥ samādhiḥ. sa ca sārvabhaumaś cittasya dharmaḥ. kṣiptaṃ mūḍhaṃ vikṣiptam ekāgraṃ niruddham iti cittabhūmayaḥ. tatra vikṣipte cetasi vikṣepopasarjanībhūtaḥ samādhir na yogapakṣe vartate. yas tv ekāgre cetasi sadbhūtam arthaṃ pradyotayati kṣiṇoti ca kleśān karmabandhanāni ślathayati nirodham abhimukhaṃ karoti sa saṃprajñāto yoga ity ākhyāyate. sa ca vitarkānugato vicārānugata ānandānugato 'smitānugata ity upariṣṭān nivedayiṣyāmaḥ. sarvavṛttinirodhe tv asaṃprajñātaḥ samādhiḥ. 1.1
\end{sanskrit}

\end{document}

我们确实得到了正确的连字符,因为这里使用 polyglossia 切换到使用天城文的梵语:

在此处输入图片描述

(我知道,如果不使用羅馬德夫地图,也许没有使用梵语 2003 字体。无论如何,这就是我想要的设置。如果有帮助的话,我可以制作更多没有映射的示例,使用 unicode Devanāgarī 输入,并使用可能更容易获得的字体。)

相关内容