LaTeX Interpreter and Blackboard bold (\mathbb{}) for text

159 vues (au cours des 30 derniers jours)
Leo
Leo le 27 Déc 2011
Hello
I'm creating a MATLAB plot to be exported in a LaTeX document in eps format.
For instance, I have the following ylabel command that works properly:
ylabel('$\alpha \in R$','Interpreter','latex')
However, if I try to use black board style in the text for the letter R this will not work:
ylabel('$\alpha \in \mathbb{R}$','Interpreter','latex')
I understand that the mathbb requires the amsmath package but I'm wondering if there is any other way to have that letter R in black board sytle.
Thanks in advance.
L

Réponse acceptée

Honglei Chen
Honglei Chen le 27 Déc 2011
If that is all you want to do, you can use the default tex interpreter.
ylabel('\alpha in \bf{R}')

Plus de réponses (4)

Seongmun Jung
Seongmun Jung le 1 Nov 2021
Use ℝ (Unicode Decimal Code &#8477)
ylabel('\alpha \in ℝ')
or
ylabel(sprintf("\\alpha \\in %c", 8477))
  1 commentaire
Walter Roberson
Walter Roberson le 1 Nov 2021
Note: you can only use unicode characters in R2015b or later, and you have to be using interpreter 'none' or interpreter 'tex' . It does not work with interpreter 'latex'

Connectez-vous pour commenter.


Leo
Leo le 27 Déc 2011
Hello Chen
Thanks for your reply.
Actually, I'd like to display R in blackboard bold type (see for instance http://en.wikipedia.org/wiki/Blackboard_bold), which is normally used for sets.
Thanks for any hint.
L
  1 commentaire
Honglei Chen
Honglei Chen le 27 Déc 2011
Hi Leo,
I've never done that so I don't know if it can be done. I could be wrong but my guess is no as it is not part of basic TeX or LaTeX and MATLAB only supports only a basic subset of TeX or LaTeX.
I would suggest you to contact technical support and get an authoritative answer on this.
HTH

Connectez-vous pour commenter.


Leo
Leo le 28 Déc 2011
Modifié(e) : Walter Roberson le 2 Août 2015
Hi Chen,
There is a turnaround to get \mathbb{} in a MATLAB figure by using the psfrag package http://en.wikipedia.org/wiki/PSfrag, which lets you overlay eps figues with LaTeX code.
Kind regards
L
  1 commentaire
Honglei Chen
Honglei Chen le 28 Déc 2011
Hi Leo,
Good to know this trick, thanks for sharing.

Connectez-vous pour commenter.


Demetrio Rodriguez Tereshkin

Catégories

En savoir plus sur Live Scripts and Functions dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by