Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTeX annotation in MATLAB

Tags:

latex

matlab

I am trying to add a LaTeX annotation to a figure in MATLAB, but I'm running in to some problems. If I run

figure
annotation('textarrow', [0.3, 0.6], [0.3, 0.6], 'String', '$$\tau_{\mathrm{abc}}$$', 'interp', 'latex')

I would expect an arrow with the correct annotation. That is indeed what I get, but I also receive the following warning messages:

Warning: Unable to interpret TeX string "$$\tau_{\mathrm{abc}}$$" 
> In scribe.textarrow.createTextArrow>localChangePosition at 409
  In scribe.textarrow.schema>localSetToText at 357
  In scribe.textarrow.createTextArrow at 152
  In scribe.textarrow.textarrow at 11
  In annotation at 149 
Warning: incomplete command in TeX text string:
'$$\tau_{\mathrm{abc}}$$' 
> In scribe.textarrow.createTextArrow>localChangePosition at 409
  In scribe.textarrow.schema>localSetToText at 357
  In scribe.textarrow.createTextArrow at 152
  In scribe.textarrow.textarrow at 11
  In annotation at 149 

So, my question is, why do I get these warnings, and how do I correct the underlying problem?

like image 392
riklund Avatar asked Nov 19 '25 01:11

riklund


1 Answers

All you need to do is specify the interpreter before the string. This works

annotation('textarrow', [0.3, 0.6], [0.3, 0.6], 'interpreter', 'latex', 'String', '$$\tau_{\mathrm{abc}}$$')

And also you need the long name interpreter instead of its abbreviation.

like image 72
Hugo Avatar answered Nov 21 '25 16:11

Hugo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!