我正在使用一种不带斜体或粗体字体的特定字体(GFS Elpis)。我想将当前字体保留为主字体,并指定另一种仅用于粗体和斜体的字体。此操作的序言是什么?
以下是所要求的示例代码:
\documentclass[12pt, oneside, a4paper]{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{xltxtra}
\usepackage{xgreek}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{GFS Elpis}
\begin{document}
\section{Testing}
This is a testing evironment on the GFS Elpis font (font for Greek) and its ability to implement both \textbf{boldcase} or \textit{italics}. The font is downloaded from the Greek Font Society and it seems that it does not integrate bold or italics. Maybe the solution is to use a different font set for bold or italics? The following subsection will now test Greek as well. (See the footnotes)
\subsection{Ελληνικά}
Αυτό είναι ένα δοκιμαστικό αρχείο για την γραμματοσειρά GFS Elpis και τη δυνατότητά της να αναδείξει \textbf{μαύρα γράμματα}\footnote{this is supposed to be bold} και \textit{πλάγια}\footnote{this is supposed to be italics}.
\end{document}
答案1
您可以使用以下fontspec
设施来实现此目的:
\documentclass[12pt, oneside, a4paper]{article}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{fontspec}
\usepackage{xgreek}
\setmainfont[
ItalicFont={GFS Didot Italic},
BoldFont={GFS Didot Bold},
BoldItalicFont={GFS Didot Bold Italic},
]{GFS Elpis}
\begin{document}
\section{Testing}
This is a testing evironment on the GFS Elpis font (font for Greek) and its ability to
implement both \textbf{boldface} or \textit{italics}. The font is downloaded from the Greek
Font Society and it seems that it does not integrate bold or italics. Maybe the solution is to
use a different font set for bold or italics? The following subsection will now test Greek as
well. (See the footnotes)
\subsection{Ελληνικά}
Αυτό είναι ένα δοκιμαστικό αρχείο για την γραμματοσειρά GFS Elpis και τη δυνατότητά της να
αναδείξει \textbf{μαύρα γράμματα}\footnote{this is supposed to be bold} και
\textit{πλάγια}\footnote{this is supposed to be italics}.
\end{document}
请注意,xltxtra
无需加载(它曾经很方便,但现在它仅提供一些很少需要的功能)。