TeX - LaTeX Asked by Hagai M on January 6, 2021
I’ve been using a setup of LyX with XeTeX on my laptop and it’s been working just fine. However, I installed it on my desktop (with the same fonts, packages, everything) and I’ve noticed that whenever I try to use emphasis (emph) on Hebrew text it just doesn’t work.
The problem seems to be specifically with the font David CLM, which is the default roman font and works fine on my other computer. With any other font set as the default, the problem disappears. I tried reinstalling the font on my desktop, and the italics option works fine in MS Word and other places, but when I try to emphasize text in LyX (and the same with making it slanted and italics via the menu) the output is just normal text.
If it isn’t clear from the first paragraph, the LaTeX preamble is the same as the one on my laptop (which does work correctly) but I attached it here just in case:
%%% Set Hebrew and English fonts
setmonofont[Script=Hebrew]{Miriam Mono CLM}
newfontfamily{englishfont}[Ligatures=TeX]{TeX Gyre Pagella}
%newfontfamily{englishfont}[Ligatures=TeX]{Latin Modern Roman}
% Proper font size in math mode.
setmathrm[Ligatures=TeX]{Latin Modern Math}
%%% Another way is to set just the Hebrew fonts:
% newfontfamilyhebrewfont[Script=Hebrew]{David CLM}
% newfontfamilyhebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
% newfontfamilyhebrewfontsf[Script=Hebrew]{Simple CLM}
% consider using usepackage{iffont}
%%% Sets both header and footer
fancyhf{} % sets to nothing
renewcommand{headrulewidth}{0pt}
fancyfoot[C]{textup{thepage}}
renewcommand*{refname}{Bibliography}
%%% Some alternative styles
ifcsname questionendcsname
theoremstyle{definition}
newtheorem{quesh}[thm]{שאלה}
renewenvironment{question}{begin{quesh}}{end{quesh}}
else
fi
ifcsname sol*endcsname
theoremstyle{remark}
newtheorem*{emphsol*}{פתרון}
renewenvironment{sol*}{begin{emphsol*}}{end{emphsol*}}
else
fi
renewcommand{labelenumi}{(alph{enumi})}
renewcommand{labelenumii}{arabic{enumii})}
First, check your .log
file for warning messages about any fonts not being found.
Next, make sure you’ve downloaded and installed the Culmus fonts, including DavidCLM-MediumItalic.otf
. You might want to re-run fc-cache -f -s -v
and luaotfload-tool -f -u -p -v
to make sure they’re indexed.
Finally, you might load the fonts by filename:
newfontfamilyhebrewfont{DavidCLM}[
Script = Hebrew ,
Ligatures = Discretionary ,
UprightFont = *-Medium ,
BoldFont = *-Bold ,
ItalicFont = *-MediumItalic ,
BoldItalicFont = *-BoldItalic ,
Extension = .otf ]
Some installations may use the extension .ttf
or have a different filename, so one way around that would be to move these definitions to a file named DavidCLM.fontspec
:
defaultfontfeatures[DavidCLM]{
Ligatures = Discretionary ,
UprightFont = *-Medium ,
BoldFont = *-Bold ,
ItalicFont = *-MediumItalic ,
BoldItalicFont = *-BoldItalic ,
Extension = .otf
}
You could then use newfontfamilyhebrewfont{DavidCLM}[Script=Hebrew]
or babelfont[hebrew]{rm}[Language=Default]{DavidCLM}
. If you ever need to compile on an installation with .ttf
filenames, you can then edit only the .fontspec
file.
Answered by Davislor on January 6, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP