I am trying to use custom OpenType fonts (using LuaLaTeX and the fontspec package) in a LyX document under version control. The document is potentially accessed by others on different machines, so I decided to ship the .otf files in a subdirectory of the document's folder rather than relying on them being installed on the system. In other words, I just wanted to have the document in a compilable state as soon as it is checked out from version control without the need of installing the otf files.
This is how I wanted to add the fonts in the document's LaTeX Preamble:
\setmainfont{foo}[
Path = mypath,
UprightFont = foo-regular.otf,
BoldFont = foo-bold.otf,
ItalicFont = foo-it.otf,
BoldItalicFont = foo-boldit.otf,
]
As long as mypath is an absolute path, everything works fine. As soon as I want to use a relative path here (because absolute paths don't make sense for files under version control) the fonts are not found any more.
Is there any solution to either (a) make a relative path work here or (b) somehow determine the absolute path of the current folder (not LyX's temporary folder where the document is actually compiled) and plug it in at mypath? Or is there any other obvious solution that I have overlooked?
./mypath? – Elad Den Aug 08 '16 at 10:40pathand./mypathrefer to said temporary directory, which does not contain the otf files (as LyX did not copy them there). – simon Aug 08 '16 at 11:42%\input{font.otf}. Or \iffalse \input{font.otf} \fi. Lyx will probably not realize that the file isn't \input at all. – Ulrike Fischer Aug 08 '16 at 14:56\input, how would I use it, and why would a relative path work there? – simon Aug 08 '16 at 15:04\iffalse ... \fiat the beginning of my document, inserting a font file via "Insert -> File -> Child Document" in place of the..., then the font file ends up in the temporary folder. However, some kind of name mangling happens along the way, so e.g. the fontfonts/Calluna/exljbris-Calluna-Regular.otfends up as25_home_simon_Documents_git-repo_fonts_Calluna_exljbris-Calluna-Regular.tex, where the25seems to be a counter. I have no idea how I could "unmangle" this name. At this point I think I will give up. Thanks for your help. – simon Aug 08 '16 at 15:38Path = \input@path ,and then settingUprightFont = fonts/foo-regular.otf,etc., surrounding everything with\makeatletterand\makeatother– simon Aug 10 '16 at 16:56