我想写一篇文章奥里亚语。 TeX 聊天室里的一些好心人帮助了我。现在我正在使用这个:
\documentclass[12pt]{amsart}
\usepackage{fontspec}
\setmainfont[
Renderer=HarfBuzz,Script=Oriya,
BoldFeatures={RawFeature={axis={wght=600}}},
BoldFont=*
]{NotoSansOriya-VariableFont_wdth,wght.ttf}
\begin{document}
"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ |"\\
{\bfseries
"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|"}\\
"My name is Kalia, No one is like me."
$$a^2+b^2=c^2, କ^2+b^୨ =c^2$$
\end{document}
这给出了 为了写我的文章,我只需要知道如何更改整个文档的英文文本的字体。
虽然这对我的文章来说不是那么必要,但我很好奇如何
- 用斜体书写奥迪亚字母
- 在数学模式中使用奥迪亚字母。
我试过了,但奥迪亚字母没有出现在数学模式中。在图片中可以看到字母“କ”没有出现在数学模式中,但数字“୨”出现了。
最后,还有其他方法可以用 LaTeX 编写 Odia 吗?
谢谢。
肺动脉高压
答案1
你可以为不同的文字使用不同的字体,例如拉丁文使用真斜体,奥里亚文不使用斜体(或假倾斜)
\documentclass[12pt]{amsart}
\usepackage{unicode-math}
\setmainfont{Noto Sans}
\newfontfamily\odia[
Renderer=HarfBuzz,Script=Oriya,
BoldFeatures={RawFeature={axis={wght=600}}},
BoldFont=*
]{NotoSansOriya-VariableFont_wdth,wght.ttf}
\begin{document}
{\odia"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ |"}
{\odia\bfseries
"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|"}
``My name is Kalia, No one is like me.''
{\itshape ``My name is Kalia, No one is like me.''}
{\bfseries ``My name is Kalia, No one is like me.''}
\[a^2+b^2=c^2, \text{\odia କ}^2+b^{\text{\odia ୨}} =c^2\]
\end{document}
在评论中,您说您想保留拉丁现代字体,因此不要更改主字体并使用更细的 Odia 字体,因为默认粗细与 LM 一起太重
\documentclass[12pt]{amsart}
\usepackage{unicode-math}
%\setmainfont{Noto Sans}
\newfontfamily\odia[
Renderer=HarfBuzz,Script=Oriya,
RawFeature={axis={wght=300}},
BoldFeatures={RawFeature={axis={wght=500}}},
BoldFont=*
]{NotoSansOriya-VariableFont_wdth,wght.ttf}
\begin{document}
{\odia"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ |"}
{\odia\bfseries
"ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|"}
``My name is Kalia, No one is like me.''
{\itshape ``My name is Kalia, No one is like me.''}
{\bfseries ``My name is Kalia, No one is like me.''}
\[a^2+b^2=c^2, \text{\odia କ}^2+b^{\text{\odia ୨}} =c^2\]
\end{document}
答案2
至于文本字体,这里有一个示例,babel
展示了如何使用脚本切换字体(以及连字符规则)。实际上,这个例子可以作为其他印度语言的典范,包括阿萨姆语、古吉拉特语、印地语、卡纳达语、马拉雅拉姆语、泰米尔语等。我猜你实际上想要一个竖线而不是竖线,所以我把它替换了。我添加了一些解释作为评论。
但请注意,您总会发现需要明确标记的模棱两可的情况,正如本例中的引文所揭示的那样。没有可以确定的通用规则,并且很大程度上取决于文档。
\documentclass[a4paper]{article}
\usepackage{babel}
% In versions >=3.79 the preferred name is odia. In previous versions
% use oriya. Although languages are usually passed as options to babel,
% in this case I’ll use \babelprovide to activate a useful transform,
% which prevents a break before a danda if preceded by a space.
\babelprovide[
import, main,
% mapdigits, % Optional: replace Arabic digits by Odia ones
transforms = danda.nobreak]{odia}
% Tell babel to switch the font and hyphenation when a char
% of the script for English (ie, the Latin script) is found.
\babelprovide[onchar = ids fonts]{english}
% By default, digits and puntuation are considered part of the Latin
% script. Very likely that’s wrong and have to be fixed in babel, but
% fortunately there is a workaround:
\babelcharproperty{`\!}[`\@]{locale}{odia}
\babelcharproperty{`\[}[`\`]{locale}{odia}
\babelcharproperty{`\{}[`\}]{locale}{odia}
% Set the main roman font, for the main language. 'Script' and
% 'Language' are set by babel. You may find a nasty and somewhat
% misleading warning about language and/or script not found raised by
% fontspec - just ignore it (it will be concealed altogether in babel
% 3.81):
\babelfont{rm}
[Renderer=HarfBuzz,
BoldFeatures={RawFeature={axis={wght=600}}},
BoldFont=*
]{NotoSansOriya-VariableFont_wdth,wght.ttf}
% Set the font for english:
\babelfont[english]{rm}{Latin Modern Roman}
\begin{document}
ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ ।
``My name is Kalia, No one is like me.''
\textit{``My name is Kalia, No one is like me.''}
\textbf{``My name is Kalia, No one is like me.''}
\textbf{ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ ।}
\end{document}
答案3
欢迎使用 TeX.SX!您选择的字体不带斜体,因此您可能需要选择一种真正提供斜体字母的字体(假设此脚本中甚至存在这样的印刷功能)。从印刷效果上来说,它可能不太吸引人,但如果您仍然想坚持使用 NotoSans Oriya,您可以使用AutoFakeSlant
提供的选项fontspec
,通过倾斜字形来伪造斜体。
至于在数学模式下的使用,您可能希望将字母包装在\text
宏中,该宏将排版相关字形的非斜体样式。
\documentclass[12pt]{amsart}
\usepackage{fontspec}
\setmainfont[
Renderer=HarfBuzz,
Script=Oriya,
BoldFeatures={RawFeature={axis={wght=600}}},
BoldFont=*,
AutoFakeSlant=0.2
]{NotoSansOriya-VariableFont_wdth,wght.ttf}
\begin{document}
``ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ |''
{\bfseries
``ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|''}
``My name is Kalia, No one is like me.''
{\itshape
``ନାଆଁଟି ମୋର କାଳିଆ, କେହି ନାହିଁ ମୋ ଭଳିଆ|''}
\[a^2+b^2=c^2, \text{କ}^2+b^\text{୨} =c^2\]
\end{document}