LaTeX interpreter but sans-serif font on Matlab figures
On LaTeX I often use the usepackagecmbright
font when I want to have a clean, sans-serif font both in the text and in the mathematical formula I write.
In order to have an homogeneous result between my figures and the text, I would like the text in my figures (labels, axis ticks, title, annotations...) to be as well in this font.
Unfortunately so far on Matlab, when using the LaTeX interpreter, only the default font is available. I would like to be able to write both text and mathematical formulas in a sans-serif font (and the same for both text and math) on the figures I plot.
Also, I would need to export the result as .eps figures (preserving the sans-serif font and all).
Any idea?
I am on Mac OS 10.14.1 (Matlab 2018a) and also on Ubuntu 18.10 (Matlab 2018b).
Thank you for your help!
matlab fonts latex matlab-figure text-formatting
add a comment |
On LaTeX I often use the usepackagecmbright
font when I want to have a clean, sans-serif font both in the text and in the mathematical formula I write.
In order to have an homogeneous result between my figures and the text, I would like the text in my figures (labels, axis ticks, title, annotations...) to be as well in this font.
Unfortunately so far on Matlab, when using the LaTeX interpreter, only the default font is available. I would like to be able to write both text and mathematical formulas in a sans-serif font (and the same for both text and math) on the figures I plot.
Also, I would need to export the result as .eps figures (preserving the sans-serif font and all).
Any idea?
I am on Mac OS 10.14.1 (Matlab 2018a) and also on Ubuntu 18.10 (Matlab 2018b).
Thank you for your help!
matlab fonts latex matlab-figure text-formatting
2
You want to useexport_fig
. For text, simply write a placeholder, and replace it in LaTeX (e.g. usingpsfrag
). That is the best way to match fonts exactly.
– Cris Luengo
Nov 13 '18 at 19:51
Save your results as csv files and then use pgfplots and pgfplotstable to load and plot it in LaTeX, this give imho by far the best results.
– Nicky Mattsson
Nov 14 '18 at 9:25
Thanks for your answers, but for now, I just save my images in .eps on Matlab and then modify them on Illustrator or Inkscape in order to replace any text manually with a LaTeX compiled expression (using LaTeXit on Mac for instance). I was looking for something more straightforward, just in Matlab, in order to create the figures independently from the LaTeX article I am writing (so I can reuse the figure for an oral presentation for instance).
– LeChat
Nov 16 '18 at 19:32
Are you familiar with matlab2tikz? It converts matlab figures to TikZ/Pgfplots files which can be rendered by LateX. The script has plenty of options, so it can probably be configured to your needs. If you have more questions on the TikZ aspect: head on over to tex.stackexchange.com, there are plenty of questions and people there who can help you.
– Saaru Lindestøkke
Nov 20 '18 at 23:14
add a comment |
On LaTeX I often use the usepackagecmbright
font when I want to have a clean, sans-serif font both in the text and in the mathematical formula I write.
In order to have an homogeneous result between my figures and the text, I would like the text in my figures (labels, axis ticks, title, annotations...) to be as well in this font.
Unfortunately so far on Matlab, when using the LaTeX interpreter, only the default font is available. I would like to be able to write both text and mathematical formulas in a sans-serif font (and the same for both text and math) on the figures I plot.
Also, I would need to export the result as .eps figures (preserving the sans-serif font and all).
Any idea?
I am on Mac OS 10.14.1 (Matlab 2018a) and also on Ubuntu 18.10 (Matlab 2018b).
Thank you for your help!
matlab fonts latex matlab-figure text-formatting
On LaTeX I often use the usepackagecmbright
font when I want to have a clean, sans-serif font both in the text and in the mathematical formula I write.
In order to have an homogeneous result between my figures and the text, I would like the text in my figures (labels, axis ticks, title, annotations...) to be as well in this font.
Unfortunately so far on Matlab, when using the LaTeX interpreter, only the default font is available. I would like to be able to write both text and mathematical formulas in a sans-serif font (and the same for both text and math) on the figures I plot.
Also, I would need to export the result as .eps figures (preserving the sans-serif font and all).
Any idea?
I am on Mac OS 10.14.1 (Matlab 2018a) and also on Ubuntu 18.10 (Matlab 2018b).
Thank you for your help!
matlab fonts latex matlab-figure text-formatting
matlab fonts latex matlab-figure text-formatting
asked Nov 13 '18 at 19:45
LeChatLeChat
134113
134113
2
You want to useexport_fig
. For text, simply write a placeholder, and replace it in LaTeX (e.g. usingpsfrag
). That is the best way to match fonts exactly.
– Cris Luengo
Nov 13 '18 at 19:51
Save your results as csv files and then use pgfplots and pgfplotstable to load and plot it in LaTeX, this give imho by far the best results.
– Nicky Mattsson
Nov 14 '18 at 9:25
Thanks for your answers, but for now, I just save my images in .eps on Matlab and then modify them on Illustrator or Inkscape in order to replace any text manually with a LaTeX compiled expression (using LaTeXit on Mac for instance). I was looking for something more straightforward, just in Matlab, in order to create the figures independently from the LaTeX article I am writing (so I can reuse the figure for an oral presentation for instance).
– LeChat
Nov 16 '18 at 19:32
Are you familiar with matlab2tikz? It converts matlab figures to TikZ/Pgfplots files which can be rendered by LateX. The script has plenty of options, so it can probably be configured to your needs. If you have more questions on the TikZ aspect: head on over to tex.stackexchange.com, there are plenty of questions and people there who can help you.
– Saaru Lindestøkke
Nov 20 '18 at 23:14
add a comment |
2
You want to useexport_fig
. For text, simply write a placeholder, and replace it in LaTeX (e.g. usingpsfrag
). That is the best way to match fonts exactly.
– Cris Luengo
Nov 13 '18 at 19:51
Save your results as csv files and then use pgfplots and pgfplotstable to load and plot it in LaTeX, this give imho by far the best results.
– Nicky Mattsson
Nov 14 '18 at 9:25
Thanks for your answers, but for now, I just save my images in .eps on Matlab and then modify them on Illustrator or Inkscape in order to replace any text manually with a LaTeX compiled expression (using LaTeXit on Mac for instance). I was looking for something more straightforward, just in Matlab, in order to create the figures independently from the LaTeX article I am writing (so I can reuse the figure for an oral presentation for instance).
– LeChat
Nov 16 '18 at 19:32
Are you familiar with matlab2tikz? It converts matlab figures to TikZ/Pgfplots files which can be rendered by LateX. The script has plenty of options, so it can probably be configured to your needs. If you have more questions on the TikZ aspect: head on over to tex.stackexchange.com, there are plenty of questions and people there who can help you.
– Saaru Lindestøkke
Nov 20 '18 at 23:14
2
2
You want to use
export_fig
. For text, simply write a placeholder, and replace it in LaTeX (e.g. using psfrag
). That is the best way to match fonts exactly.– Cris Luengo
Nov 13 '18 at 19:51
You want to use
export_fig
. For text, simply write a placeholder, and replace it in LaTeX (e.g. using psfrag
). That is the best way to match fonts exactly.– Cris Luengo
Nov 13 '18 at 19:51
Save your results as csv files and then use pgfplots and pgfplotstable to load and plot it in LaTeX, this give imho by far the best results.
– Nicky Mattsson
Nov 14 '18 at 9:25
Save your results as csv files and then use pgfplots and pgfplotstable to load and plot it in LaTeX, this give imho by far the best results.
– Nicky Mattsson
Nov 14 '18 at 9:25
Thanks for your answers, but for now, I just save my images in .eps on Matlab and then modify them on Illustrator or Inkscape in order to replace any text manually with a LaTeX compiled expression (using LaTeXit on Mac for instance). I was looking for something more straightforward, just in Matlab, in order to create the figures independently from the LaTeX article I am writing (so I can reuse the figure for an oral presentation for instance).
– LeChat
Nov 16 '18 at 19:32
Thanks for your answers, but for now, I just save my images in .eps on Matlab and then modify them on Illustrator or Inkscape in order to replace any text manually with a LaTeX compiled expression (using LaTeXit on Mac for instance). I was looking for something more straightforward, just in Matlab, in order to create the figures independently from the LaTeX article I am writing (so I can reuse the figure for an oral presentation for instance).
– LeChat
Nov 16 '18 at 19:32
Are you familiar with matlab2tikz? It converts matlab figures to TikZ/Pgfplots files which can be rendered by LateX. The script has plenty of options, so it can probably be configured to your needs. If you have more questions on the TikZ aspect: head on over to tex.stackexchange.com, there are plenty of questions and people there who can help you.
– Saaru Lindestøkke
Nov 20 '18 at 23:14
Are you familiar with matlab2tikz? It converts matlab figures to TikZ/Pgfplots files which can be rendered by LateX. The script has plenty of options, so it can probably be configured to your needs. If you have more questions on the TikZ aspect: head on over to tex.stackexchange.com, there are plenty of questions and people there who can help you.
– Saaru Lindestøkke
Nov 20 '18 at 23:14
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fstackoverflow.com%2fquestions%2f53288417%2flatex-interpreter-but-sans-serif-font-on-matlab-figures%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f53288417%2flatex-interpreter-but-sans-serif-font-on-matlab-figures%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
2
You want to use
export_fig
. For text, simply write a placeholder, and replace it in LaTeX (e.g. usingpsfrag
). That is the best way to match fonts exactly.– Cris Luengo
Nov 13 '18 at 19:51
Save your results as csv files and then use pgfplots and pgfplotstable to load and plot it in LaTeX, this give imho by far the best results.
– Nicky Mattsson
Nov 14 '18 at 9:25
Thanks for your answers, but for now, I just save my images in .eps on Matlab and then modify them on Illustrator or Inkscape in order to replace any text manually with a LaTeX compiled expression (using LaTeXit on Mac for instance). I was looking for something more straightforward, just in Matlab, in order to create the figures independently from the LaTeX article I am writing (so I can reuse the figure for an oral presentation for instance).
– LeChat
Nov 16 '18 at 19:32
Are you familiar with matlab2tikz? It converts matlab figures to TikZ/Pgfplots files which can be rendered by LateX. The script has plenty of options, so it can probably be configured to your needs. If you have more questions on the TikZ aspect: head on over to tex.stackexchange.com, there are plenty of questions and people there who can help you.
– Saaru Lindestøkke
Nov 20 '18 at 23:14