How can my master.tex file find font files stored in a subfolder to my working directory?











up vote
3
down vote

favorite
1












I need to use the font Gotham Rounded, and have so far placed the eights font files (.otf) in my working folder, i.e. the folder containing my master.tex file. This works fine. When compiling my masterfile XeLatex produces a Pdf of my manuscript with the Gotham font.



However, if I move the eight font files to a subfolder ("myFonts") of my working folder, then XeLaTeX is not able to find them.



How do I tell XeLaTeX where I have placed my font files? Can I set the path to the font files somewhere, and how will the path look?



In my preable I have placed the following code for my font choise:



usepackage{fontspec}

% Gotham Rounded
setmainfont[
BoldFont=GothamRnd-Bold.otf,
ItalicFont=GothamRnd-LightIta.otf,
BoldItalicFont=GothamRnd-BoldIta.otf,
]{GothamRnd-Light.otf}


Thanks for any help!










share|improve this question


















  • 1




    Generally, adding Path=./myFonts/, to the options should work
    – egreg
    Dec 4 at 21:36










  • Thanks. Where exactly do I add the string "Path =./myFonts/ " ?
    – myotis
    Dec 4 at 22:56










  • In the options to setmainfont
    – egreg
    Dec 4 at 23:05















up vote
3
down vote

favorite
1












I need to use the font Gotham Rounded, and have so far placed the eights font files (.otf) in my working folder, i.e. the folder containing my master.tex file. This works fine. When compiling my masterfile XeLatex produces a Pdf of my manuscript with the Gotham font.



However, if I move the eight font files to a subfolder ("myFonts") of my working folder, then XeLaTeX is not able to find them.



How do I tell XeLaTeX where I have placed my font files? Can I set the path to the font files somewhere, and how will the path look?



In my preable I have placed the following code for my font choise:



usepackage{fontspec}

% Gotham Rounded
setmainfont[
BoldFont=GothamRnd-Bold.otf,
ItalicFont=GothamRnd-LightIta.otf,
BoldItalicFont=GothamRnd-BoldIta.otf,
]{GothamRnd-Light.otf}


Thanks for any help!










share|improve this question


















  • 1




    Generally, adding Path=./myFonts/, to the options should work
    – egreg
    Dec 4 at 21:36










  • Thanks. Where exactly do I add the string "Path =./myFonts/ " ?
    – myotis
    Dec 4 at 22:56










  • In the options to setmainfont
    – egreg
    Dec 4 at 23:05













up vote
3
down vote

favorite
1









up vote
3
down vote

favorite
1






1





I need to use the font Gotham Rounded, and have so far placed the eights font files (.otf) in my working folder, i.e. the folder containing my master.tex file. This works fine. When compiling my masterfile XeLatex produces a Pdf of my manuscript with the Gotham font.



However, if I move the eight font files to a subfolder ("myFonts") of my working folder, then XeLaTeX is not able to find them.



How do I tell XeLaTeX where I have placed my font files? Can I set the path to the font files somewhere, and how will the path look?



In my preable I have placed the following code for my font choise:



usepackage{fontspec}

% Gotham Rounded
setmainfont[
BoldFont=GothamRnd-Bold.otf,
ItalicFont=GothamRnd-LightIta.otf,
BoldItalicFont=GothamRnd-BoldIta.otf,
]{GothamRnd-Light.otf}


Thanks for any help!










share|improve this question













I need to use the font Gotham Rounded, and have so far placed the eights font files (.otf) in my working folder, i.e. the folder containing my master.tex file. This works fine. When compiling my masterfile XeLatex produces a Pdf of my manuscript with the Gotham font.



However, if I move the eight font files to a subfolder ("myFonts") of my working folder, then XeLaTeX is not able to find them.



How do I tell XeLaTeX where I have placed my font files? Can I set the path to the font files somewhere, and how will the path look?



In my preable I have placed the following code for my font choise:



usepackage{fontspec}

% Gotham Rounded
setmainfont[
BoldFont=GothamRnd-Bold.otf,
ItalicFont=GothamRnd-LightIta.otf,
BoldItalicFont=GothamRnd-BoldIta.otf,
]{GothamRnd-Light.otf}


Thanks for any help!







fonts fontspec






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 4 at 21:23









myotis

4631314




