在以下示例中,如何将定理标题字体设置为 normal+bold,将定理正文字体设置为 normal+italic?如果我删除以 开头\usepackage{fontspec}
和以 结尾的行\newfontfamily{\serbianfonttt}{DejaVu Serif}
,那么我就能得到我需要的内容。
\documentclass[10pt, b5paper]{book}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage[Script=Cyrillic]{serbian}
\setotherlanguage{english}
\newfontfamily{\serbianfont}[Mapping=ascii-to-serbian, Script=Cyrillic, Language=Serbian]{DejaVu Serif}
\newfontfamily{\serbianfonttt}{DejaVu Serif}
\usepackage{amssymb, amsmath}
\usepackage{ntheorem}
\usepackage[framemethod=default]{mdframed}
\theoremheaderfont{\normalfont\bfseries}
\theorembodyfont{\slshape}
\theoremseparator{.}
\newtheorem{teorema}{Teorema}[section]
\begin{document}
\begin{teorema}
ssssssddd
\end{teorema}
\end{document}
答案1
设置主字体和单声道字体。如果您想要斜体,请使用\itshape
而不是\slshape
。
\documentclass[10pt, b5paper]{book}
\usepackage{amssymb, amsmath}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{ntheorem}
\usepackage[framemethod=default]{mdframed}
\setmainlanguage[Script=Cyrillic]{serbian}
\setotherlanguage{english}
\setmainfont{DejaVu Serif}[
Mapping=ascii-to-serbian,
Script=Cyrillic,
Language=Serbian,
]
\setmonofont{DejaVu Serif}
\theoremheaderfont{\normalfont\bfseries\upshape}
\theorembodyfont{\itshape}
\theoremseparator{.}
\newtheorem{teorema}{Teorema}[section]
\begin{document}
\begin{teorema}
abcde fghijk lmnop qrstu vwxyz
č ć š ž dj
\end{teorema}
\end{document}