How to add an accent mark in a label of a graph when using latex interpreter?
19 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Víctor Díaz Cortés
le 4 Mai 2022
Réponse apportée : Star Strider
le 4 Mai 2022
I got an error of syntax when using interpreter latex and a accent mark, for example this is the line I want to run, where the accent mark is in the "i" uppercase in the beggining:
xlabel('Índice $e_{i}$','interpreter','latex')
While this is not possible the only thing I can do is avoid the accent mark as follows:
xlabel('Indice $e_{i}$','interpreter','latex')
This is not ideal, do someone know how to get the first line of code working properly?
0 commentaires
Réponse acceptée
Star Strider
le 4 Mai 2022
The acute accent is coded as \' (‘escaped’ apostrophe) so within a quoted character array it has to be \'' —
figure
xlabel('\''Indice $e_{i}$','interpreter','latex', 'FontSize',20) % Character Array
figure
xlabel("\'Indice $e_{i}$",'interpreter','latex', 'FontSize',20) % String Array
.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings 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!

