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

6 vues (au cours des 30 derniers jours)
Netanel shachak
Netanel shachak le 29 Jan 2019
Commenté : Jan le 10 Mai 2022
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

Réponse acceptée

Jan
Jan le 30 Jan 2019
Modifié(e) : Jan le 30 Jan 2019
title(['\fontsize{12}{0}\selectfont$Large$', char(10), ...
'\fontsize{8}{0}\selectfont$small$'], ...
'interpreter','latex');
  5 commentaires
jose herrero
jose herrero le 9 Mai 2022
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 le 10 Mai 2022
@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.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by