我搜索了网络和 Stack Overflow,但还是没能解决在 Debian Linux 上用梵文排版时出现的问题。我是能够毫无问题地排版;只是选择特定的梵文字体(我确实在 Linux 系统上安装了)显然很困难,这困扰着我。请参阅下面的设置,然后是我的问题:
- 安装了 TexLive 并使用了
first.dn
使用该devanagari
包和devnag
预处理器的文件。 - 这将生成
first.tex
然后由xelatex
处理以生成first.pdf
。下面的示例应该可以在 TexLive 系统上开箱即用。请参阅第一版.pdf。
现在我的问题是:
查看 预处理器逐字传递到\newfontfamily\devanagarifont[Script=Devanagari]{Mukta}
的命令。我的理解是,此行让我选择自己喜欢的梵文字体。我已确保字体确实已安装并且(大概)可用,因为如果我输入了字体名称或提供了不存在的字体,我会收到如下错误:first.dn
devnag
first.tex
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.
使用可用的梵文字体,如Mukta
、Sanskrit2003
或Yashomudra
,但是,我不是得到任何错误并且编译是干净的。但我明白精确的生成的 PDF 上的字体相同,好像忽略了字体规范(无论如何似乎都会使用默认字体)。我在这里按名称指定的可用字体均未受到关注。
可能出了什么问题?如果您能建议对我的文件进行更改first.dn
,那就太好了。
这是xetex
编译器的输出:
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}
答案1
该devanagari
软件包使用 8 位字体。它\newfontfamily\devanagari
根本不使用线。
看起来该devanagari
包支持多种字体,可以通过向包传递选项来选择,但老实说,它们在我看来都一样。
如果您想在系统上使用OpenType字体,您需要放弃该devanagari
包并fontspec
直接使用。
您仍可以通过指定适当的选项来使用相同的输入法Mapping
(或者您可以直接输入 Unicode 字符)。不再需要额外的预处理步骤。
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{marathi}
\setotherlanguages{english, sanskrit, hindi}
\setmainfont[Mapping=velthuis-sanskrit,Script=Devanagari,Language=Marathi]{Noto Serif Devanagari}
\newfontfamily\englishfont{Noto Serif}
\newfontfamily\sanskritfont[Mapping=velthuis-sanskrit,Script=Devanagari,Language=Sanskrit]{Noto Serif Devanagari}
\newfontfamily\hindifont[Mapping=velthuis-sanskrit,Script=Devanagari]{Noto Serif Devanagari}
% make sure ~ as non-breaking space doesn't interfere with velthuis-sanskrit mapping
\edef~{\string~}
\begin{document}
dharmak.setre kuruk.setre samavetaa yuyutsava.h | \\
maamakaa.h paa.n.davaa"scaiva kimakurvata sa~njaya? ||
\end{document}