Re: Change FontName in Mtex?

109 views
Skip to first unread message

Ralf Hielscher

unread,
Apr 24, 2013, 10:49:02 AM4/24/13
to mtex...@googlegroups.com
Hi Rongpei Shi,

you can change the font by the option fontname, i.,e.,

annotate(xvector,'label','x','fontname','times')

However, this seems not to work with LaTeX formated text, i.e. formulas. Whether LaTeX is used is given by the option interpreter. So this should work in any case

annotate(xvector,'label','x','interpreter','tex','fontname','times')

The default interpreter to be used by MTEX can be set by

setMTEXpref('textInterpreter','tex')

But setting this to Tex and not LaTeX does not allow to write (11-20) with bar over the 2 instead of minus.

A list of available fontnames gives the command

listfonts

I hope I could help you.

Ralf.

Rongpei Shi

unread,
Apr 24, 2013, 5:56:18 PM4/24/13
to mtex...@googlegroups.com
Hi Ralf:

Many thanks for your quick reply!!

I am just wondering why one can not change Fontname if Latex interpreter is used?

why "However, this seems not to work with LaTeX formated text, i.e. formulas."

I am going to customize, say,'label', to be ' (01\bar{1}) 'and change its font to be "Times New Roman"

What do i need to do?

Thanks!!

Rongpei

Ralf Hielscher

unread,
Apr 24, 2013, 6:14:09 PM4/24/13
to mtex...@googlegroups.com
This seems to be a restriction of MATLAB. Just try

text(1,1,'$10\bar{1}$','interpreter','LaTeX','FontName','Time New Roman')

and at least on my system the last option is not respected.

Ralf.
Reply all
Reply to author
Forward
0 new messages