problem using newfontfamily with lualatex; TeXLive; linux

by nate   Last Updated January 14, 2018 00:23 AM

I am using Linux Mint, with new TeXLive (installed in special location) to try and compile this template I found. I've tried using the discussion in both, http://mirrors.concertpass.com/tex-archive/macros/latex/contrib/fontspec/fontspec.pdf and `How do I use a particular font for a small section of text in my document?'.

\documentclass{scrartcl}
\usepackage[nochapters]{classicthesis}
\usepackage[LabelsAligned,NoDate]{currvita}
  \renewcommand{\cvheadingfont}{\LARGE\color{Maroon}}
\usepackage{hyperref}
  \hypersetup{colorlinks,breaklinks,urlcolor=Maroon,linkcolor=Maroon}

\reversemarginpar

\newdimen\datebox
\newdimen\tempdima \tempdima0pt
%\newdimen\maxdatedimen \maxdatedimen30pt%default value
\newdimen\maxdatedimen \maxdatedimen30pt%default value


\newcommand{\NewEntry}[2]{%
  \settowidth\tempdima{#1}%
  \ifdim\tempdima>\maxdatedimen%
   \global\maxdatedimen\the\tempdima\fi%
    \par\addvspace{0.5em}
    \noindent\hspace*{2em}%
    \parbox[t]{\datebox}{\strut\small\itshape #1}%
    \hspace*{1.5em}%
    \parbox[t]{\dimexpr\textwidth-2em-\datebox-1.5em+0em}{\strut #2}%
    \par\addvspace{0.5em}%
}

\newcommand{\MarginText}[1]{\marginpar{\raggedleft\itshape\small#1}}
\newcommand{\Description}[1]{%
  \par\noindent\hangindent=0em\hangafter=0
%  \par\noindent\hangindent=2em\hangafter=0
  {\noindent\ignorespaces\footnotesize #1\par}
%  {\raggedright\footnotesize #1\par}
  \vspace{1em}
  \par}

\usepackage{atveryend}

\makeatletter
\AtBeginDocument{%
  \settowidth{\datebox}{\hbox to \the\maxdatedimen{\hfil}}
  \maxdatedimen0pt}
\AfterLastShipout{%
  \if@filesw
    \immediate\write\@mainaux{%
      \global\string\maxdatedimen=\the\maxdatedimen\relax
    }%
  \fi}
\makeatother

\usepackage{fontspec}


\newfontfamily\myfontt[]{FoglihtenPCS-068.otf}
\newenvironment{myfont}{\myfontt}{\par}

%\usepackage{CormorantGaramond}
%%\newfontfamily\fMy[Ligatures=TeX,Numbers=OldStyle,Scale=MatchLowercase]{CormorantGaramond-Light.otf}
%\newfontfamily\fMy[]{CormorantGaramond-Medium.otf}
%\newcommand\fontMy[1]{{\fMy #1}}
%\usepackage[T1]{fontenc}




\begin{document}




\begin{cv}{My name}\vspace{1.5em}

%{\fMY
Dear Human Resources,
%}



\pagestyle{scrheadings}% using scrheadings page style


\section*{Personal Information}


\NewEntry{address}{XXXXX} 


\section*{Education}

\NewEntry{2015-2017}{{\myfontt \textbf{School of Data Analysis, Yandex}}}

\end{cv}

\end{document}

The template works fine but I wanted to use differnt fonts in various places. So, despite these two links being different ways to implement this (at least with syntax), I still couldn't get them to work - using for example Cormorant Garmond. I did add the extension and had fontspec so I can use the file name.

Perhaps I need to specify a search path explicitly? Or can I include an absolute path name to the file?

Here is the root of my TeXLive installation - /home/user/SW/TeXLive and the file I was looking for was found by;

X@X ~/SW/TeXLive/here/texmf-dist/fonts $ find . -name 'CormorantGaramond*.otf' -exec ls -Alrt {} \;
-rw-r--r-- 1 sbh sbh 775548 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-MediumItalic.otf
-rw-r--r-- 1 sbh sbh 780596 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-LightItalic.otf
-rw-r--r-- 1 sbh sbh 1129176 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-Regular.otf
-rw-r--r-- 1 sbh sbh 1135248 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-SemiBold.otf
-rw-r--r-- 1 sbh sbh 1119544 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-Bold.otf
-rw-r--r-- 1 sbh sbh 782440 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-RegularItalic.otf
-rw-r--r-- 1 sbh sbh 782208 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-SemiBoldItalic.otf
-rw-r--r-- 1 sbh sbh 1113548 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-Medium.otf
-rw-r--r-- 1 sbh sbh 760204 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-BoldItalic.otf
-rw-r--r-- 1 sbh sbh 1126740 Nov 25  2016 ./opentype/catharsis/cormorantgaramond/CormorantGaramond-Light.otf

The part of the MWE I'm trying to use is the commented out stuff just before the beginning of the document. I've had no real problems (despite some weird errors) using the other font, FoglihentPCS-068.otf, but that is because it is in the same directory - I'd rather use an absolute path.

I'm fine using either approach - an environment with \begin{myfont} \lipsum[3] \end{myfont} or just a {\fMy lipsum[3]} method, though I'd prefer the latter.

Tags : fonts luatex linux


Related Questions



(Lua) LaTeX & HeVeA with partly generated things

Updated May 03, 2018 14:23 PM

LuaTeX error: LuaTeXbase-loader.sty

Updated February 10, 2018 21:23 PM


Checking available font styles and shapes

Updated March 27, 2015 08:07 AM