# Is there maximum number of characters of the figure title latex interpreter string?

5 views (last 30 days)

Show older comments

Dear all,

I would like to write a multiline title using the latex interpreter.

I understand there is a limit of 1200 characters (minus roughly 10 characters for each line breaking).

I tried the following code but the interpreter fails.

title({[sprintf('$\\psi$ = %.0f$^\\circ$, $\\theta$ = %.0f$^\\circ$', rotationAngle,rad2deg(thetaIncidence)) newline ...

sprintf('$n_{Exp}$=%.2E, $vc_{Exp}$=%.2E', beta(1), beta(2)) sprintf('$\\sigma_n$=%.2E, $\\sigma_v_c$=%.2E', errBeta(1), errBeta(2))]},'Interpreter','latex')

Any idea?

Many thanks in advance

### Accepted Answer

madhan ravi
on 12 Jul 2020

Painful but manageable ;)

first = sprintf('$$\\psi = %.0f^{\\circ}$$', rotationAngle);

second = sprintf('$$\\theta = %.0f^{\\circ}$$', rad2deg(thetaIncidence));

third = sprintf('$$n_{Exp} = %.2E$$', beta(1) );

fourth = sprintf('$$vc_{Exp} = %.2E$$', beta(2));

fifth = sprintf('$$\\sigma_n = %.2E$$', errBeta(1));

sixth = sprintf('$$\\sigma_{v_{c}} = %.2E$$', errBeta(2));

title({first, second,third,fourth,fifth,sixth},'Interpreter','latex')

##### 8 Comments

Walter Roberson
on 13 Jul 2020

### More Answers (1)

dpb
on 11 Jul 2020

First, you must pass a char() string, not cellstr. You've got too many $ signs for pieces, but a start at what outlined above using

tstr=[sprintf('$\\psi = %.0f^\\circ$', rotationAngle)];

title(tstr)

does work...just keep adding pieces one at a time.

##### 2 Comments

dpb
on 12 Jul 2020

### See Also

### Community Treasure Hunt

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

Start Hunting!