Borrar filtros
Borrar filtros

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

14 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Jan
Jan el 30 de En. de 2019
Editada: Jan el 30 de En. de 2019
title(['\fontsize{12}{0}\selectfont$Large$', char(10), ...
'\fontsize{8}{0}\selectfont$small$'], ...
'interpreter','latex');
  5 comentarios
jose herrero
jose herrero el 9 de Mayo de 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 el 10 de Mayo de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by