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条)