MathGroup Archive 2008

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

Search the Archive

Re: Workbench editing snag

  • To: mathgroup at
  • Subject: [mg89724] Re: Workbench editing snag
  • From: twj at
  • Date: Thu, 19 Jun 2008 05:41:55 -0400 (EDT)
  • References: <g35fvs$9b7$> <g37f50$q15$>

On Jun 17, 5:38 am, Albert Retey <a... at> wrote:
> Hi,
> > Please forgive the trivial question
> > coming from a newcomer.
> > I have Mathematica 6.0 and Mathematica
> > Workbench 1.0 running on a PC (Windows XP)
> > in my school's lab.
> > When trying to edit a .NB file from within
> > Workbench (Navigator panel)
> > - with Default editor -
> > I get it opened in Mathematica, instead
> > - with In-Place Editor -
> > I get it opened in Workbench but I can't
> > edit any way. Even writing in it isn't
> > allowed.
> > Please can you explain and/or point out
> > a way to fix it up ?
> There is none. Workbench is all about writing packages, that is *.m
> files, so an inline editor is only available for these, notebook files
> (*.nb) will always be opened with Mathematica (or in an unreadable form
> in a regular inline text-editor).
> Of course it would be nice if you could use all the advantages of the
> workbench when working with notebooks, too, but this would be much more
> effort to implement than for the *.m files and has not been done AFAIK.
> hth,

The Workbench provides a number of different editors for different
types of files.  By default for a .m file or a .mt test file it
will use a Mathematica source editor,  for a .nb file it will use
the Mathematica notebook frontend.

It has other editors,  if you open Java code this opens
in a Java editor, if you have the webMathematica tools installed
then web material such as HTML files open in an HTML editor or
XML files open in an XML editor. If you have the C/C++ tools
installed you get editors for these.

The Workbench can also use the OS to choose an external editor.

Of course,  you might want to open a file with an editor that
is not the default. For example you might want to open HTML in
a browser.  The workbench provides a way to register different
different editors for different files.

To open notebook files in the source editor you can right-click
on the document in a file browse view such as the Package Explorer,
select Open With, and choose the source editor.  Note that this
needs Workbench 1.1 (released summer 2007).

This will show you the underlying Mathematica expressions that
make up the notebook. Typically, of course you want to see what
the expressions represent and the frontend does this.  But, there
are reasons for opening the raw source with the source editor.

Since this is a source editor you get all the features like
syntax coloring, error reporting, navigation through the
expression tree,  etc...,  so this is a great way to find
and then fix errors.  You can use the advanced pattern
search/replace to make modifications to the notebook.
When you make modifications there is an extensive undo,
and you can restore files you have modified from the local
history cache.  You also get a special outline view of the
notebook.  Note that these are only a few of the features
the source editor provides.

This may not be what you need,  but some people do want to work
in the notebook source and this is a strong way to do so.  The
latest Workbench has a very useful feature, that uses the
'Show In' feature.  With this you make a fix to the internals
of the notebook, and then see that location in the frontend,
a good way to see the consequences of your changes.

The 'In-Place Editor' that was first brought up in the question
I think only shows up on Windows. It tries to use the frontend
as an OLE object which does not work.  I'll see about disabling
this choice.  If you open the file with this editor,  then you
can close it and choose a different editor.

Tom Wickham-Jones
Wolfram Research

  • Prev by Date: Re: Making nice-looking Legend for Plot
  • Next by Date: Re: Problems with FindRoot and recursive functions
  • Previous by thread: Re: Workbench editing snag
  • Next by thread: Problems with FindRoot and recursive functions