0

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:
% \newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
% \newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
% \newfontfamily\hebrewfontsf[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 question\endcsname
  \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})}
7
  • after you reinstalled the font try to reconfigure lyx, by using tools -> reconfigure
    – Yorgos
    Apr 22, 2020 at 11:30
  • Your code snippet doesn't show any active setting regarding David CLM. It is quite unclear how you use the font. Apr 22, 2020 at 12:42
  • @Yorgos I tried using it now, but it didn't seem to have any effect.
    – Hagai M
    Apr 23, 2020 at 7:06
  • @UlrikeFischer David CLM is used as the roman font in Document > Settings > Fonts > Roman. As far as I know this should have the same effect of uncommenting the line \newfontfamily\hebrewfont[Script=Hebrew]{David CLM} in the preamble, which I tried but it still doesn't work.
    – Hagai M
    Apr 23, 2020 at 7:07
  • Sorry but I don't have lyx. You should provide a small complete example code. Apr 23, 2020 at 7:08

1 Answer 1

0

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:

\newfontfamily\hebrewfont{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 \newfontfamily\hebrewfont{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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .