What works in 2024 stopped with 2025: Latex interpreter

108 visualizzazioni (ultimi 30 giorni)
Gokhan Pekcan
Gokhan Pekcan il 12 Ott 2025 alle 13:03
Modificato: dpb il 14 Ott 2025 alle 18:31
The following (\textcircled and \fbox) used to produce circled and boxed text on axes in MATLAB 2024 and earlier versions. Can you tell what might have happened and/or a specific setting that would restore? Or is there an alternative efficient way (instead of writing lines of code and using graphics) to get circled/boxed text?
I realize that latex support in MATLAB may be somewhat limited, but I wish that what worked before still works.
Thank you all in advance...
GP--
text(0.5,0.5,[' ' ' $\raisebox{.5pt}{\textcircled{\raisebox{-.9pt} {' num2str(14) '}}}$' ' :i-end'],...
'Units','normalized','HorizontalAlignment','left','VerticalAlignment', 'bottom', 'Color','m',...
'Interpreter','latex',"FontSize",14);
text(0.2,0.5,['$\fbox{ ' num2str(25) ' }$' ],...
'HorizontalAlignment','center','VerticalAlignment', 'top','rotation',40,...
'Interpreter','latex',"FontSize",11);
  7 Commenti
Paul
Paul il 13 Ott 2025 alle 21:33
Adding an extra line to the plot just to get the circled text could be problematic, or at least annoying. For example, that additional, single-marker line will have to be dealt with in the legend, any findobj code looking for lines, etc.
dpb
dpb il 14 Ott 2025 alle 4:24
Modificato: dpb il 14 Ott 2025 alle 13:32
Yeah, but one could manage the pain somewhat if wrapped in a user function to set
...
hCirc=plot(x,y,'o','Markeredgecolor',c,'Markersize',sz,'HandleVisibility','off');
hCirc.Annotation.LegendInformation.IconDisplayStyle='off;

Accedi per commentare.

Risposta accettata

dpb
dpb il 12 Ott 2025 alle 14:05
Modificato: dpb il 13 Ott 2025 alle 16:22
Submit this to Mathworks as an official support request/bug at <Product Support Page>.
With the new nendering engine much seems to be different and/or broken, but Mathworks won't know about rare usage issues unless they're reported.
ADDENDUM
As in Comment above, it appears Mathworks has purposely removed these builtin LaTeX commands in latest release. IMO, that is misguided on their part; let the user decide whether the result is ok or not, don't prevent the use entirely, whether it is an elegant solution or not.
I've not seen much noise in the area recently, a number of years ago there was quite a bit of activity trying to add packages, but it appears folks just gave up as a lost cause. That again, would seem to me to be a reasonable enhancement request to document how that can be done or add the ability if not presently so...or use another full implementation instead.

Più risposte (1)

Walter Roberson
Walter Roberson il 13 Ott 2025 alle 19:52
\raisebox and \fbox were never previously documented as working.
I speculate that when Mathworks converted java based figures to javascript based figures, that they had to re-implement latex, and that they simply did not take the time to re-implement commands that were previously supported but were undocumented.
  3 Commenti
dpb
dpb il 13 Ott 2025 alle 21:48
Modificato: dpb il 14 Ott 2025 alle 18:31
OK, so that is, I presume also when it became a subtopic in the Live Editor documentation instead of standing alone as annotation of graphics.
However, note for text for use as @Gokhan Pekcan is/was using the interpreter the documentation is still identical as it was before in R2022b and text is still the same documentation links as it was before as well. No indication anything changed there with the use of 'Interpreter','latex' from prior releases.
From this it appears Mathworks has switched horses in midstream with only live scripts having been considered in revising LaTeX support. And, you'll never stumble across the above list from the text function documentation.

Accedi per commentare.

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Prodotti


Release

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by