Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How can I change the space between multiline title ?

Subject: How can I change the space between multiline title ?

From: Will Fonseca

Date: 22 Jan, 2013 17:25:09

Message: 1 of 4

Hi,

I have the following title:

    h = title({'Frequency vs. Beampattern - GA Array ' ; 'Plane Wave on Cylinder (Free-Field) - \phi_{in}=90^{\circ}'},...
    'FontWeight','bold',...
    'FontSize',11,...
    'FontName','Palatino Linotype');

However, the lines are too close, hence I need some extra line spacing.

Does anyone know how to do it ?

Thanks,

Will

Subject: How can I change the space between multiline title ?

From: Doug Schwarz

Date: 22 Jan, 2013 18:12:44

Message: 2 of 4

In article <kdmi1l$kn9$1@newscl01ah.mathworks.com>,
 "Will Fonseca" <willdfonseca@yahoo.com.br> wrote:

> Hi,
>
> I have the following title:
>
> h = title({'Frequency vs. Beampattern - GA Array ' ; 'Plane Wave on
> Cylinder (Free-Field) - \phi_{in}=90^{\circ}'},...
> 'FontWeight','bold',...
> 'FontSize',11,...
> 'FontName','Palatino Linotype');
>
> However, the lines are too close, hence I need some extra line spacing.
>
> Does anyone know how to do it ?
>
> Thanks,
>
> Will

You can make a line of text taller than it normally would be by
inserting a large, zero-width character. To do that, append this string
onto whichever line you want to be taller:

  tall_str = sprintf('\\fontsize{20}\b');

where you can use any font size you'd like. Essentially what this does
is append a backspace character (ASCII 8), which has no width, to your
string.

I tested this on a Mac, not sure if it'll work elsewhere.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: How can I change the space between multiline title ?

From: Will Fonseca

Date: 22 Jan, 2013 19:22:10

Message: 3 of 4

Doug,

Thanks for the reply !
Problem solved !

So, for windows the complete solution is:

tall_str = sprintf(['\\fontsize{14}' blanks(1) '\\fontsize{11}']);
h = title({'Frequency vs. Beampattern - GA Array ' ;...
          [tall_str 'Plane Wave on Cylinder (Diffraction+Free-Field) - \phi_{in}=90^{\circ}']},...
    'FontWeight','bold',...
    'FontSize',11,...
    'FontName','Palatino Linotype');


Cheers,

Will

Subject: How can I change the space between multiline title ?

From: Doug Schwarz

Date: 23 Jan, 2013 02:26:08

Message: 4 of 4

In article <kdmot1$go1$1@newscl01ah.mathworks.com>,
 "Will Fonseca" <willdfonseca@yahoo.com.br> wrote:

> Doug,
>
> Thanks for the reply !
> Problem solved !
>
> So, for windows the complete solution is:
>
> tall_str = sprintf(['\\fontsize{14}' blanks(1) '\\fontsize{11}']);
> h = title({'Frequency vs. Beampattern - GA Array ' ;...
> [tall_str 'Plane Wave on Cylinder (Diffraction+Free-Field) -
> \phi_{in}=90^{\circ}']},...
> 'FontWeight','bold',...
> 'FontSize',11,...
> 'FontName','Palatino Linotype');
>
>
> Cheers,
>
> Will

Will,

I just got a chance to try it on Windows. A slightly better solution is
to use

  tall_str = sprintf('{\\fontsize{14}\x81}');

The braces cause the new font size to be temporary so you don't have to
set it back to 11. The character \x81 = hex 81 = decimal 129 seems to
have no width and prints nothing.

I suppose it's possible that a different font (I used the default) could
cause something to print, but I can't try them all. ;-(

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us