Sanskrit typing in Overleaf
Author
Priyanka Salekar
Last Updated
9 months ago
License
Creative Commons CC BY 4.0
Abstract
Sanskrit typing in overleaf or latex using XeLaTex Compiler
\documentclass{article}
\usepackage[a4paper,portrait,margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{fontspec}
\newfontfamily\s[Script=Devanagari]{Shobhika}
\newfontfamily\sa[Script=Devanagari]{Shobhika-Bold}
\newfontfamily\hindifont{Noto Sans Devanagari}[Script=Devanagari]
\usepackage{polyglossia}
\usepackage{fontawesome}
\setmainlanguage{english}
\setotherlanguages{marathi,hindi,sanskrit}
\newfontfamily\devanagarifont[Script=Devanagari]{Noto Serif Devanagari}
\usepackage{skt}
\title {Sanskrit typing in Overleaf}
\author{Priyanka Salekar}
\date{January 2024}
\begin{document}
\maketitle
\vspace{20mm}
{\begin{center}
\large\textbf{\textit{All fonts work with XeLaTex compiler only.\\ Otherwise upload the script file separetely.}}
\end{center}}
\pagebreak
\section{Devanagari - Shobhika font with Phonetic keyboard}
\begin{Large}
\begin{itemize}
\item This need keyboard setting changed to Kagapa Phonetic keyboard.
\item Must use these packages - fontspec, script packages
%\usepackage{fontspec}
%\newfontfamily\s[Script=Devanagari]{Shobhika}, %\newfontfamily\sa[Script=Devanagari]{Shobhika-Bold}
\item For e.g. -\\
{\scriptsize {\s हो हौ ऽ हं स श ष कार्स्न्य विद्या सङ्कर्षण}}\\
{\small {\s क्ष ज्ञ ण्य डढ टठ ॠ ॠ ळ ऋ ल ऌ वे ऐ आ अ ई इ उ ऊहु }}\\
{\large {\s उपाध्यायान्दशाचार्याः विमूर्च्छिताः निष्कृतिः}}\\
{\Large {\s क्त्वा क्ततवतु निष्ठा सक्तुमिव तितउना }}\\
{\huge {\s होहौऽहंसशष कार्स्न्य विद्या सङ्कर्षण}}
\end{itemize}
\end{Large}
\pagebreak
\section{Devanagari - Shobhika font with Google Input}
\begin{Large}
\begin{itemize}
\item Needs google input tools installed or you can copy paste the content from its web-based version.\\
Link - https://www.google.co.in/inputtools/try/
\item Must use packages - fontspec, script packages
\item Set language to Sanskrit, Hindi or Marathi for typing Devanagari.
%\usepackage{fontspec}
%\newfontfamily\s[Script=Devanagari]{Shobhika}, %\newfontfamily\sa[Script=Devanagari]{Shobhika-Bold}
\item For e.g. -\\
{\scriptsize {\s अ आ इ ई उ ऊ ऋ ॠ लृ लृ३ ए ऐ ओ औ अं अः ळ क्ष ज्ञ त्र ण्य}}\\
{\small {\s अभून् नृपो विबुधसखः परन्तपः}}\\
{\large {\s श्रुतान्वितो दशरथ इत्युदाहृतः।}}\\
{\Large {\s गुणैर्वरं भुवनहितच्छलेन यं}}\\
{\huge {\s सनातनः पितरमुपागमत् स्वयम्॥}}
\end{itemize}
\end{Large}
\pagebreak
\section{Devanagari - Regular font with Google input}
\begin{Large}
\begin{itemize}
\item Change keyboard settings to Google input tool or can copy paste from Aksharmukh - https://aksharamukha.appspot.com/converter
\item Must use hindifont command before every writing.
%{\hindifont[]{}{}}%
\item Must use these packages - fontspec, newfont command
%\newfontfamily
%\hindifont{Noto Sans Devanagari}[Script=Devanagari]
\item For e.g. -\\
{\hindifont
{\scriptsize क्ष ज्ञ ण्य डढ टठ ॠ ॠ ळ ऋ ल ऌ वे ऐ आ अ ई इ उ ऊहु}\\
{\small उपाध्यायान्दशाचार्याः विमूर्च्छिताः निष्कृतिः}\\
{\large क्त्वा क्ततवतु निष्ठा सक्तुमिव तितउना}\\
{\Large होहौऽहंसशष कार्स्न्य विद्या सङ्कर्षण}\\
{\huge हो हौ ऽ हं स श ष कार्स्न्य विद्या सङ्कर्षण}
}
\end{itemize}
\end{Large}
\pagebreak
\section{Devanagari - Awesome font with Google input}
\begin{Large}
\begin{itemize}
\item Works with google input tool
\item Begin writing with begin command in bracket sanskrit, hindi, etc.
\item must use packages - polyglossia, fontawesome and set command for language used - marathi, hindi, etc. fontfamily command
%\usepackage{polyglossia}
%\usepackage{fontawesome}
%\setmainlanguage{english}
%\setotherlanguages{marathi,hindi,sanskrit}
%\newfontfamily\devanagarifont[Script=Devanagari]{Noto Serif Devanagari}
\item \begin{sanskrit}
\scriptsize {सर्वे मानवाः स्वतन्त्राः समुत्पन्नाः वर्तन्ते अपि च, गौरवदृशा अधिकारदृशा च समानाः एव वर्तन्ते।}\\
\small लभेत सिकतासु तैलमपि यत्नतः पीडयन्\\
\large पिबेच्च मृगतृष्णिकासु सलिलं पिपासार्दितः।\\
\Large कदाचिदपि पर्यटन् शशविषाणमासादयेन्\\
\huge न तु प्रतिनिविष्टमूर्खजनचित्तमाराधयेत्।।
\end{sanskrit}
\end{itemize}
\end{Large}
\pagebreak
\section{Roman Transliteration - IAST}
\begin{Large}
\begin{itemize}
\item Needs keyboard setting changed to English (India) or can copy from Aksharmukh.\\
Click on the "ENG" at the right corner of the taskbar. Then you will see the "Language Preference" option. Click it. Settings page opens. There click on ``add a preferred language". Select "English (India) language pack." Install it. Now, from the taskbar, click on Eng. Select Eng (India) keyboard.
\item ā, Ā, ī, Ī, ū, Ū, ḥ, Ḥ, ṁ, Ṁ, ṭ, Ṭ, ḍ, Ḍ, ṇ, Ṇ, ś, Ś, r̥, R̥, l̥, L̥ - for these letters, press right Alt key+the respective letter.
For capital letters, press the Caps Lock key as usual.
ṣ, Ṣ - right Alt key + x, right Alt key + X
ñ, Ñ - right Alt key + y, right Alt key + Y
ṅ, Ṅ - right Alt key + g, right Alt key + G
\item For Eg. -\\
\scriptsize ahaṁ brahmāsmi\\
\small sarvaṁ khlvidaṁ brahma\\
\large prajñānaṁ brahma\\
\Large tattvamasi\\
\huge ayamātmā brahma
\end{itemize}
\end{Large}
\pagebreak
\section{Old method}
\Large Needs pre-processing.\\
{\skt .sa;vRa;Da;ma;Ra;n,a :pa;i8a:=+tya:j1ya ma;a;mea;k\ZH{-12}{M} Za:=+NMa
v.ra:ja \ZS{12}@A \\
A;h\ZH{-6}{M} tva;Ma .sa;vRa;pa;a;pea;Bya;ea ma;ea;[a;Y4a;ya;Sya;a;Y6a;ma
ma;a Zua;.caH\ZS{4} \ZS{12}@A\ZS{6}@A 66 \ZS{12}@A\ZS{6}@A}
\end{document}