Change only numbers' font of both text and math mode
I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.
I searched a lot but all answers I could find would only change the font in math mode using DeclareMathSymbol, I want this modification to affect all the document.
Thank you.
PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.
fonts
add a comment |
I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.
I searched a lot but all answers I could find would only change the font in math mode using DeclareMathSymbol, I want this modification to affect all the document.
Thank you.
PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.
fonts
7
Welcome to TeX.SX! If I callusepackage[sfdefault,lining]{FiraSans}, the numbers are lining.
– egreg
Sep 6 '15 at 22:28
And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). TheFiraSanspackage also supports the 2x2 set of possibilities.
– cfr
Sep 7 '15 at 1:17
The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?
– tipavi
Jan 16 '18 at 13:14
add a comment |
I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.
I searched a lot but all answers I could find would only change the font in math mode using DeclareMathSymbol, I want this modification to affect all the document.
Thank you.
PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.
fonts
I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.
I searched a lot but all answers I could find would only change the font in math mode using DeclareMathSymbol, I want this modification to affect all the document.
Thank you.
PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.
fonts
fonts
asked Sep 6 '15 at 22:22
HadronHadron
261
261
7
Welcome to TeX.SX! If I callusepackage[sfdefault,lining]{FiraSans}, the numbers are lining.
– egreg
Sep 6 '15 at 22:28
And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). TheFiraSanspackage also supports the 2x2 set of possibilities.
– cfr
Sep 7 '15 at 1:17
The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?
– tipavi
Jan 16 '18 at 13:14
add a comment |
7
Welcome to TeX.SX! If I callusepackage[sfdefault,lining]{FiraSans}, the numbers are lining.
– egreg
Sep 6 '15 at 22:28
And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). TheFiraSanspackage also supports the 2x2 set of possibilities.
– cfr
Sep 7 '15 at 1:17
The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?
– tipavi
Jan 16 '18 at 13:14
7
7
Welcome to TeX.SX! If I call
usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.– egreg
Sep 6 '15 at 22:28
Welcome to TeX.SX! If I call
usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.– egreg
Sep 6 '15 at 22:28
And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The
FiraSans package also supports the 2x2 set of possibilities.– cfr
Sep 7 '15 at 1:17
And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The
FiraSans package also supports the 2x2 set of possibilities.– cfr
Sep 7 '15 at 1:17
The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?
– tipavi
Jan 16 '18 at 13:14
The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?
– tipavi
Jan 16 '18 at 13:14
add a comment |
1 Answer
1
active
oldest
votes
With XeLaTeX and fontspec it's fairly easy :
usepackage{fontspec}
setmainfont{Fira Sans}
setmathrm{Anotherfont}
Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.
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%2f266157%2fchange-only-numbers-font-of-both-text-and-math-mode%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
With XeLaTeX and fontspec it's fairly easy :
usepackage{fontspec}
setmainfont{Fira Sans}
setmathrm{Anotherfont}
Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.
add a comment |
With XeLaTeX and fontspec it's fairly easy :
usepackage{fontspec}
setmainfont{Fira Sans}
setmathrm{Anotherfont}
Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.
add a comment |
With XeLaTeX and fontspec it's fairly easy :
usepackage{fontspec}
setmainfont{Fira Sans}
setmathrm{Anotherfont}
Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.
With XeLaTeX and fontspec it's fairly easy :
usepackage{fontspec}
setmainfont{Fira Sans}
setmathrm{Anotherfont}
Or you could check your font and the doc of Fontspec to edit setmathrm{Fira Sans} with the adequate options if it's available.
answered Dec 17 '18 at 17:51
Rémi ZinRémi Zin
47628
47628
add a comment |
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%2f266157%2fchange-only-numbers-font-of-both-text-and-math-mode%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
7
Welcome to TeX.SX! If I call
usepackage[sfdefault,lining]{FiraSans}, the numbers are lining.– egreg
Sep 6 '15 at 22:28
And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The
FiraSanspackage also supports the 2x2 set of possibilities.– cfr
Sep 7 '15 at 1:17
The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations?
– tipavi
Jan 16 '18 at 13:14