f

#### change text color with TeX support?

All

Consider the string involving greek letters to appear in a
plot title made with the command:

SetaEL='\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='

when used in a title argument, the string SetaEL plots like:

etaEL=

except that eta will be the actual greek letter of course.

This works! BUT THE COLOR ID DEFAULT IS BLACK.

THE QUESTION:

How to change my SetaEL command useing TeX syntax, so it is say red?


 0
kalinoaj (14)
3/16/2005 8:30:29 PM
comp.soft-sys.matlab 211266 articles. 22 followers. lunamoonmoon (257) is leader.

6 Replies
909 Views

Similar Articles

[PageSpeed] 45

Could you be a little more specific?  If you want the whole title to be
in red (or any other color), I don't think you need to do anything with
TeX.  Just add an argument to the title command specifying the color:

title(SetaEL,'Color','red')

This worked fine for me.  If you want just the eta to be in red, I'm
not sure how that would work.  I'd check comp.text.tex for help on what
control sequence does that.


 0
duke_tg (6)
3/16/2005 9:48:45 PM
In article <eeff37a.-1@webx.raydaftYaTP>,
"tony kalin" <kalinoaj@aol.com> wrote:

> All
>
> Consider the string involving greek letters to appear in a
> plot title made with the command:
>
> SetaEL='\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='
>
> when used in a title argument, the string SetaEL plots like:
>
>             etaEL=
>
>   except that eta will be the actual greek letter of course.
>
> This works! BUT THE COLOR ID DEFAULT IS BLACK.
>
> THE QUESTION:
>
> How to change my SetaEL command useing TeX syntax, so it is say red?
>

If you set the 'Interpreter' property to 'latex' AND if the built-in
LaTeX capability includes the color package then you could do

SetaEL='\color{red}\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='

to get all the text in red or

SetaEL='{\color{red}\fontsize{14}{\eta}}\fontsize{10}EL\fontsize{10}='

to make just the eta in red, etc.

BUT, I don't know if the color package is included and I don't have
version 7; you will have to try it yourself.  That, at least, is how one
would do it in LaTeX.

If that doesn't work, you might find my Styled Text Toolbox useful as it
definitely does have the capability you seek.  It is free and can be

<http://www.frontiernet.net/~dmschwarz/stextfun>

but I have never tested it with MATLAB 7 (or very much with MATLAB 6.5
for that matter).

The syntax is a little different from LaTeX so to create the string you
want you could use the stext function:

stext(x,y,'{\red\14\eta}\10EL=')

I hope this helps.

--
Doug Schwarz
Make obvious changes to get real email address.

 0
see9548 (1248)
3/16/2005 10:56:17 PM
dear duketg:

Thanks for the response. My string will be part of a bigger string
as you suspected, where i do not want to change the color of the
second part.

I previously tried something like you suggest and as you said, it
makes the whole string red.

That is why i want to go the TeX route, and am ging to try what the
second response sussested next.

duketg wrote:
>
>
> Could you be a little more specific? If you want the whole title
> to be
> in red (or any other color), I don't think you need to do anything
> with
> TeX. Just add an argument to the title command specifying the
> color:
>
> title(SetaEL,'Color','red')
>
> This worked fine for me. If you want just the eta to be in red,
> I'm
> not sure how that would work. I'd check comp.text.tex for help on
> what
> control sequence does that.
>
>

 0
