I have scoured the web and Stack Overflow, but haven't been able to resolve this problem while typesetting in Devanagari on Debian Linux. I am able to typeset without any problem; it is just the apparent difficulty choosing a specific Devanagari font (that I have definitely installed on the Linux system) that is bothering me. See the setup below, followed by my question:
- Installed TexLive and used a
first.dnfile that uses thedevanagaripackage and thedevnagpreprocessor. - This generates
first.texwhich is then processed byxelatexto generatefirst.pdf. The examples below should work out of the box on a TexLive system. See first.pdf.
Now my question:
Look at the command
\newfontfamily\devanagarifont[Script=Devanagari]{Mukta} in first.dn that is carried over by the devnag preprocessor verbatim to first.tex. My understanding is that this line lets me choose the devanagari font of my choice. I have made sure that the fonts are indeed installed and (presumably) available because if I made a typo in its name or provided a nonexistent font, I get an error like this:
kpathsea: Running mktextfm Nakula/OT
/usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source abbreviation O for OT.
/usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update /usr/share/texlive/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input OT
This is METAFONT, Version 2.7182818 (TeX Live 2019/dev/Debian) (preloaded base=mf)
...
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input OT' failed to make OT.tfm.
kpathsea: Appending font creation commands to missfont.log.
! Package fontspec Error: The font "Nakula" cannot be found.
With the available devangari fonts like Mukta, Sanskrit2003, or Yashomudra, however, I do not get any error and the compilation is clean. But I get the exact same font on the generated PDF, as if the font specification is ignored (and a default font seems to be used regardless). None of the available fonts I specify here by name is paid heed to.
What might be wrong? If you can suggest the changes to my first.dn file, that would be great.
Here's the xetex compiler output:
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2019/dev/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./first.tex
LaTeX2e <2018-12-01>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/velthuis/devanagari.sty)
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty
(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty)
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-marathi.ldf
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/devanagaridigits.sty))
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf)
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf)
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-hindi.ldf)
LaTeX Warning: Unused global option(s):
[a6paper].
(./first.aux) (/usr/share/texlive/texmf-dist/tex/latex/velthuis/udn.fd)
geometry driver: auto-detecting
geometry detected driver: xetex
[1] (./first.aux) )
Output written on first.pdf (1 page).
Transcript written on first.log.
% first.dn
\documentclass[a6paper]{article}
\usepackage[margin=10mm]{geometry}
\usepackage{devanagari}
\usepackage{polyglossia}
\setdefaultlanguage{marathi}
\setotherlanguages{english, sanskrit, hindi}
\newfontfamily\devanagarifont[Script=Devanagari]{Mukta}
\begin{document}
{\dn dharmak.setre kuruk.setre samavetaa yuyutsava.h | \\
maamakaa.h paa.n.davaa"scaiva kimakurvata sa~njaya? ||}
\end{document}


devanagaripackage and thedevnagpreprocessor? Why not simply type directly into a.texfile and usexelatexon it? (Did you read somewhere that the only, or recommended, way to use Devanagari is to usedevnag? Where?) – ShreevatsaR Oct 03 '20 at 07:01devanagaripackage does not use Unicode fonts. It uses 8bit fonts and so your\newfontfamilycommands are completely ignored. – David Purton Oct 03 '20 at 07:13pen*ones are slanted. – David Purton Oct 03 '20 at 07:27devanagaripackage mainly because I like the 7-bit transliteration facility that it provides. I can use pure ASCII to encode almost everything that I am interested in. My workflow is set alright: 1) Open vim 2) Use preamble and start typing in{\dn <ascii code>}3) Run a script that callsdevnagandxelatexorpdflatexto generate PDF. – Kedar Mhaswade Oct 03 '20 at 08:08devnag) anymore, and can satisfactorily get by with just typing into a.texfile. But I'd be curious to know how it turns out eventually… – ShreevatsaR Oct 03 '20 at 08:20