Set title in two lines with different font sizes with interpreter latex

14 次查看(过去 30 天)
It is possible to set title in two lines with different font sizes with interpreter latex?
i found an answer how to do that BUT with interpreter tex. for example:
title(['\fontsize{20} Thermometer output signal' char(10) ...
'\fontsize{10} Look small' char(10) ...
'\fontsize{20} Mixed_{\fontsize{8} underscore}'],'interpreter','tex');
this is mine without different font sizes:
TT=title({'$Thermometer\quad output\quad signal$','$EXP02$'},'FontWeight','bold',...
'Interpreter','latex');
thanks

采纳的回答

Jan
Jan 2019-1-30
编辑:Jan 2019-1-30
title(['\fontsize{12}{0}\selectfont$Large$', char(10), ...
'\fontsize{8}{0}\selectfont$small$'], ...
'interpreter','latex');
  5 个评论
jose herrero
jose herrero 2022-5-9
very useful Jan, thanks! For me (2019b) it works better using num2str.
Using 'sprintf', it adds some extra characters (e.g, 'Font').
Quick questions: is it also possible to have all in 1 single line (instead of 2) but with different fonts? where do you select the font type in your function?
Str=10;Vtr=20;Btr=30;
charnow = ['Trials (aS=' num2str(Str) ',aV=' num2str(Vtr) ',aB=' num2str(Btr) ')'];
title(['\fontsize{12}{0}\selectfont$ITPC @ Visfreq$', char(10), ...
'\fontsize{8}{0}\selectfont$', charnow, '$'], ...
'interpreter','latex');
Jan
Jan 2022-5-10
@jose herrero: Simply try it. Omit the char(10) and all appears in 1 line. Omit other parts as "\selectfont$small$" and see, what happens. You cannot damage anything so feel free to experiment.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Title 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by