4631314








  • 1




    Generally, adding Path=./myFonts/, to the options should work
    – egreg
    Dec 4 at 21:36










  • Thanks. Where exactly do I add the string "Path =./myFonts/ " ?
    – myotis
    Dec 4 at 22:56










  • In the options to setmainfont
    – egreg
    Dec 4 at 23:05














  • 1




    Generally, adding Path=./myFonts/, to the options should work
    – egreg
    Dec 4 at 21:36










  • Thanks. Where exactly do I add the string "Path =./myFonts/ " ?
    – myotis
    Dec 4 at 22:56










  • In the options to setmainfont
    – egreg
    Dec 4 at 23:05








1




1




Generally, adding Path=./myFonts/, to the options should work
– egreg
Dec 4 at 21:36




Generally, adding Path=./myFonts/, to the options should work
– egreg
Dec 4 at 21:36












Thanks. Where exactly do I add the string "Path =./myFonts/ " ?
– myotis
Dec 4 at 22:56




Thanks. Where exactly do I add the string "Path =./myFonts/ " ?
– myotis
Dec 4 at 22:56












In the options to setmainfont
– egreg
Dec 4 at 23:05




In the options to setmainfont
– egreg
Dec 4 at 23:05










1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










Just add the path. I also recommend a clearer syntax.



usepackage{fontspec}

% Gotham Rounded
setmainfont{GothamRnd}[
Path=./MyFonts/,
Extension=.otf,
UprightFont=*-Light,
BoldFont=*-Bold,
ItalicFont=*-LightIta,
BoldItalicFont=*-BoldIta,
]


The * stands for the main argument to setmainfont.






share|improve this answer





















  • Thanks a lot! I will test out your solution soon.
    – myotis
    Dec 4 at 23:12










  • It works perfect!
    – myotis
    Dec 5 at 9:11











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463220%2fhow-can-my-master-tex-file-find-font-files-stored-in-a-subfolder-to-my-working-d%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote



accepted










Just add the path. I also recommend a clearer syntax.



usepackage{fontspec}

% Gotham Rounded
setmainfont{GothamRnd}[
Path=./MyFonts/,
Extension=.otf,
UprightFont=*-Light,
BoldFont=*-Bold,
ItalicFont=*-LightIta,
BoldItalicFont=*-BoldIta,
]


The * stands for the main argument to setmainfont.






share|improve this answer





















  • Thanks a lot! I will test out your solution soon.
    – myotis
    Dec 4 at 23:12










  • It works perfect!
    – myotis
    Dec 5 at 9:11















up vote
4
down vote



accepted










Just add the path. I also recommend a clearer syntax.



usepackage{fontspec}

% Gotham Rounded
setmainfont{GothamRnd}[
Path=./MyFonts/,
Extension=.otf,
UprightFont=*-Light,
BoldFont=*-Bold,
ItalicFont=*-LightIta,
BoldItalicFont=*-BoldIta,
]


The * stands for the main argument to setmainfont.






share|improve this answer





















  • Thanks a lot! I will test out your solution soon.
    – myotis
    Dec 4 at 23:12










  • It works perfect!
    – myotis
    Dec 5 at 9:11













up vote
4
down vote



accepted







up vote
4
down vote



accepted






Just add the path. I also recommend a clearer syntax.



usepackage{fontspec}

% Gotham Rounded
setmainfont{GothamRnd}[
Path=./MyFonts/,
Extension=.otf,
UprightFont=*-Light,
BoldFont=*-Bold,
ItalicFont=*-LightIta,
BoldItalicFont=*-BoldIta,
]


The * stands for the main argument to setmainfont.






share|improve this answer












Just add the path. I also recommend a clearer syntax.



usepackage{fontspec}

% Gotham Rounded
setmainfont{GothamRnd}[
Path=./MyFonts/,
Extension=.otf,
UprightFont=*-Light,
BoldFont=*-Bold,
ItalicFont=*-LightIta,
BoldItalicFont=*-BoldIta,
]


The * stands for the main argument to setmainfont.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 4 at 23:07









egreg

704k8618753154




704k8618753154












  • Thanks a lot! I will test out your solution soon.
    – myotis
    Dec 4 at 23:12










  • It works perfect!
    – myotis
    Dec 5 at 9:11


















  • Thanks a lot! I will test out your solution soon.
    – myotis
    Dec 4 at 23:12










  • It works perfect!
    – myotis
    Dec 5 at 9:11
















Thanks a lot! I will test out your solution soon.
– myotis
Dec 4 at 23:12




Thanks a lot! I will test out your solution soon.
– myotis
Dec 4 at 23:12












It works perfect!
– myotis
Dec 5 at 9:11




It works perfect!
– myotis
Dec 5 at 9:11


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463220%2fhow-can-my-master-tex-file-find-font-files-stored-in-a-subfolder-to-my-working-d%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?