I am trying to produce a critical edition of a Sanskrit text, where the publisher needs Devanāgarī script for the main text, but roman for the variants in the footnotes. The text had already been prepared in roman and the critical edition setup worked very well. Since the main book in is English, and the numbering with the edition should be in roman, I thought that it would be better to keep the main language English and switch to Devanāgarī. But there are two problems: In the example below (just seach for %% to jump to the problematic lines) you can see three identical verses and a bit of prose. The first verse is typeset by using \skt{} for switching to Devanāgarī, the second by using \startsanskrit ... \stopsanskrit. In the first verse the linespacing between the third and the fourth line is wrong, perhaps the baseline is not set by this command, but why does it show in the fourth line? Anyway, this is just for reference, for the method with \startsanskrit ... \stopsanskrit, works, but I cannot find a way to switch to roman in the footnote \var{}. Is there an elegant way to keep the footnotes roman? In the definition of \var? \definepapersize[IeT][width=155mm, height=220mm] \setuppapersize[IeT][IeT] \setuplayout[height=200mm,width=120mm,header=14pt,marking=on,backspace=13mm,topspace=15mm, headerdistance=4mm,bottomdistance=2pt,location=doublesided] \setupheader[leftwidth=.8\hsize,rightwidth=.8\hsize,style=\tfx] \setuppagenumbering[alternative=doublesided,location={header,right}] \setupheadertexts[prathama upadeśaḥ][pagenumber][pagenumber][Haṭhapradīpikājyotsnā] \mainlanguage[english] \setupbodyfontenvironment [default][em=italic] \definefontfeature[default][default][fakecombining=yes,compose=yes,itlc=yes,protrusion=quality,expansion=quality,onum=yes] \definefallbackfamily [Roman] [rm] [Adishila San] [range=devanagari,features=devanagari-one] \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman] \definefontfamily [nagari] [rm] [Adishila San] [features=devanagari-one,rscale=1.6] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \definestartstop [sanskrit] [style={\language[sa]}] \define[1]\skt{\start\language[sa]#1\stop} \setupbodyfont[xcharter,10pt] % Critical Edition Setup: Prose with two layers of apparatus \setupnotations[alternative=serried] \setuplinenumbering[step=5,method=page,style=\tfx,location=outer,align=outer] \definelinenote[var][paragraph=yes] \definelinenote[comment][paragraph=yes] \definelines[sloka][][indenting={yes, small}, before=\blank\startnarrower,after=\stopnarrower\blank] \definelines[bsloka][][indenting={yes, small}, before=\blank,after=\blank] \setupalign[hz,vz,hanging,tolerant] \setupinterlinespace[line=2ex] \clubpenalty=10000 \widowpenalty=10000 \setuptolerance[horizontal,tolerant] \setuptolerance[vertical,tolerant] \setupwhitespace[small] \setupindenting[yes,1em] \setupblank[big] \def\lem{\kern0em{}]\enskip} % Manuscript sigla \def\Wthree{W\low{3} } \def\Wthreeplus{W\low{3}} \def\Wthreeac{W\low{3}\high{ac}\ } \def\Wthreepc{W\low{3}\high{pc}\ } \def\Tue{Tue\ } \def\Tueplus{Tue} \def\Tueac{Tue\high{ac}\ } \def\Tuepc{Tue\high{pc}\ } \def\Msix{Bo\low{3}\ } \def\Peighteen{\P\low{18}} \def\Pnt{P\low{19}\ } \def\Pntplus{P\low{19}} \def\Pntac{P\low{19}\high{ac}\ } \def\Pntpc{P\low{19}\high{pc}\ } \def\Pntohne{P\low{19}} \def\EdMu{Ed\low{Mu}\ } \def\emend{em.\ } \def\EdLo{Ed\low{Lon}\ } \def\EdAd{Ed\low{Adyar}\ } \def\om{om.} \starttext \setupheader [state=stop] \startalignment[center] {\tfb \skt{haṭhapradīpikājyotsnā}} \blank[7mm] {\tfa\skt{prathama upadeśaḥ}} \stopalignment \blank[7mm] \startlinenumbering %\begin{vsid}{hp01_001} \startsloka \skt{śrīādināthāya namo'stu tasmai \ \ yenopadiṣṭā haṭhayogavidyā vibhrājate pronnatarājayoga- %% problem: this line and the next are too narrow \ \ māroḍhumicchoradhirohiṇīva} \stopsloka \startsanskrit \startsloka śrīādināthāya namo'stu tasmai \ \ yenopadiṣṭā haṭhayogavidyā vibhrājate pronnatarājayoga- %% no problem here \ \ māroḍhumicchoradhirohiṇīva \stopsloka \stopsanskrit \startsanskrit \startsloka śrīādināthāya namo'stu tasmai \ \ yenopadiṣṭā haṭhayogavidyā\var{text \lem variant.} %% But the variant text does not appear. vibhrājate pronnatarājayoga- \ \ māroḍhumicchoradhirohiṇīva \stopsloka \stopsanskrit \blank \noindent \skt{mumukṣujanahitārthaṃ rājayogadvārā kaivalyaphalāṃ haṭhapradīpikāṃ vidhitsuḥ paramakāruṇikaḥ svātmārāmayogīndrastatpratyūhanivṛttaye haṭhayogapravartakaśrīmadādināthanamaskāralakṣaṇaṃ}\var{lakṣaṇaṃ~\lem rūpaṃ \Pnt} \skt{maṅgalaṃ tāvadācarati} \stoplinenumbering\stoptext --- Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanneder@staff.uni-marburg.de
Am 17.01.2026 um 12:04 schrieb Jürgen Hanneder via ntg-context:
I am trying to produce a critical edition of a Sanskrit text, where the publisher needs Devanāgarī script for the main text, but roman for the variants in the footnotes. The text had already been prepared in roman and the critical edition setup worked very well. Since the main book in is English, and the numbering with the edition should be in roman, I thought that it would be better to keep the main language English and switch to Devanāgarī.
But there are two problems:
In the example below (just seach for %% to jump to the problematic lines) you can see three identical verses and a bit of prose. The first verse is typeset by using \skt{} for switching to Devanāgarī, the second by using \startsanskrit ... \stopsanskrit. In the first verse the linespacing between the third and the fourth line is wrong, perhaps the baseline is not set by this command, but why does it show in the fourth line?
Anyway, this is just for reference, for the method with \startsanskrit ... \stopsanskrit, works, but I cannot find a way to switch to roman in the footnote \var{}.
Is there an elegant way to keep the footnotes roman? In the definition of \var?
1. You have to work on your example because there is too much useless stuff and it's no fun to take a look at the problem with such a start. 2. You have to disable the transliteration for the footnote within the transliterated text, e.g. \var{\resettransliteration ...}
\definepapersize[IeT][width=155mm, height=220mm] \setuppapersize[IeT][IeT] \setuplayout[height=200mm,width=120mm,header=14pt,marking=on,backspace=13mm,topspace=15mm, headerdistance=4mm,bottomdistance=2pt,location=doublesided] \setupheader[leftwidth=.8\hsize,rightwidth=.8\hsize,style=\tfx] \setuppagenumbering[alternative=doublesided,location={header,right}] \setupheadertexts[prathama upadeśaḥ][pagenumber][pagenumber] [Haṭhapradīpikājyotsnā] \mainlanguage[english] \setupbodyfontenvironment [default][em=italic]
All of the setups above can be removed for the example.
\definefontfeature[default][default] [fakecombining=yes,compose=yes,itlc=yes,protrusion=quality,expansion=quality,onum=yes]
\definefallbackfamily [Roman] [rm] [Adishila San] [range=devanagari,features=devanagari-one] \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman] \definefontfamily [nagari] [rm] [Adishila San] [features=devanagari- one,rscale=1.6]
Try to find fonts which which are either included with a standard Context installation or part of a OS, e.g. Nirmala Text is included on Windows 11.
\usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \definestartstop [sanskrit] [style={\language[sa]}] \define[1]\skt{\start\language[sa]#1\stop}
\setupbodyfont[xcharter,10pt]
% Critical Edition Setup: Prose with two layers of apparatus \setupnotations[alternative=serried] \setuplinenumbering[step=5,method=page,style=\tfx,location=outer,align=outer] \definelinenote[var][paragraph=yes] \definelinenote[comment][paragraph=yes] \definelines[sloka][][indenting={yes, small}, before=\blank\startnarrower,after=\stopnarrower\blank] \definelines[bsloka][][indenting={yes, small}, before=\blank,after=\blank]
Drop custom environments which aren't needed for the example.
\setupalign[hz,vz,hanging,tolerant] \setupinterlinespace[line=2ex] \clubpenalty=10000 \widowpenalty=10000 \setuptolerance[horizontal,tolerant] \setuptolerance[vertical,tolerant] \setupwhitespace[small] \setupindenting[yes,1em]
\setupblank[big]
None of the alignment option are needed.
\def\lem{\kern0em{}]\enskip} % Manuscript sigla \def\Wthree{W\low{3} } \def\Wthreeplus{W\low{3}} \def\Wthreeac{W\low{3}\high{ac}\ } \def\Wthreepc{W\low{3}\high{pc}\ } \def\Tue{Tue\ } \def\Tueplus{Tue} \def\Tueac{Tue\high{ac}\ } \def\Tuepc{Tue\high{pc}\ } \def\Msix{Bo\low{3}\ } \def\Peighteen{\P\low{18}} \def\Pnt{P\low{19}\ } \def\Pntplus{P\low{19}} \def\Pntac{P\low{19}\high{ac}\ } \def\Pntpc{P\low{19}\high{pc}\ } \def\Pntohne{P\low{19}} \def\EdMu{Ed\low{Mu}\ } \def\emend{em.\ } \def\EdLo{Ed\low{Lon}\ } \def\EdAd{Ed\low{Adyar}\ }
\def\om{om.}
Remove all custom commands when necessary, especially when you don't even use them.
\starttext \setupheader [state=stop] \startalignment[center] {\tfb \skt{haṭhapradīpikājyotsnā}}
\blank[7mm]
{\tfa\skt{prathama upadeśaḥ}} \stopalignment
\blank[7mm]
\startlinenumbering %\begin{vsid}{hp01_001}
\startsloka \skt{śrīādināthāya namo'stu tasmai \ \ yenopadiṣṭā haṭhayogavidyā vibhrājate pronnatarājayoga- %% problem: this line and the next are too narrow \ \ māroḍhumicchoradhirohiṇīva} \stopsloka
\startsanskrit \startsloka śrīādināthāya namo'stu tasmai \ \ yenopadiṣṭā haṭhayogavidyā vibhrājate pronnatarājayoga- %% no problem here \ \ māroḍhumicchoradhirohiṇīva \stopsloka \stopsanskrit
Keep the content to a minimum, none of the text above is needed to show the problem.
\startsanskrit \startsloka śrīādināthāya namo'stu tasmai \ \ yenopadiṣṭā haṭhayogavidyā\var{text \lem variant.} %% But the variant text does not appear. vibhrājate pronnatarājayoga- \ \ māroḍhumicchoradhirohiṇīva \stopsloka \stopsanskrit
\blank \noindent \skt{mumukṣujanahitārthaṃ rājayogadvārā kaivalyaphalāṃ haṭhapradīpikāṃ vidhitsuḥ paramakāruṇikaḥ svātmārāmayogīndrastatpratyūhanivṛttaye
haṭhayogapravartakaśrīmadādināthanamaskāralakṣaṇaṃ}\var{lakṣaṇaṃ~\lem rūpaṃ \Pnt} \skt{maṅgalaṃ tāvadācarati} \stoplinenumbering\stoptext
Wolfgang
1. You have to work on your example because there is too much useless stuff and it's no fun to take a look at the problem with such a start.
Sorry, here is the minimum I guess: ------------------------- % Devanāgarī setup \definefallbackfamily [Roman] [rm] [Adishila San] [range=devanagari,features=devanagari-one] \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman] \definefontfamily [nagari] [rm] [Adishila San] [features=devanagari-one,rscale=1.9] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \definestartstop [sanskrit] [style={\language[sa]}] \define[1]\skt{\start\language[sa]#1\stop} \setupbodyfont[xcharter] % footnotes \setupnotations[alternative=serried] \setuplinenumbering[step=5,method=page,style=\tfx,location=outer,align=outer] \definelinenote[var][paragraph=yes] % Test \startsanskrit śrīādi\var{ test} \stopsanskrit \stoptext ------------------------ I'll try to append the pdf, but you can see the text, a page number a footnote with only the line number, but no roman text "test". So I guess I have to swich to roman within the footnote, but no combination for \switchtobodyfont and \resettransliteration has worked. Thanks!
Try to find fonts which which are either included with a standard Context installation or part of a OS, e.g. Nirmala Text is included on Windows 11.
The font comes out fine, it is the first listed on https://wiki.contextgarden.net/Input_and_compilation/Languages/Indic_scripts and one of the best available. I am not using windows, only Linux, so I do not have the nirmala font. --- Prof. Dr. Juergen Hanneder Philipps-Universitaet Marburg FG Indologie u. Tibetologie Deutschhausstr.12 35032 Marburg Germany Tel. 0049-6421-28-24930 hanneder@staff.uni-marburg.de
Am 18.01.2026 um 09:31 schrieb Jürgen Hanneder via ntg-context:
1. You have to work on your example because there is too much useless stuff and it's no fun to take a look at the problem with such a start.
Sorry, here is the minimum I guess:
-------------------------
% Devanāgarī setup \definefallbackfamily [Roman] [rm] [Adishila San] [range=devanagari,features=devanagari-one] \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman]
\definefontfamily [nagari] [rm] [Adishila San] [features=devanagari- one,rscale=1.9] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \definestartstop [sanskrit] [style={\language[sa]}] \define[1]\skt{\start\language[sa]#1\stop}
\setupbodyfont[xcharter]
% footnotes \setupnotations[alternative=serried] \setuplinenumbering[step=5,method=page,style=\tfx,location=outer,align=outer] \definelinenote[var][paragraph=yes]
% Test \startsanskrit śrīādi\var{ test} \stopsanskrit
\startsanskrit śrīādi\var{\resettransliteration test} \stopsanskrit Wolfgang
And it works! Thanks a lot,
Jürgen
----- Nachricht von Wolfgang Schuster
Am 18.01.2026 um 09:31 schrieb Jürgen Hanneder via ntg-context:
1. You have to work on your example because there is too much useless stuff and it's no fun to take a look at the problem with such a start.
Sorry, here is the minimum I guess:
-------------------------
% Devanāgarī setup \definefallbackfamily [Roman] [rm] [Adishila San] [range=devanagari,features=devanagari-one] \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman]
\definefontfamily [nagari] [rm] [Adishila San] [features=devanagari- one,rscale=1.9] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \definestartstop [sanskrit] [style={\language[sa]}] \define[1]\skt{\start\language[sa]#1\stop}
\setupbodyfont[xcharter]
% footnotes \setupnotations[alternative=serried] \setuplinenumbering[step=5,method=page,style=\tfx,location=outer,align=outer] \definelinenote[var][paragraph=yes]
% Test \startsanskrit śrīādi\var{ test} \stopsanskrit
\startsanskrit śrīādi\var{\resettransliteration test} \stopsanskrit
Wolfgang
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________
----- Ende der Nachricht von Wolfgang Schuster
On 1/18/26 09:31, Jürgen Hanneder via ntg-context wrote:
I'll try to append the pdf, but you can see the text, a page number a footnote with only the line number, but no roman text "test". So I guess I have to swich to roman within the footnote, but no combination for \switchtobodyfont and \resettransliteration has worked.
Hi, first time I use transliteration, but if `\usetransliteration` is needed, it should be limited by setups (I guess) to make `\resettransliteration` work. Some comments: * Your font Roman needs no Indic script as fallback (since when Sanskrit as language is loaded, the nagari font is loaded [via setups]). * `\definestartstop` is a command (which seems to work better in your case). * You are using `\setupbodyfont` twice and no `\starttext`. * As you may already know, linenumbering needs not only to be setup, but started (and stopped). * `numberconversion` in `\definenotation` is a way to set linenote numbers. New sample: % Devanāgarī setup \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman] \definefontfamily [nagari] [rm] [Adishila San] [features=devanagari-one,rscale=1.9] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \usetransliteration[indic] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \definestartstop [sanskrit] [style={\sa}] \definestartstop[skt] [style={\sa}] \setupbodyfont[xcharter] % footnotes \setupnotations[alternative=serried] \setuplinenumbering[step=5,method=page,style=\tfx, location=outer,align=outer] \definelinenote[var][paragraph=yes] \definenotation[var][numberconversion=greek, numbercommand=,] % Test \starttext \startlinenumbering \startsanskrit śrīādi\var{\resettransliteration test} \stopsanskrit \startskt śrīādi\var{\resettransliteration test} \stopskt \stoplinenumbering \stoptext I hope it helps (let us know, when it doesn’t), Pablo
And thanks a lot for cleaning up the code!
Best
Jürgen
----- Nachricht von Pablo Rodriguez via ntg-context
On 1/18/26 09:31, Jürgen Hanneder via ntg-context wrote:
I'll try to append the pdf, but you can see the text, a page number a footnote with only the line number, but no roman text "test". So I guess I have to swich to roman within the footnote, but no combination for \switchtobodyfont and \resettransliteration has worked.
Hi,
first time I use transliteration, but if `\usetransliteration` is needed, it should be limited by setups (I guess) to make `\resettransliteration` work.
Some comments:
* Your font Roman needs no Indic script as fallback (since when Sanskrit as language is loaded, the nagari font is loaded [via setups]).
* `\definestartstop` is a command (which seems to work better in your case).
* You are using `\setupbodyfont` twice and no `\starttext`.
* As you may already know, linenumbering needs not only to be setup, but started (and stopped).
* `numberconversion` in `\definenotation` is a way to set linenote numbers.
New sample:
% Devanāgarī setup \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman]
\definefontfamily [nagari] [rm] [Adishila San] [features=devanagari-one,rscale=1.9] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \usetransliteration[indic] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \definestartstop [sanskrit] [style={\sa}] \definestartstop[skt] [style={\sa}]
\setupbodyfont[xcharter]
% footnotes \setupnotations[alternative=serried] \setuplinenumbering[step=5,method=page,style=\tfx, location=outer,align=outer] \definelinenote[var][paragraph=yes] \definenotation[var][numberconversion=greek, numbercommand=,]
% Test \starttext \startlinenumbering \startsanskrit śrīādi\var{\resettransliteration test} \stopsanskrit
\startskt śrīādi\var{\resettransliteration test} \stopskt \stoplinenumbering \stoptext
I hope it helps (let us know, when it doesn’t),
Pablo ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________
----- Ende der Nachricht von Pablo Rodriguez via ntg-context
participants (3)
-
hanneder@staff.uni-marburg.de -
Pablo Rodriguez -
Wolfgang Schuster