Tikz - Set all nodes in sans serif font
So far I had the understanding that providing font commands after a "parental" scope/more global definition was given, is additional, but I was wrong.
How can I get nodes which are only set in the sans serif font?
Picture of MWE
MWE
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[
font=sffamily,
every node/.style={
font=sffamily,
},]
node at (0,0) {123 - in sans!};
node[font=bfseries] at (0,-1cm) {123 not sans :(} ;
end{tikzpicture}
end{document}
tikz-pgf tikz-styles
add a comment |
So far I had the understanding that providing font commands after a "parental" scope/more global definition was given, is additional, but I was wrong.
How can I get nodes which are only set in the sans serif font?
Picture of MWE
MWE
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[
font=sffamily,
every node/.style={
font=sffamily,
},]
node at (0,0) {123 - in sans!};
node[font=bfseries] at (0,-1cm) {123 not sans :(} ;
end{tikzpicture}
end{document}
tikz-pgf tikz-styles
add a comment |
So far I had the understanding that providing font commands after a "parental" scope/more global definition was given, is additional, but I was wrong.
How can I get nodes which are only set in the sans serif font?
Picture of MWE
MWE
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[
font=sffamily,
every node/.style={
font=sffamily,
},]
node at (0,0) {123 - in sans!};
node[font=bfseries] at (0,-1cm) {123 not sans :(} ;
end{tikzpicture}
end{document}
tikz-pgf tikz-styles
So far I had the understanding that providing font commands after a "parental" scope/more global definition was given, is additional, but I was wrong.
How can I get nodes which are only set in the sans serif font?
Picture of MWE
MWE
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[
font=sffamily,
every node/.style={
font=sffamily,
},]
node at (0,0) {123 - in sans!};
node[font=bfseries] at (0,-1cm) {123 not sans :(} ;
end{tikzpicture}
end{document}
tikz-pgf tikz-styles
tikz-pgf tikz-styles
asked Jan 2 at 12:18
henryhenry
2,88332470
2,88332470
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In your setting, font=bfseries
overrides font=sffamily
. However, if you use node font
instead of font in order to apply either of them, it works. This is because TikZ will apply both font
and node font
.
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[font=sffamily]
node at (0,0) {123 - in sans!};
node[node font=bfseries] at (0,-1cm) {123 now sans ;-)} ;
end{tikzpicture}
end{document}
In principle, you may reverse the roles of font
and node font
. However, the pgfmanual says on p. 223
whereas for node font
(see p. 222) this restriction seems not to apply:
Therefore, I'd like to argue one should use those modifiers like bfseries
, which change the dimensions of the text (more) with node font
rather than just font
.
1
Thank you! And based on tex.stackexchange.com/questions/359570/…, apparently there is also the option/utils/exec={sffamily},
. I just found that, btw.
– henry
Jan 2 at 15:09
1
@henry Thanks! I did not know that.
– marmot
Jan 2 at 16:03
1
I didn't knownode font
, +1!
– CarLaTeX
Jan 2 at 18:22
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
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%2f468232%2ftikz-set-all-nodes-in-sans-serif-font%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
In your setting, font=bfseries
overrides font=sffamily
. However, if you use node font
instead of font in order to apply either of them, it works. This is because TikZ will apply both font
and node font
.
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[font=sffamily]
node at (0,0) {123 - in sans!};
node[node font=bfseries] at (0,-1cm) {123 now sans ;-)} ;
end{tikzpicture}
end{document}
In principle, you may reverse the roles of font
and node font
. However, the pgfmanual says on p. 223
whereas for node font
(see p. 222) this restriction seems not to apply:
Therefore, I'd like to argue one should use those modifiers like bfseries
, which change the dimensions of the text (more) with node font
rather than just font
.
1
Thank you! And based on tex.stackexchange.com/questions/359570/…, apparently there is also the option/utils/exec={sffamily},
. I just found that, btw.
– henry
Jan 2 at 15:09
1
@henry Thanks! I did not know that.
– marmot
Jan 2 at 16:03
1
I didn't knownode font
, +1!
– CarLaTeX
Jan 2 at 18:22
add a comment |
In your setting, font=bfseries
overrides font=sffamily
. However, if you use node font
instead of font in order to apply either of them, it works. This is because TikZ will apply both font
and node font
.
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[font=sffamily]
node at (0,0) {123 - in sans!};
node[node font=bfseries] at (0,-1cm) {123 now sans ;-)} ;
end{tikzpicture}
end{document}
In principle, you may reverse the roles of font
and node font
. However, the pgfmanual says on p. 223
whereas for node font
(see p. 222) this restriction seems not to apply:
Therefore, I'd like to argue one should use those modifiers like bfseries
, which change the dimensions of the text (more) with node font
rather than just font
.
1
Thank you! And based on tex.stackexchange.com/questions/359570/…, apparently there is also the option/utils/exec={sffamily},
. I just found that, btw.
– henry
Jan 2 at 15:09
1
@henry Thanks! I did not know that.
– marmot
Jan 2 at 16:03
1
I didn't knownode font
, +1!
– CarLaTeX
Jan 2 at 18:22
add a comment |
In your setting, font=bfseries
overrides font=sffamily
. However, if you use node font
instead of font in order to apply either of them, it works. This is because TikZ will apply both font
and node font
.
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[font=sffamily]
node at (0,0) {123 - in sans!};
node[node font=bfseries] at (0,-1cm) {123 now sans ;-)} ;
end{tikzpicture}
end{document}
In principle, you may reverse the roles of font
and node font
. However, the pgfmanual says on p. 223
whereas for node font
(see p. 222) this restriction seems not to apply:
Therefore, I'd like to argue one should use those modifiers like bfseries
, which change the dimensions of the text (more) with node font
rather than just font
.
In your setting, font=bfseries
overrides font=sffamily
. However, if you use node font
instead of font in order to apply either of them, it works. This is because TikZ will apply both font
and node font
.
documentclass[
fontsize=11pt,
DIV=12,
paper=a4,
]{standalone}
usepackage{
tikz,
}
usepackage{amsmath}
usepackage{textcomp}
usepackage[oldstyle,proportional]{libertine}
usepackage{libertinust1math}
usepackage{zlmtt}
usepackage[scale=0.8558]{tgheros}
usepackage{microtype}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
begin{document}
begin{tikzpicture}[font=sffamily]
node at (0,0) {123 - in sans!};
node[node font=bfseries] at (0,-1cm) {123 now sans ;-)} ;
end{tikzpicture}
end{document}
In principle, you may reverse the roles of font
and node font
. However, the pgfmanual says on p. 223
whereas for node font
(see p. 222) this restriction seems not to apply:
Therefore, I'd like to argue one should use those modifiers like bfseries
, which change the dimensions of the text (more) with node font
rather than just font
.
edited Jan 2 at 12:40
answered Jan 2 at 12:25
marmotmarmot
106k5128242
106k5128242
1
Thank you! And based on tex.stackexchange.com/questions/359570/…, apparently there is also the option/utils/exec={sffamily},
. I just found that, btw.
– henry
Jan 2 at 15:09
1
@henry Thanks! I did not know that.
– marmot
Jan 2 at 16:03
1
I didn't knownode font
, +1!
– CarLaTeX
Jan 2 at 18:22
add a comment |
1
Thank you! And based on tex.stackexchange.com/questions/359570/…, apparently there is also the option/utils/exec={sffamily},
. I just found that, btw.
– henry
Jan 2 at 15:09
1
@henry Thanks! I did not know that.
– marmot
Jan 2 at 16:03
1
I didn't knownode font
, +1!
– CarLaTeX
Jan 2 at 18:22
1
1
Thank you! And based on tex.stackexchange.com/questions/359570/…, apparently there is also the option
/utils/exec={sffamily},
. I just found that, btw.– henry
Jan 2 at 15:09
Thank you! And based on tex.stackexchange.com/questions/359570/…, apparently there is also the option
/utils/exec={sffamily},
. I just found that, btw.– henry
Jan 2 at 15:09
1
1
@henry Thanks! I did not know that.
– marmot
Jan 2 at 16:03
@henry Thanks! I did not know that.
– marmot
Jan 2 at 16:03
1
1
I didn't know
node font
, +1!– CarLaTeX
Jan 2 at 18:22
I didn't know
node font
, +1!– CarLaTeX
Jan 2 at 18:22
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.
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%2f468232%2ftikz-set-all-nodes-in-sans-serif-font%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