xelatex - How to let LaTeX look for a font's .fonspec in a specific directory? - Stack Overflow

I am a novice at LaTeX and I got a problem about using font.ProblemMy LaTeX workspace structure is li

I am a novice at LaTeX and I got a problem about using font.

Problem

My LaTeX workspace structure is like the following (case sensitive):

root
├── main.tex
├── class.cls
└── font
    ├── aaa.fontspec
    └── AAA-Roman.ttf

In class.cls I declared a new class based on the article class, specified the location of .fontspec and set the font:

\defaultfontfeatures{
    Path = ./font/,
    Extension = .fontspec
}
\setmonofont{AAA}

The content of aaa.fontspec is:

\defaultfontfeatures[AAA]
{
    Extension = .ttf,
    UprightFont = *-Roman
}

The main.tex then invoke the newly defined class as document class.

I use XeLaTeX for compilation. I suppose it will find the font in a way like \setmonofont{AAA} -> font/aaa.fontspec -> AAA.ttf but it failed with the error Package fontspec Error: The font "AAA" cannot be found.

Originally the aaa.fontspec was under the root directory and the .cls file does not have \defaultfontfeatures, everything worked just fine.

Question

  • What is the correct command to let LaTeX look for a fontspec in a specific directory?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744801401a4594512.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信