0

For the longest time, I have written LaTeX documents on Unix or Linux. Due to several reasons, I'm actively planning to move this to Mac. I installed Mactex, Linux Libertine fonts, RomDev.tec and sanskrit 2003.ttf fonts.

My document uses Linux Libertine and several Indian language fonts, most important being Sanskrit 2003 (ttf).

To transliterate Sanskrit, I use Somadeva Vasudeva's RomDev scheme that uses a mapping file.

Here is a MWE that works on linux but not on the mac, I get fontspec error: "font-not-found"

The font "Linux Libertine" cannot be found

I believe I have all the required fonts in my mac. How do I verify if they are a) present and b) configured for xelatex to find them.

\documentclass[12pt]{article}
\usepackage{polyglossia} % the multilingual support package
\usepackage{parskip}
\usepackage{booktabs}
\setdefaultlanguage{english} % this is mostly going to be English text, with
\setotherlanguage{sanskrit} % some Sanskrit embedded in it.

\usepackage{xltxtra} % standard for nearly all XeLaTeX documents
\defaultfontfeatures{Scale=MatchLowercase} 
\setmainfont[Ligatures=TeX, 
            ItalicFont={TeX Gyre Schola Italic},
            BoldItalicFont={TeX Gyre Pagella Bold Italic}]
            {Linux Libertine O}
\setsansfont[Ligatures=TeX, Scale=0.9]{Linux Biolinum O}
\setlength{\parskip}{12pt} % 1ex plus 0.5ex minus 0.2ex}

\newfontfamily\devanagarifont{Linux Libertine}
\setlength{\textwidth}{5.5in}
\newfontinstance
\sanskritunicode [Script=Devanagari,Mapping=RomDev]{Sanskrit 2003}

\newcommand\skt[2]{\textsanskrit{#1#2}}
\newcommand\sktuni{\skt\sanskritunicode}

\newfontfamily\sa{Sanskrit 2003:script=deva}% Write Devanagari natively 

\newenvironment{sanskrittext}%
  {\leftskip=1em \rightskip=1em }%
  {\ifhmode \par \fi}

\newcommand\sloka[1]{\begin{sanskrittext}\setlength{\parindent}{0pt}{\large \skt
    {\normalsize \textit{#1}}\end{sanskrittext}\medskip}

    \setlength\heavyrulewidth{1.5pt}
\newcommand{\otoprule}{\midrule[\heavyrulewidth]}

\begin{document}

{\Large \sa ॐ }

Everything is rooted in time, kāla:\\
\sloka{
kālamūlamidaṃ sarvaṃ bhāvābhāvau sukhāsukhe
}

\end{document}
  • 1
    You have to copy the fonts in the /Library/Fonts folder in order that XeTeX can find them by name. Notice that xltxtra is needed for a really small number of documents nowadays. Just load fontspec instead. – egreg Oct 8 '18 at 6:51
  • I copied the Libertine otf fonts to /Library/Fonts and replaced \usepackage{xltextra} with \usepackage{fontspec}. The error still remains. – jayr Oct 8 '18 at 12:49
  • Open the Font Book application and make sure it finds those fonts. – Herb Schulz Oct 8 '18 at 16:00
  • Did that. Now it stops at l.19 \newfontinstance It appears it is having problem processing: \newfontinstance \sanskritunicode [Script=Devanagari,Mapping=RomDev]{Sanskrit 2003} – jayr Oct 8 '18 at 20:24
0

I solved this myself. The problems that I were encountering were two fold. TeX Live 2018 is the primary culprit. I could not compile my document on a fresh install of TeX Live 2018 on a Linux VM. I installed TeX Live 2015 version to compile without error. Next I installed TeX Live 2015 in my MBP. For fonts, I copied the TeX Gyre fonts to a separate local folder as Mac cannot read texlive fonts (& reason being Finder is not good at navigating system directories in MBP). I did the same for Indic fonts. Added these to Fontbook and voila, my book compiled successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.