kalinoaj (14)
3/17/2005 1:00:40 AM
Doug Schwarz wrote:
>
>
> In article <eeff37a.-1@webx.raydaftYaTP>,
> "tony kalin" <kalinoaj@aol.com> wrote:
>
>> All
>>
>> Consider the string involving greek letters to appear in a
>> plot title made with the command:
>>
>> SetaEL='\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='
>>
>> when used in a title argument, the string SetaEL plots like:
>>
>> etaEL=
>>
>> except that eta will be the actual greek letter of course.
>>
>> This works! BUT THE COLOR ID DEFAULT IS BLACK.
>>
>> THE QUESTION:
>>
>> How to change my SetaEL command useing TeX syntax, so it is say
> red?
>>
>
>
> If you set the 'Interpreter' property to 'latex' AND if the
> built-in
> LaTeX capability includes the color package then you could do
>
>
SetaEL='\color{red}\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='
>
>
> to get all the text in red or
>
>
SetaEL='{\color{red}\fontsize{14}{\eta}}\fontsize{10}EL\fontsize{10}
> ='
>
> to make just the eta in red, etc.
>
> BUT, I don't know if the color package is included and I don't have
>
> version 7; you will have to try it yourself. That, at least, is
> how one
> would do it in LaTeX.
>
> If that doesn't work, you might find my Styled Text Toolbox useful
> as it
> definitely does have the capability you seek. It is free and can
> be
>
> <http://www.frontiernet.net/~dmschwarz/stextfun>
>
> but I have never tested it with MATLAB 7 (or very much with MATLAB
> 6.5
> for that matter).
>
> The syntax is a little different from LaTeX so to create the string
> you
> want you could use the stext function:
>
> stext(x,y,'{\red\14\eta}\10EL=')
>
> I hope this helps.
>
> --
> Doug Schwarz
> Make obvious changes to get real email address.
>

 0
kalinoaj (14)
3/17/2005 11:47:26 PM
Doug:

The
SetaEL='\color{red}\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='
suggestion did not work...i think matlab is not supporting this
option you suggested.

------

time. Not sure howmany of the other .m files in your toolbox would be
needed beside your stext( ) routine (stext calls other routines..not

Thanks again for your effort doug...tony

Doug Schwarz wrote:
>
>
> In article <eeff37a.-1@webx.raydaftYaTP>,
> "tony kalin" <kalinoaj@aol.com> wrote:
>
>> All
>>
>> Consider the string involving greek letters to appear in a
>> plot title made with the command:
>>
>> SetaEL='\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='
>>
>> when used in a title argument, the string SetaEL plots like:
>>
>> etaEL=
>>
>> except that eta will be the actual greek letter of course.
>>
>> This works! BUT THE COLOR ID DEFAULT IS BLACK.
>>
>> THE QUESTION:
>>
>> How to change my SetaEL command useing TeX syntax, so it is say
> red?
>>
>
>
> If you set the 'Interpreter' property to 'latex' AND if the
> built-in
> LaTeX capability includes the color package then you could do
>
>
SetaEL='\color{red}\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='
>
>
> to get all the text in red or
>
>
SetaEL='{\color{red}\fontsize{14}{\eta}}\fontsize{10}EL\fontsize{10}
> ='
>
> to make just the eta in red, etc.
>
> BUT, I don't know if the color package is included and I don't have
>
> version 7; you will have to try it yourself. That, at least, is
> how one
> would do it in LaTeX.
>
> If that doesn't work, you might find my Styled Text Toolbox useful
> as it
> definitely does have the capability you seek. It is free and can
> be
>
> <http://www.frontiernet.net/~dmschwarz/stextfun>
>
> but I have never tested it with MATLAB 7 (or very much with MATLAB
> 6.5
> for that matter).
>
> The syntax is a little different from LaTeX so to create the string
> you
> want you could use the stext function:
>
> stext(x,y,'{\red\14\eta}\10EL=')
>
> I hope this helps.
>
> --
> Doug Schwarz
> Make obvious changes to get real email address.
>

 0
kalinoaj (14)
3/17/2005 11:53:44 PM
In article <eeff37a.4@webx.raydaftYaTP>,
"tony kalin" <kalinoaj@aol.com> wrote:

> Doug:
>
> Thanks for the complete reply.
> The
> SetaEL='\color{red}\fontsize{14}{\eta}\fontsize{10}EL\fontsize{10}='
> suggestion did not work...i think matlab is not supporting this
> option you suggested.
>
> ------
>
> I started to down load your other suggestion regarding using your
> time. Not sure howmany of the other .m files in your toolbox would be
> needed beside your stext( ) routine (stext calls other routines..not
>
> Thanks again for your effort doug...tony

Tony,

Sorry, I should have mentioned that you can get them as a zip file:

<http://www.frontiernet.net/~dmschwarz/stextfun/stextfun.zip>

One of these days I'll put a link to the zip file on that page.

Sorry for the oversight.

--
Doug Schwarz