
我嘗試將斜體文字放在標題處 - 在文檔正文中它工作正常,但在標題處我看不到斜體字體。
這是 MWE:
% Preview source code
%% LyX 2.3.2-2 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew,numbers=noenddot]{scrartcl}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\AtBeginDocument{
\renewcommand\footnoterule{%
\kern -3pt
\hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
\kern 2.6pt
}}
\renewcommand{\labelenumii}{\labelenumi\arabic{enumii}.}
\lhead{aa\emph{aa}}
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\begin{english}[variant=american]%
aa\emph{aa}
\end{english}%
\end{document}
你知道我該如何修復它嗎?
謝謝你!
答案1
因為某些原因,大衛·克拉姆似乎不包含具有斜體形狀的拉丁字形。作為一個額外的奇怪之處米里亞姆·莫諾 CLM與其他兩種字體的傾斜方式相反。
在您的問題中,您已將預設語言設定為希伯來語,並將預設字體設為大衛·克拉姆。這就是您在標題中得到的內容。如果您想在標題中使用英語並使用拉丁現代羅馬的預設英語字體,您可以使用:\lhead{\textenglish{aa\emph{aa}}}
,但是如果您想要的話,您當然不會得到希伯來語。
另請注意,它給出了不要與此類一起scrartcl
使用的警告。 fancyhdr
KOMA-Script 有自己的自訂頁首和頁尾的方法。
看看這個測試,看看發生了什麼:
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\newfontfamily\hebrewfont{David CLM}[Script=Hebrew]
\newfontfamily\hebrewfonttt{Miriam Mono CLM}[Script=Hebrew]
\newfontfamily\hebrewfontsf{Simple CLM}[Script=Hebrew]
\begin{document}
\LR{David CLM}
\medskip
עברית \LR{Latin (Upright)}
{\itshape עברית \LR{Latin (Italic)}}
{\bfseries עברית \LR{Latin (Bold)}}
{\bfseries\itshape עברית \LR{Latin (Bold Italic)}}
\bigskip
\sffamily
\LR{Simple CLM}
\medskip
עברית \LR{Latin (Upright)}
{\itshape עברית \LR{Latin (Italic)}}
{\bfseries עברית \LR{Latin (Bold)}}
{\bfseries\itshape עברית \LR{Latin (Bold Italic)}}
\bigskip
\ttfamily
\LR{Miriam Mono CLM}
\medskip
עברית \LR{Latin (Upright)}
{\itshape עברית \LR{Latin (Italic)}}
{\bfseries עברית \LR{Latin (Bold)}}
{\bfseries\itshape עברית \LR{Latin (Bold Italic)}}
\end{document}
答案2
嘗試這個:
\lhead{\textit{aa\emph{aa}}}
\textit
是命令將文字設定為斜體。
答案3
我已經使用你的原始碼進行了編譯。解決方案是:您可以在標題中使用更改系列字體。
A)試試這一行:
\lhead{\textrm{ aa\emph{aa}}}
\textrm 是設置襯線(羅馬)。
b)您可以使用 \textsf 設定無襯線系列,請嘗試以下行:
\lhead{\textrm{ aa\emph{aa}}}
C)您可以使用 \texttt 設定打字機(等寬)系列,嘗試以下行:
\lhead{\texttt{ aa\emph{aa}}}