In mydir/subdir, I have
\usepackage{../../latex/lecture/mylecture}
invoking the below mylecture.sty:
\usepackage{fontspec}
\usefonttheme{professionalfonts} % using non standard fonts for beamer
\usefonttheme{serif}
\definecolor{paleyellow}{RGB}{255,255,221}
\definecolor{myblue}{RGB}{0,0,144}
\setbeamercolor{frametitle}{fg=myblue}
\setbeamercolor{itemize item}{fg=myblue}
\setbeamercolor{title}{fg=myblue}
\setmainfont[
Path = ./ ,
Extension = .ttf ,
UprightFont = *-Regular ,
BoldFont = *-Bold ,
ItalicFont = *-Italic ,
BoldItalicFont = *-BoldItalic
]{Alegreya}
XeLaTeX says
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "Alegreya-Regular" cannot be found.
In lecture/mylecture, there are the various Alegreya ttf files which work when I have mylecture.sty and the ttf files copied to the current directory.
Does XeLaTeX look for the ttf files in mydir/subdir, reading the ./ path specification in \setmainfont, instead of lecture/mylecture, what I expected?
I just do not want to copy mylecture.sty and the ttf files into each dir where I want to write a new lecture slide series.
How can I have mylecture.sty and the ttf files in one dir and refer to it from anywhere in my git repository?
~/localtexmf/latex
tree. Can you do something similar?texinputs
or use a symlink in your local texmf treetexmf-dist/fonts/opentype/huerta/alegreya/Alegreya-Regular.otf