Hi, I believe that there is a LaTeX package which typesets the METAPOST text in a certain font, I do not remember which. How can I typeset same Metapost logo in ConTeXt. It looks like below; [image: image.png] -- Respect, Shiv Shankar Dayal
On 8/4/24 06:45, Shiv Shankar Dayal wrote:
Hi,
I believe that there is a LaTeX package which typesets the METAPOST text in a certain font, I do not remember which. How can I typeset same Metapost logo in ConTeXt. It looks like below;
These are the right commands for both (according to cont-log.mkxl or cont-log.mkiv): \MetaFontLogo \MetaPostLogo Just in case it helps, Pablo
Many thanks. It worked like a charm. On Sun, Aug 4, 2024 at 11:44 AM Pablo Rodriguez via ntg-context < ntg-context@ntg.nl> wrote:
On 8/4/24 06:45, Shiv Shankar Dayal wrote:
Hi,
I believe that there is a LaTeX package which typesets the METAPOST text in a certain font, I do not remember which. How can I typeset same Metapost logo in ConTeXt. It looks like below;
These are the right commands for both (according to cont-log.mkxl or cont-log.mkiv):
\MetaFontLogo \MetaPostLogo
Just in case it helps,
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
___________________________________________________________________________________
-- Respect, Shiv Shankar Dayal
I have a few questions concerning the commands for setting up Indic Fonts, specifically for the use of Indologists and other academics dealing with Indian Languages. I have been using the following command in older versions: \definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \setupbodyfont [nagari] Example: आनन्द This seems to be out of date and for most academics (especially outside of India) it is preferable to use Sanskrit in transcription (almost all databases use transcription) for input even if printing in Nāgarī. For this we now seem to have the transliteration IAST to Devanagari (?) What we need are thus three elements: switching the language to Sanskrit temporarily (the main language will be english), setting the font for Sanskrit (let us say AsishilaSan), and enabling input of sanskrit in transcription (input: ānanda -> output आनन्द). Just a background note: Transcription and Nāgarī are not as equivalent as one would want. In transcription some word divisions are indicated that are not indicated in a Nāgarī text, which makes reading transcription easier — for those used to it. For most Indian scholars transcription is understandably a nuissance, a bit like reading English in phonetic alphabets. If someone could tell me how to get all these things into a few commands, I would be most grateful. My own attempts, mostly trial and error, did not succeed. Best Jürgen --- 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
Hello Jürgen,
Are you after a Context version of something such as
Xetex Devanagari?
https://github.com/wujastyk/xetex-devanagari
Best, Richard
--
T +6433121699 M +64210640216
rmahoney@indica-et-buddhica.org
https://indica-et-buddhica.com/
Indica et Buddhica
Littledene Bay Road Oxford NZ
NZBN: 9429041761809
-----Original Message-----
From: Jürgen Hanneder via ntg-context
Dear Richard,
Are you after a Context version of something such as Xetex Devanagari?
Indeed. In my XeTeX publications settling the font was quite straightforward: \usepackage{polyglossia,fontspec,xunicode} \setmainfont{Adobe Text Pro} \newfontfamily\sanskritfont[Script=Devanagari,Mapping=RomDev,Scale=1.4]{AdishilaSan} \setdefaultlanguage{english} \setotherlanguage{sanskrit} But coming back to ConTeXt: I am grateful to Pablo and Wolfgang for their suggestions, but it does not (yet) work as it should. Perhaps this has to do with the problem in the language command. Here is my test file that works up to the point, and then shows the problem. ----------- \setuppapersize[A4] \setuplayout[width=14cm, height=fit] \definefontfamily [roman] [rm] [minion] \definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \setupbodyfont [nagari] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \starttext Example: आनन्द। अपिच % this comes out as it should, but since input is in Nagari there is no transliteration involved. test % the word "test" comes out in roman, i.e. switching back to roman works. \language[sa]{yoga} % the word "yoga" is typeset in Nagari as expected, test % but the word "test" is still typeset in Nagari \language[en]{test} % still no switching back to roman, it seems stuck with Nagari. \stoptext ----- Jürgen --- 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 10.08.24 um 11:10 schrieb Jürgen Hanneder via ntg-context:
\language[sa]{yoga} % the word "yoga" is typeset in Nagari as expected, test % but the word "test" is still typeset in Nagari
Does it work if you say {\language[sa]yoga} test ? I know \language only as a switch, but Hans changed several macros so that they work both ways. And the next \language should still switch, but perhaps \setuplanguage[en][setups=latin] or similar is necessary. Hraban
Does it work if you say
{\language[sa]yoga}
That's it!! Together with Wolfgang's patient corrections, I now have a version that works. Here again, for the record: --------- \definefallbackfamily [Roman] [rm] [Adishila] [range=devanagari,features=devanagari-one] \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman] \definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \starttext Example: आनन्द Example: {\language[sa]yoga} yoga, (in roman again) \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
On 10 Aug 2024, at 11:59, Jürgen Hanneder via ntg-context
wrote: Does it work if you say
{\language[sa]yoga}
That's it!!
Hi Jürgen, You may also define a command like (or a shorter name…) \define[1]\sanskrit{\start\language[sa]#1\stop} which allows you to say for instance \sanskrit{yoga} Best regards: Otared
Otared Kavian schrieb am 10.08.2024 um 17:56:
On 10 Aug 2024, at 11:59, Jürgen Hanneder via ntg-context
wrote: Does it work if you say
{\language[sa]yoga} That's it!! Hi Jürgen,
You may also define a command like (or a shorter name…)
\define[1]\sanskrit{\start\language[sa]#1\stop}
\definestartstop [sanskrit] [style={\language[sa]}] Wolfgang
From: Wolfgang Schuster
Subject: Re: [NTG-context] Re: Nāgarī for Academics Date: 10 August 2024 at 18:22:50 CEST To: mailing list for ConTeXt users , Otared Kavian Otared Kavian schrieb am 10.08.2024 um 17:56:
[…]
\define[1]\sanskrit{\start\language[sa]#1\stop}
\definestartstop [sanskrit] [style={\language[sa]}]
Indeed… much more elegant and efficient ! Thanks Wolfgang ! Best regards: Otared Otared Kavian e-mail: otared@gmail.com Phone: +33 6 88 26 70 95
Thanks again, in fact both are useful in different situations.
Jürgen
----- Nachricht von Wolfgang Schuster
Otared Kavian schrieb am 10.08.2024 um 17:56:
On 10 Aug 2024, at 11:59, Jürgen Hanneder via ntg-context
wrote: Does it work if you say
{\language[sa]yoga} That's it!! Hi Jürgen,
You may also define a command like (or a shorter name…)
\define[1]\sanskrit{\start\language[sa]#1\stop}
\definestartstop [sanskrit] [style={\language[sa]}]
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 8/11/24 10:40, Jürgen Hanneder via ntg-context wrote:
Thanks again, in fact both are useful in different situations. Jürgen
Just for the record, the following language short command and start stop are defined for most languages (\it and \fi are already taken by TeX [italics and conditional final command]): {\sa yoga} \startlanguage[sa] yoga \stoplanguage Just in case it might help, Pablo
On 8/11/2024 12:36 PM, Pablo Rodriguez via ntg-context wrote:
On 8/11/24 10:40, Jürgen Hanneder via ntg-context wrote:
Thanks again, in fact both are useful in different situations. Jürgen
Just for the record, the following language short command and start stop are defined for most languages (\it and \fi are already taken by TeX [italics and conditional final command]):
{\sa yoga}
\startlanguage[sa] yoga \stoplanguage
Just in case it might help, so, best use the more verbose tags
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Jürgen Hanneder via ntg-context schrieb am 10.08.2024 um 11:10:
Dear Richard,
Are you after a Context version of something such as Xetex Devanagari?
Indeed. In my XeTeX publications settling the font was quite straightforward:
\usepackage{polyglossia,fontspec,xunicode} \setmainfont{Adobe Text Pro} \newfontfamily\sanskritfont[Script=Devanagari,Mapping=RomDev,Scale=1.4]{AdishilaSan}
\setdefaultlanguage{english} \setotherlanguage{sanskrit}
But coming back to ConTeXt:
I am grateful to Pablo and Wolfgang for their suggestions, but it does not (yet) work as it should. Perhaps this has to do with the problem in the language command. Here is my test file that works up to the point, and then shows the problem.
----------- \setuppapersize[A4] \setuplayout[width=14cm, height=fit]
\definefontfamily [roman] [rm] [minion]
You set a font here for english text but never enable it.
\definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \setupbodyfont [nagari]
This is where you set the font for the whole document.
\usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}]
\startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups
\setuplanguage [sa] [setups=sanskrit]
\starttext
Example: आनन्द। अपिच % this comes out as it should, but since input is in Nagari there is no transliteration involved. test % the word "test" comes out in roman, i.e. switching back to roman works.
\language[sa]{yoga} % the word "yoga" is typeset in Nagari as expected, test % but the word "test" is still typeset in Nagari
\language[en]{test} % still no switching back to roman, it seems stuck with Nagari.
\stoptext -----
\definefallbackfamily [Roman] [rm] [Adishila] [range=devanagari,features=devanagari-one] \definefontfamily [Roman] [rm] [Minion Pro] \setupbodyfont [Roman] \definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa,vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \starttext Example: आनन्द। अपिच Example: \language[sa]{yoga} \stoptext Wolfgang
On 8/5/24 11:31, Jürgen Hanneder via ntg-context wrote:
I have a few questions concerning the commands for setting up Indic Fonts, specifically for the use of Indologists and other academics dealing with Indian Languages.
Hi Jürgen, just in case the following might help (no Indian language experience [I just learnt that Devanagari and Nagari were both scripts]).
This seems to be out of date and for most academics (especially outside of India) it is preferable to use Sanskrit in transcription (almost all databases use transcription) for input even if printing in Nāgarī. For this we now seem to have the transliteration IAST to Devanagari (?)
This may be the way (adapted from lang-tra.mkxl): \definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \setupbodyfont [nagari] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa, vector={iast to deva}] \starttext Is this Sanskrit? \starttransliteration[MyDeva] idaṁ adbhutam kauśika tisraḥ garuḍavāhanan \stoptransliteration I really don’t know: \transliteration[MyDeva]{idaṁ adbhutam kauśika tisraḥ garuḍavāhanan}. \stoptext As included in the text, I don’t have the slighliest idea whether the transliterated text may be Sanskrit.
What we need are thus three elements: switching the language to Sanskrit temporarily (the main language will be english),
\sa is the language switch (which also enables hyphenation). But since you need transliteration, it is automatically added in the defined transliteration.
setting the font for Sanskrit (let us say AsishilaSan),
You already defined that in your minimal sample.
and enabling input of sanskrit in transcription (input: ānanda -> output आनन्द).
See above.
If someone could tell me how to get all these things into a few commands, I would be most grateful. My own attempts, mostly trial and error, did not succeed.
Let us know whether the previous sample worked for you (or how it is failing). BTW, feel free to improve https://wiki.contextgarden.net/Indic_Scripts#IAST_to_Devanagari. I hope it helps, Pablo
The text below works, thanks for the help! But there is one more problem. I could not find an elegant method to set the language of the document to English without disabling Nagari. If one adds \setupbodyfont[minion] the Nagari parts disappear. The normal scenario would be a document in English with Sanskrit as a secondary language, to one switches with a command that changes font, language and activates the transliteration mechanism. \starttransliteration[MyDeva] does not do this as soon as one sets the roman font. Thanks again! PS: I can write a few notes for Sanskritists for the wiki, I also wrote something on critical editions in ConteXt, which could perhaps be useful for others (in the MyWay format). --------- \setuppapersize[A4] \definefontfamily [nagari] [rm] [adishila] [features=devanagari-one] \setupbodyfont[nagari] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa, vector={iast to deva}] \starttext \subject{Some notes on Printing Sanskrit with lmtx} योग -- That is the word Yoga, input and, when you compile this document, printed in (Deva)Nagari script. 1. In academic publishing we often type in the so-called IAST transliteration and also print in it with diacritics (Nāgarī, Himālaya, Kṛṣṇa etc.). For this we only need a font that has the required diacritics or (in some cases) tell the font to do in anyway with \definefontfeature[default][default][fakecombining=yes,compose=yes] 2. What is extremely practical is to have an input in transcription (yoga), but pdf output as योग. This is the task of the iast to deva option in the set of indic transliterations defined in the preamble. These are two ways to use this method: \starttransliteration[MyDeva] yoga \stoptransliteration \transliteration[MyDeva]{yoga} \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
On 8/8/24 13:07, Jürgen Hanneder via ntg-context wrote:
The text below works, thanks for the help!
But there is one more problem.
I could not find an elegant method to set the language of the document to English without disabling Nagari. If one adds \setupbodyfont[minion] the Nagari parts disappear.
Default language is US English. I mean, this is already set. For other languages, \mainlanguage[de] (as an example). As for the fonts, you need a fallback typeface: \definefallbackfamily [nagari] [rm] [adishila] [range={devanagari, devanagariextendeda, devanagariextendeda}, force=yes, features=devanagari-one] \definefontfamily [nagari] [rm] [Minion Pro] \setupbodyfont[nagari]
The normal scenario would be a document in English with Sanskrit as a secondary language, to one switches with a command that changes font, language and activates the transliteration mechanism.
\starttransliteration[MyDeva] does not do this as soon as one sets the roman font.
Adding the above commands, it should work. There is an issue with language, but I’m opening a new thread. I hope it helps, Pablo
Jürgen Hanneder via ntg-context schrieb am 08.08.2024 um 13:07:
The text below works, thanks for the help!
But there is one more problem.
I could not find an elegant method to set the language of the document to English without disabling Nagari. If one adds \setupbodyfont[minion] the Nagari parts disappear.
The normal scenario would be a document in English with Sanskrit as a secondary language, to one switches with a command that changes font, language and activates the transliteration mechanism.
You can put all settings (fonts, transliteration etc.) you need for your sanskrit texts in a setups blocks and apply the block to a language. When you use now the \language command (or environment) all settings are now applied to the content. Below is a untested example. \definefontfamily [nagari] [rm] [adishila] [features=devanagari-one] \usetransliteration[indic] \definetransliteration [MyDeva] [lang=sa, vector={iast to deva}] \startsetups [sanskrit] \settransliteration[MyDeva] \switchtobodyfont[nagari] \stopsetups \setuplanguage [sa] [setups=sanskrit] \starttext \subject{Some notes on Printing Sanskrit with lmtx} \language[sa]{योग} -- That is the word Yoga, input and, when you compile this document, printed in (Deva)Nagari script. \stoptext Wolfgang
On 8/5/2024 11:31 AM, Jürgen Hanneder via ntg-context wrote:
I have a few questions concerning the commands for setting up Indic Fonts, specifically for the use of Indologists and other academics dealing with Indian Languages.
I have been using the following command in older versions:
\definefontfamily [nagari] [rm] [Adishila] [features=devanagari-one] \setupbodyfont [nagari] Example: आनन्द
This seems to be out of date and for most academics (especially outside of India) it is preferable to use Sanskrit in transcription (almost all databases use transcription) for input even if printing in Nāgarī. For this we now seem to have the transliteration IAST to Devanagari (?)
What we need are thus three elements: switching the language to Sanskrit temporarily (the main language will be english), setting the font for Sanskrit (let us say AsishilaSan), and enabling input of sanskrit in transcription (input: ānanda -> output आनन्द).
Just a background note: Transcription and Nāgarī are not as equivalent as one would want. In transcription some word divisions are indicated that are not indicated in a Nāgarī text, which makes reading transcription easier — for those used to it. For most Indian scholars transcription is understandably a nuissance, a bit like reading English in phonetic alphabets.
If someone could tell me how to get all these things into a few commands, I would be most grateful. My own attempts, mostly trial and error, did not succeed.
You can take a look at type-imp-indic.mkxl which has some about transliterations (there is a subsystem for that) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (8)
-
hanneder@staff.uni-marburg.de
-
Hans Hagen
-
Henning Hraban Ramm
-
Otared Kavian
-
Pablo Rodriguez
-
Richard Mahoney | Indica et Buddhica
-
Shiv Shankar Dayal
-
Wolfgang Schuster