Euro sign when using latex interpreter
12 次查看(过去 30 天)
显示 更早的评论
This has been asked before, of course, but not in a couple of years, so I'd like to ask again: is it possibly by now to use the Euro symbol, €, when using latex as the Interpreter, e.g. for legend entries? And if so, how?
Something as simple as
text(.5, .5, "€", "Interpreter", "latex")
breaks, as does (\texteuro requires no additional packages anymore these days BTW)
text(.5, .5, "\texteuro", "Interpreter", "latex")
And this is rather annoying: consider the case where one (and only one!) of your legend entries in a more complicated plot is suddenly rendered using the tex interpreter, say.
People have asked about this in 2015, in 2017 (twice), and in 2018, and the answer's always been "this is not possible".
It's been years since then. MATLAB is a commercial product with outstanding development and support teams, and does not come cheap. I hope that this time, the answer will be "yes, this has been implemented" (or at the very least, "no, not yet, but we will do so for the next release"; I'll be happy to file an RFE in that case if it helps).
Thanks,
Chris
0 个评论
回答(2 个)
Nitya Patel
2023-6-8
It is my understanding that you would like to add a Euro symbol in a legend. As of MATLAB R2023a, you can simply add it using the following code:
text(.5, .5, "€");
Moreover, if you do not have access to the "€" key, you can alternatively use char(8364) as below:
text(.5, .5, char(8364))
3 个评论
Nitya Patel
2023-6-8
No I did not use ChatGPT. I just went on MATLAB and tried a couple things till I found a solution. I now understand that you want to do so using the LaTeX interpreter to make it prettier. I do not think it is currently possible.
Rik
2023-6-8
I can't find it right now, but I recall someone changing/updaing the LaTeX engine shipped with Matlab (but apparently this is no longer possible).
You could either use placeholders and typeset with LaTeX outside of Matlab, or mess around with text calls to build your own legend out of the constituent parts. That way lies madness, but it will work:
hold on
text(0.100, 0.5, 'this is a')
text(0.225, 0.5, 'very')
text(0.300, 0.5, 'bad idea')
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Data Preparation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!