Code covered by the BSD License  

Highlights from
RM2SF Change the typeface of non-math text to sans-serif

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 2.03 KB File ID: #29084
image thumbnail

RM2SF Change the typeface of non-math text to sans-serif

by Mukhtar Ullah

 

19 Oct 2010 (Updated 01 Sep 2011)

Changes the typeface of non-math text with latex interpreter from roman to sans-serif.

| Watch this File

File Information
Description

RM2SF changes the typeface of non-math text with latex interpreter from
 roman (serif) to sans-serif. This is needed because the latex interpreter
 typesets both math and text in roman irrespective of the font
 specification. Therefore RM2SF places each non-math part of the text
 inside \textsf{}.

 RM2SF replaces, by \textsf{STR}, each non-math part STR of all text
 objects in the current figure whose interpreter is set to latex.

 RM2SF(FIG) applies to text objects in figure with handle FIG.

 RM2SF(AX) applies to text objects in axes with handle AX.

 RM2SF(TX) applies to text objects with handles specified in vector TX.

Example:

tx(1) = text(0.2,0.8, 'square of \$x\$ is $x^2$');
tx(2) = text(0.3,0.6, {'sine of $\theta$'; 'is $\sin \theta$'});
tx(3) = text(0.2,0.4, 'cube of $x$ is $x^3$');
tx(4) = xlabel('time $t$ here');
tx(5) = ylabel('concentration {\it C(t)} here', 'FontSize', 20);
set(tx(1:4), 'FontSize', 20 , 'Interpreter', 'latex')
rm2sf(tx([1 2 4]))

MATLAB release MATLAB 7.11 (2010b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
19 Oct 2010

Corrected a typo in description and help.

19 Oct 2010

Fixed a few minor issues and redundancies.

20 Oct 2010

Cleanup

20 Oct 2010

Updated the title

21 Oct 2010

Corrected a typo in the description.

01 Sep 2011

Now it should work for multiline texts also.

Tag Activity for this File
Tag Applied By Date/Time
text latex roman sansserif Mukhtar Ullah 19 Oct 2010 16:19:28
rm2sf text latex roman sansserif Mukhtar Ullah 20 Oct 2010 11:08:11

Contact us at files@mathworks.com