The macros setmainfont and setsansfont do not accept the new command of a newfontfamily. Is there...
up vote
2
down vote
favorite
I use the class memoir
, the packages polyglossia
, fontspec
, compile in XeLaTeX in Linux and on macOS.
Based on XeTeX package fontspec: Use previously defined newfontfamily with setmainfont (there were not available answers to this), I would like to set an extra font coming from a new command of newfontfamily
to setmainfont
and setsansfont
because I find unnecessary to multiply the same path/localization of the fonts in each macro. I want to economise and optimise the codes. Here is the MWE:
documentclass[12pt, a4paper, oneside, oldfontcommands, dvipsname]{memoir}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[Path = ./fontes/,
FontFace = {xb}{n} {* Black},
FontFace = {xb}{it} {* Black Italic},
UprightFont = * Regular,
ItalicFont = * Regular Italic,
BoldFont = * Bold,
BoldItalicFont = * Bold Italic,
]
setmainfont{alegreya}
setsansfont{alegreya}
Only my newfontfamily
part works, but the set*font
does accept the defined newcommand.
fonts xetex memoir fontspec mac
add a comment |
up vote
2
down vote
favorite
I use the class memoir
, the packages polyglossia
, fontspec
, compile in XeLaTeX in Linux and on macOS.
Based on XeTeX package fontspec: Use previously defined newfontfamily with setmainfont (there were not available answers to this), I would like to set an extra font coming from a new command of newfontfamily
to setmainfont
and setsansfont
because I find unnecessary to multiply the same path/localization of the fonts in each macro. I want to economise and optimise the codes. Here is the MWE:
documentclass[12pt, a4paper, oneside, oldfontcommands, dvipsname]{memoir}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[Path = ./fontes/,
FontFace = {xb}{n} {* Black},
FontFace = {xb}{it} {* Black Italic},
UprightFont = * Regular,
ItalicFont = * Regular Italic,
BoldFont = * Bold,
BoldItalicFont = * Bold Italic,
]
setmainfont{alegreya}
setsansfont{alegreya}
Only my newfontfamily
part works, but the set*font
does accept the defined newcommand.
fonts xetex memoir fontspec mac
1
That won't work. Create a fontspec-file if you want to reuse font settings, see section 2.3 By custom file name in the fontspec documentation.
– Ulrike Fischer
Nov 30 at 11:09
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I use the class memoir
, the packages polyglossia
, fontspec
, compile in XeLaTeX in Linux and on macOS.
Based on XeTeX package fontspec: Use previously defined newfontfamily with setmainfont (there were not available answers to this), I would like to set an extra font coming from a new command of newfontfamily
to setmainfont
and setsansfont
because I find unnecessary to multiply the same path/localization of the fonts in each macro. I want to economise and optimise the codes. Here is the MWE:
documentclass[12pt, a4paper, oneside, oldfontcommands, dvipsname]{memoir}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[Path = ./fontes/,
FontFace = {xb}{n} {* Black},
FontFace = {xb}{it} {* Black Italic},
UprightFont = * Regular,
ItalicFont = * Regular Italic,
BoldFont = * Bold,
BoldItalicFont = * Bold Italic,
]
setmainfont{alegreya}
setsansfont{alegreya}
Only my newfontfamily
part works, but the set*font
does accept the defined newcommand.
fonts xetex memoir fontspec mac
I use the class memoir
, the packages polyglossia
, fontspec
, compile in XeLaTeX in Linux and on macOS.
Based on XeTeX package fontspec: Use previously defined newfontfamily with setmainfont (there were not available answers to this), I would like to set an extra font coming from a new command of newfontfamily
to setmainfont
and setsansfont
because I find unnecessary to multiply the same path/localization of the fonts in each macro. I want to economise and optimise the codes. Here is the MWE:
documentclass[12pt, a4paper, oneside, oldfontcommands, dvipsname]{memoir}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[Path = ./fontes/,
FontFace = {xb}{n} {* Black},
FontFace = {xb}{it} {* Black Italic},
UprightFont = * Regular,
ItalicFont = * Regular Italic,
BoldFont = * Bold,
BoldItalicFont = * Bold Italic,
]
setmainfont{alegreya}
setsansfont{alegreya}
Only my newfontfamily
part works, but the set*font
does accept the defined newcommand.
fonts xetex memoir fontspec mac
fonts xetex memoir fontspec mac
asked Nov 30 at 10:59
Gustavo Reis
505
505
1
That won't work. Create a fontspec-file if you want to reuse font settings, see section 2.3 By custom file name in the fontspec documentation.
– Ulrike Fischer
Nov 30 at 11:09
add a comment |
1
That won't work. Create a fontspec-file if you want to reuse font settings, see section 2.3 By custom file name in the fontspec documentation.
– Ulrike Fischer
Nov 30 at 11:09
1
1
That won't work. Create a fontspec-file if you want to reuse font settings, see section 2.3 By custom file name in the fontspec documentation.
– Ulrike Fischer
Nov 30 at 11:09
That won't work. Create a fontspec-file if you want to reuse font settings, see section 2.3 By custom file name in the fontspec documentation.
– Ulrike Fischer
Nov 30 at 11:09
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
You can do it by assigning the family name. The string is essentially arbitrary, so long as it doesn't refer to an existing font family.
(I had to adapt the font setup to my machine.)
documentclass{article}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[
%Path = ./fontes/,
FontFace = {xb}{n} {*-Black},
FontFace = {xb}{it} {*-BlackItalic},
UprightFont = *-Regular,
ItalicFont = *-Italic,
BoldFont = *-Bold,
BoldItalicFont = *-BoldItalic,
NFSSFamily=alegreyaot
]
renewcommand{rmdefault}{alegreyaot}
renewcommand{sfdefault}{alegreyaot}
begin{document}
This should be Alegreya
textsf{This too}
{normalfontalegreya Check}
end{document}
Thank you a lot, I also have tested fontspec-file as Ulrike has suggested and it worked too. But what is the renewcommand for default maths font, similar to setmathsfont: mathnormal, mathrm or mathsf?
– Gustavo Reis
Nov 30 at 12:06
1
@GustavoReis Since there is no math font compatible with Alegreya, I'd not bother. Butsetmathrm{Alegreya-Regular}
should work.
– egreg
Nov 30 at 12:10
Then I will use Charter BT Math or GFS Neohellenic Math or Linux Libertinus Math.
– Gustavo Reis
Nov 30 at 12:13
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
You can do it by assigning the family name. The string is essentially arbitrary, so long as it doesn't refer to an existing font family.
(I had to adapt the font setup to my machine.)
documentclass{article}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[
%Path = ./fontes/,
FontFace = {xb}{n} {*-Black},
FontFace = {xb}{it} {*-BlackItalic},
UprightFont = *-Regular,
ItalicFont = *-Italic,
BoldFont = *-Bold,
BoldItalicFont = *-BoldItalic,
NFSSFamily=alegreyaot
]
renewcommand{rmdefault}{alegreyaot}
renewcommand{sfdefault}{alegreyaot}
begin{document}
This should be Alegreya
textsf{This too}
{normalfontalegreya Check}
end{document}
Thank you a lot, I also have tested fontspec-file as Ulrike has suggested and it worked too. But what is the renewcommand for default maths font, similar to setmathsfont: mathnormal, mathrm or mathsf?
– Gustavo Reis
Nov 30 at 12:06
1
@GustavoReis Since there is no math font compatible with Alegreya, I'd not bother. Butsetmathrm{Alegreya-Regular}
should work.
– egreg
Nov 30 at 12:10
Then I will use Charter BT Math or GFS Neohellenic Math or Linux Libertinus Math.
– Gustavo Reis
Nov 30 at 12:13
add a comment |
up vote
2
down vote
accepted
You can do it by assigning the family name. The string is essentially arbitrary, so long as it doesn't refer to an existing font family.
(I had to adapt the font setup to my machine.)
documentclass{article}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[
%Path = ./fontes/,
FontFace = {xb}{n} {*-Black},
FontFace = {xb}{it} {*-BlackItalic},
UprightFont = *-Regular,
ItalicFont = *-Italic,
BoldFont = *-Bold,
BoldItalicFont = *-BoldItalic,
NFSSFamily=alegreyaot
]
renewcommand{rmdefault}{alegreyaot}
renewcommand{sfdefault}{alegreyaot}
begin{document}
This should be Alegreya
textsf{This too}
{normalfontalegreya Check}
end{document}
Thank you a lot, I also have tested fontspec-file as Ulrike has suggested and it worked too. But what is the renewcommand for default maths font, similar to setmathsfont: mathnormal, mathrm or mathsf?
– Gustavo Reis
Nov 30 at 12:06
1
@GustavoReis Since there is no math font compatible with Alegreya, I'd not bother. Butsetmathrm{Alegreya-Regular}
should work.
– egreg
Nov 30 at 12:10
Then I will use Charter BT Math or GFS Neohellenic Math or Linux Libertinus Math.
– Gustavo Reis
Nov 30 at 12:13
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
You can do it by assigning the family name. The string is essentially arbitrary, so long as it doesn't refer to an existing font family.
(I had to adapt the font setup to my machine.)
documentclass{article}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[
%Path = ./fontes/,
FontFace = {xb}{n} {*-Black},
FontFace = {xb}{it} {*-BlackItalic},
UprightFont = *-Regular,
ItalicFont = *-Italic,
BoldFont = *-Bold,
BoldItalicFont = *-BoldItalic,
NFSSFamily=alegreyaot
]
renewcommand{rmdefault}{alegreyaot}
renewcommand{sfdefault}{alegreyaot}
begin{document}
This should be Alegreya
textsf{This too}
{normalfontalegreya Check}
end{document}
You can do it by assigning the family name. The string is essentially arbitrary, so long as it doesn't refer to an existing font family.
(I had to adapt the font setup to my machine.)
documentclass{article}
usepackage{fontspec}
newfontfamilyalegreya{Alegreya}[
%Path = ./fontes/,
FontFace = {xb}{n} {*-Black},
FontFace = {xb}{it} {*-BlackItalic},
UprightFont = *-Regular,
ItalicFont = *-Italic,
BoldFont = *-Bold,
BoldItalicFont = *-BoldItalic,
NFSSFamily=alegreyaot
]
renewcommand{rmdefault}{alegreyaot}
renewcommand{sfdefault}{alegreyaot}
begin{document}
This should be Alegreya
textsf{This too}
{normalfontalegreya Check}
end{document}
answered Nov 30 at 11:09
egreg
703k8618733147
703k8618733147
Thank you a lot, I also have tested fontspec-file as Ulrike has suggested and it worked too. But what is the renewcommand for default maths font, similar to setmathsfont: mathnormal, mathrm or mathsf?
– Gustavo Reis
Nov 30 at 12:06
1
@GustavoReis Since there is no math font compatible with Alegreya, I'd not bother. Butsetmathrm{Alegreya-Regular}
should work.
– egreg
Nov 30 at 12:10
Then I will use Charter BT Math or GFS Neohellenic Math or Linux Libertinus Math.
– Gustavo Reis
Nov 30 at 12:13
add a comment |
Thank you a lot, I also have tested fontspec-file as Ulrike has suggested and it worked too. But what is the renewcommand for default maths font, similar to setmathsfont: mathnormal, mathrm or mathsf?
– Gustavo Reis
Nov 30 at 12:06
1
@GustavoReis Since there is no math font compatible with Alegreya, I'd not bother. Butsetmathrm{Alegreya-Regular}
should work.
– egreg
Nov 30 at 12:10
Then I will use Charter BT Math or GFS Neohellenic Math or Linux Libertinus Math.
– Gustavo Reis
Nov 30 at 12:13
Thank you a lot, I also have tested fontspec-file as Ulrike has suggested and it worked too. But what is the renewcommand for default maths font, similar to setmathsfont: mathnormal, mathrm or mathsf?
– Gustavo Reis
Nov 30 at 12:06
Thank you a lot, I also have tested fontspec-file as Ulrike has suggested and it worked too. But what is the renewcommand for default maths font, similar to setmathsfont: mathnormal, mathrm or mathsf?
– Gustavo Reis
Nov 30 at 12:06
1
1
@GustavoReis Since there is no math font compatible with Alegreya, I'd not bother. But
setmathrm{Alegreya-Regular}
should work.– egreg
Nov 30 at 12:10
@GustavoReis Since there is no math font compatible with Alegreya, I'd not bother. But
setmathrm{Alegreya-Regular}
should work.– egreg
Nov 30 at 12:10
Then I will use Charter BT Math or GFS Neohellenic Math or Linux Libertinus Math.
– Gustavo Reis
Nov 30 at 12:13
Then I will use Charter BT Math or GFS Neohellenic Math or Linux Libertinus Math.
– Gustavo Reis
Nov 30 at 12:13
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462544%2fthe-macros-setmainfont-and-setsansfont-do-not-accept-the-new-command-of-a-newfon%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
That won't work. Create a fontspec-file if you want to reuse font settings, see section 2.3 By custom file name in the fontspec documentation.
– Ulrike Fischer
Nov 30 at 11:09