Problem with latex interpreter

10 views (last 30 days)
Daniel Leontiev
Daniel Leontiev on 9 May 2016
Commented: Walter Roberson on 9 May 2016
I use latex interpreter when add labels to my plots. For example,
ylabel('$\varphi(x)$');
I would like to use cyrillic letters in my labels, but when I write
ylabel('$\varphi(x)$, абв')
I get latex interpreter error:
Warning: Error updating Text.
String must have valid interpreter syntax:
$\varphi(x)$, абв
Please, help to solve this problem

Answers (1)

Walter Roberson
Walter Roberson on 9 May 2016
As best I recall, basic latex does not support characters outside the range 0 to 255. There are libraries that can be added to get unicode characters, but it is not obvious how to add them to MATLAB; see http://www.mathworks.com/matlabcentral/answers/232589-how-to-add-latex-packages-for-the-latex-interpreter-how-to-print-the-euro-symbol-with-the-latex-in
  2 Comments
Daniel Leontiev
Daniel Leontiev on 9 May 2016
Hello! Thanks a lot for answer! Unfortunately, char(smth) does not work. So, the promblem is still actual. I find smth interesting about association matlab and latex. Do you know smth about matlabfrag.m script? This script generates .tex and .eps file with plot, and you can use all latex commands in labels in matlab because commands are interpretating with your miktex or texlive.But there is one problem with this script: the last update was on 2010, after that mathworks have changed smth in legend, and matlabfrag.m does not work with legends. So, now I don't know any fine way to use latex in matlab. Can you give me advice, please? What do you use to include matlab graphics in latex?
Walter Roberson
Walter Roberson on 9 May 2016
If you follow the links in my Answer there you would reach http://www.mathworks.com/matlabcentral/answers/232055-is-there-a-hook-that-will-allow-me-to-change-the-document-style-and-or-add-packages-to-the-latex-fil#answer_187995 which has information about adding new latex packages.
I do not know anything about matlabfrag .
I have never tried to include MATLAB graphics in latex.

Sign in to comment.

Categories

Find more on Desktop in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!