I want to create a custom package to handle all my default font settings, and I have a number of otf files I want to include in my output using fontspec. What I don't want to do is copy these files to every project folder I create, and I want a solution that works both under Windows and Ubuntu Linux. To have identical files in both environments I use Dropbox and have a subfolder included as tex directory, so my packages are found just fine. Unfortunately I am not allowed to include the necessary OTF due to licensing, but a (random google result) OTF font can be downloaded from
http://www.mediafont.com/font-10360-yan ... esatz.html
Does anyone know how to get the currentdirectory of the package file, I tried currfile and
\currfiledir
but that doesn't seem to work.
main.tex
:
Code: Select all
\documentclass{scrartcl}
\usepackage{myfonts}
\usepackage{blindtext}
\begin{document}
\blindtext
\end{document}
with
myfonts.sty
in a different directory than
main.tex
, and otf files in same directory as
myfonts.sty
:
Code: Select all
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{myfonts}[2014/02/05 My custom fonts]
\RequirePackage[T1]{fontenc}
\RequirePackage{fontspec}
\setmainfont[Numbers={OldStyle,Proportional}]{calluna-regular.otf}
\endinput
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit