MathGroup Archive 2006

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

Search the Archive

Re: Using a text editor like interface for Mathematica?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64487] Re: Using a text editor like interface for Mathematica?
  • From: albert <awnl at arcor.de>
  • Date: Sun, 19 Feb 2006 05:35:55 -0500 (EST)
  • References: <dsru9v$5ee$1@smc.vnet.net><200602160805.DAA29821@smc.vnet.net> <dt48ab$2j7$1@smc.vnet.net> <dt6kr0$ni7$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

>> An option to avoid the tab issue is to use InputForm instead of
>> StandardForm.
> 
> I don't know how this works.  There seemed to be a function that would
> convert between what's shown in Mathematica and how I would type it (good
> for importing to a text file or if I was using the command line kernel
> input), but I don't see (or can't find) any way to get Mathematica to
> allow me to do my own formatting.
> 
> Am I missing something here?  Changing from one format to another
> doesn't seem to be what I'm looking for.

It is, see the following.
 
> Here's my challenge:  tell me of a way that I can get Mathematica to allow
> me to tab whenever I want, regardless of whether Mathematica thinks it's
> appropriate.   This kind of restricted behaviour I'm currently
> experiencing is what I expect from MS Word, not from a programming
> environment.  I know it sounds like I'm complaining about something
> trivial, but the ability to format easily leads to readable code, which
> leads to productive work.
> 
> Try this:  Start a new notebook.  Type a single letter.  Then try to
> tab.
> 
> Result:  Nothing happens.

Try this: Start a new notebook. Type a single letter. Select the new cell
(by clicking on the CellBracket). From the menu, 
select Cell-> Convert To -> InputForm
now tabs should work as you expect. Of course you can use InputForm as the
default for all Cells of type Input. For this the best way is probably to
use an own StyleSheet: Just make a copy of the Default-Stylesheet and set
the option DefaultFormatType to InputFormat for Input-Cells, you might use
the Option-Inspector to do so. Use that as your StyleSheet for programming
and you are free to tab as you like. Be aware that you will not have the
possibility to use 2D-Formulas within these cells, but that you couldn't
have with a regular editor anyway...

>> > Oh, and the ability to use underscores in naming would've been nice.
> 
>> While underscores are not available, you can use things like
>> \ [UnderBracket] (alias esc u [ esc), \[UnderBrace] (alias esc u { esc),
>> etc.
> 
> I wasn't aware of the underscore option.  It's a little awkward to type
> and looks awful, but I guess I'll take what I can get.  Maybe I can map
> one of my function keys to do this.  I appreciate it.

I use bullets for that purpose. Looks nice enough for me and is easier o
type: esc b u esc -> \[Bullet]. There are many other "characters" that you
can use, check File -> Palettes -> Complete Characters and choose something
that you like (make sure that the character you chose does not have a
special meaning...).

One more remark: In my opinion the standard formatting of code that
mathematica does with StandardForm works really good and results in
readable code, _if_ I insert linebreaks at appropriate places and use
shortcuts only in short expressions. Doing so, I have never felt that I
would need tabbing to format my code...

hth,

Albert


  • Prev by Date: Re: Re: Using a text editor like interface for Mathematica?
  • Next by Date: Re: Beginner--Using subscripts in vectors
  • Previous by thread: Re: Re: Using a text editor like interface for Mathematica?
  • Next by thread: Re: Using a text editor like interface for Mathematica?