Setting default Interpreter to Latex
Mostrar comentarios más antiguos
In previous versions of MATLAB, the command
set(0,'defaulttextInterpreter','latex') %latex axis labels
set the interpreter for the text command, the xlabel command, and so on, to Latex. This does not work in 2015a. Is there an alternative way to set the default interpreter to Latex for all graphics objects. Thank you.
Respuesta aceptada
Más respuestas (4)
Max Bartholdt
el 7 de Oct. de 2021
clear all
% This script changes all interpreters from tex to latex.
list_factory = fieldnames(get(groot,'factory'));
index_interpreter = find(contains(list_factory,'Interpreter'));
for i = 1:length(index_interpreter)
default_name = strrep(list_factory{index_interpreter(i)},'factory','default');
set(groot, default_name,'latex');
end
1 comentario
Aryan Ritwajeet Jha
el 24 de En. de 2022
Thanks.
Ganesh Gaonkar
el 16 de Mzo. de 2015
3 votos
I think the command should work even on R2015a. Looks like you have missed making 'text' as CamelCase. So ideally the command should be : set(0,'defaultTextInterpreter','latex');
3 comentarios
Fred
el 16 de Mzo. de 2015
Ganesh Gaonkar
el 16 de Mzo. de 2015
It seems to be working for me. What error you receive when you try to execute that command?
Fred
el 16 de Mzo. de 2015
Cael Warner
el 13 de Oct. de 2017
1 voto
Also, to go back to the default formatting, replace 'latex' with 'none'
1 comentario
Johirul Islam
el 3 de Feb. de 2021
Thanks!
beginner94
el 16 de Oct. de 2018
0 votos
It does not work for me either and I need to define an overlined variable (in R2007b).
Thanks for help
5 comentarios
Steven Lord
el 16 de Oct. de 2018
Search the documentation included in your installation (and not the online documentation, which is for a release more than ten years newer than the one you're using) for the three words "default property values" and follow the instructions on the first page in the search results.
beginner94
el 18 de Oct. de 2018
I don't know how to define an overlined variable with latex (the syntax), even if I set the default interpreter to latex... I'm not looking for an overlined label. Is it actually possible to overline a variable?!
Steven Lord
el 18 de Oct. de 2018
You mean you want to define a variable whose name is \bar{x}, using the LaTeX notation? No, that is not allowed. The rules for valid variable names are given in the documentation for the isvarname function:
- A valid variable name must begin with a letter.
- A valid variable name may has no more than namelengthmax characters.
- A valid variable name may contain only letters, digits, and/or the underscore character _.
- A valid variable name must not be a keyword (the iskeyword function gives you a list of the keywords.)
Use something similar or evocative of that name like xbar or barx as your variable name.
beginner94
el 18 de Oct. de 2018
Exactly! Thank you!
Walter Roberson
el 3 de Feb. de 2021
These days see Live Editor https://www.mathworks.com/help/symbolic/add-suffixes-to-symbolic-results.html
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!