MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Distinguishing Strings from Symbols


Hi,
You can apply the function InputForm for your result like in the example below
{x,"x"} //InputForm

You also can change the value of option ShowStringCharacters
for Output cells in style definitions.

To change the style of strings you can use the following command
although I am not sure that this is a best solution :
 $PrePrint = (# /. str_String :> Style[str, Red]) &

2007/9/13, dr DanW <dmaxwarren at gmail.com>:
> I have several notebooks where I am using short strings that might be
> the same as the name of a symbol; for example, "x".  When these
> strings show up as output, I cannot tell if I am looking at a string
> "x" or a symbol x.  Is there a way I can define a Format or alter
> OutputForm so strings in output always have a different look than
> symbols, such as appearing in red or in italics?
>
>
>


-- 
Sincerely,
Yuri Kandrashkin, PhD
http://spinalgebra.com - Mathematica based applications:
- Magnetic Resonance with SpinAlgebra
- Work with systems of Units
- Interactive tools: ViewPoint selector, Options explorer, etc


  • Prev by Date: Re: rationalize numerator of quotient
  • Next by Date: Re: How to make delayed functions from text info
  • Previous by thread: Distinguishing Strings from Symbols
  • Next by thread: Re: Distinguishing Strings from Symbols