19

I use Mathematica (Home Edition) to manage notes which live in a large number of different notebooks. In my case the notebooks (hundreds) are just organized using document names and file system folders (topic based or date based).

My most dreamed of Mathematica feature is some kind of multi-document interface. Ideal would be a Google Chrome -like interface. Each notebook is in a tab, tabs can be dragged between windows, switched between & opened & closed using keyboard shortcuts, etc. You would have menu a of recently opened/closed notebooks, and a customizable bookmark bar that would let you open a new or existing notebook in the current tab or in a new tab.

As we all know, such features do not exist yet back here on the real world.

Are there existing features of Mathematica, or parts of the Wolfram Language, that are useful for managing multiple notebooks?

The official docs have "Documents & Presentation" and "User Interface Construction", but both sections are rather sizeable. It would be good to know if anything hiding in there would be especially useful here.

(If anyone at WR is reading this, I hope you will consider adding some form of browser-like multi-document interface to Mathematica.)

billc
  • 684
  • 5
  • 16
  • 2
    I too support @billc's request. If Wolfram implements this, be sure to keep variable and function definitions separate in the document windows, so that the change of a variable or function in one window doesn't affect the others. – David G. Stork May 06 '16 at 20:48
  • 1
    I'm voting to close this question as off-topic because I believe the question is too vague and too broad – m_goldberg May 06 '16 at 21:40
  • 1
    I have no objection to closing it (here) ... as I originally posted it on the meta board. I think user J. M. migrated it over here. Perhaps it should be migrated back? – billc May 06 '16 at 21:42
  • 1
    No, meta is for questions about the site itself. The question belongs here, if anywhere. – Simon Woods May 06 '16 at 21:48
  • 1
    Perhaps if the question were adjusted to ask what features of Mathematica can be used to manage multiple notebooks, it might be a better fit. As currently written it sounds like you need advice from an OSX expert more than a Mathematica one. – Simon Woods May 06 '16 at 21:52
  • Alternatively you could ask in [chat] or over on the Wolfram Community which has a broader scope. – Simon Woods May 06 '16 at 21:56
  • I'm happy to move it over there later, if folks decide to close it here. It does feel (to me) closer to some of the threads I see on meta, as compared to those that belong here. – billc May 06 '16 at 22:19
  • I've been working on and off on the next gen. Mathematica IDE written entirely in Mathematica and using its FE, for the last 4 years. It has had a tabbed interface of the type you describe (but no tab drag or hot key-based switching support yet) for the last 2 years, and I regularly use it in my work. I am hesitant to recommend it yet, because it is somewhat buggy, awaiting massive rewrite, works so far only on OS X, and is missing features. But if you just need window manager with tabs in Mathematica, it may work for you. I could make it an answer offering it as is, for now. – Leonid Shifrin May 06 '16 at 22:21
  • Actually, re-reading Simon Woods comment, I'm going to edit it some. – billc May 06 '16 at 22:21
  • Leonid Shifrin ... if you wanted to put it up on github, I'm sure many people, myself among them would at least find it instructive. Plus, massive rewrites never happen. If you put it on github, perhaps people will send you patches! – billc May 06 '16 at 22:32
  • @billc It's not ready for github and pull requests precisely because it has the wrong architecture. Massive rewrites do happen. But, it works for what it has now, and I use it daily for managing notebooks for my work. So, rather than wait for some unspecified period of time, I can share it so that it can probably be used by others, with the understanding that it is as is. Once I rewrite it with a new architecture, hopefully it will start to be developed normally, using github and all the associated practices of collaborative development. – Leonid Shifrin May 06 '16 at 22:43
  • That's the idea of the cloud version of mathematica being developed, to have the front end running in a browser and co-editable. Already there's a competing system for languages like R, python: jupyter.org – alancalvitti May 06 '16 at 22:52
  • Sounds good. @LeonidShifrin – Look forward to poking at it, if you get around to posting it somewhere. – billc May 06 '16 at 22:52

1 Answers1

22

Disclaimer

Ok, so first comes the warning: what I offer below is an incomplete and work-in-progress code, which I offer AS IS. It only works on OS X for now, has a number of bugs, features are missing, etc, etc.

In the last couple of years, I've asked a few members of this community to test MIDE privately, and got very constructive responses plus a number of bugs were reported. Still, I don't consider it ready for general public use, so use it only if you feel adventurous.

The only reason I post it now is that it seems to directly answer the question asked, and even in the current form, may be useful to some people. It is certainly very useful for me personally, in my current work, to the extent that I can't think of not using it for everything I do in Mathematica. So better make it available now, than wait for unspecified period of time until it is all ready and shining.

MIDE

What it is supposed to become

MIDE is the name I chose for the Mathematica IDE I've been working on, for quite some time now (several years), as a personal project.

My plan has been, and still is, to convert it to a modular next generation IDE for Mathematica / WL / multi-language development (Mathematica / Java / C / etc., but of course with Mathematica being a central part of it), with a proper extensibility model, so that it is developed collaboratively, and plugins for it could be written by the community.

My vision for it, why I think it can be useful, and what problems it might be able to solve, I expressed in more detail in MIDE's manual, which is a separate notebook that comes with MIDE.nb (more on it below).

What it is now

Right now it basically is a tab manager, that allows one to have split the screen in 2 parts and have notebooks as tabs on both.

Also, it has what I call "Development mode", where one can use improved code navigation facilities, and a very rudimentary support for workspaces.

Even in this very reduced capacity, it has been very useful for me personally, and I do all my active development work using it.

It only works so far on Mac OS X (untested on Windows, last time I tried, it needs certain UI adjustments).

Here are a few screenshots (which are about a year and a half old, but not much changed in appearance since)

enter image description here

enter image description here

enter image description here

enter image description here

More details are in the manual, which is a separate notebook and is loaded by MIDE automatically

Download and use

  • You can download the notebook with MIDE's code, and the manual notebook, by using this link:

    MIDE download link

  • Put both notebooks in the same directory

  • The following steps you will need to do only once

    • Configure the new kernel called "Background" (via menu Evaluation -> Kernel configuration options -> Add), and that one will power the ide.

    • Open MIDE.nb in Mathematica and select it (make currently active notebook)

    • Go to the menu Evaluation -> Notebook's Kernel, and set it to Background

    • Save Mide.nb

  • Evaluate Mide.nb (from menu Evalaution -> Evaluate initialization cells)

  • Follow the startup procedure:

    • It will ask you to choose the workspace, it doesn't really matter which you choose (there are 3 available) - there isn't a full workspace support yet anyway.

    • It will ask you to load its own source into "dev. mode". This is just for illustration purposes, and will take some additional time if you choose this option. But it will give you some good idea about what dev.mode can do.

    • It will open the manual in dev mode. Dev. mode panel is on the toolbar on the left.

  • You can read the manual to see what this is all about and how to use it. Note that in dev. mode, you click on cell names to expand the cells (or you can do that from the left panel too)

Important notes

  • If you want to close the notebook which is one of the tabs, don't use the notebook window's own x button for that, since it will bring MIDE to an invalid state. Instead, select the appropriate tab and press the x button (red) on the corresponding tab panel.

  • When you press the x button to close selected tab, the notebook will be closed without being saved. This is something I plan to change, but it is good to be aware of that in the mean time.

  • When you save a notebook under a different name, the tab panel will generally lose responsiveness, until you press the "Refresh all tabs" button on the tab panel.

  • The same typically happens if you "dock" some notebook from Help to be one of the tabs, and then go do a different doc page in the same doc notebook. You have then to press the "Refresh all tabs" button on the tab panel, and then click on the changed tab, to make it again responsive.

  • The manual is somewhat dated in that is states that there is no exit button, while there actually is one, with the icon of a running man, on both tab panels. When you press it, MIDE will exit, but will save the information about which notebooks were open, in the current workspace. If you reload it again with the same workspace, it will load those notebooks again. NOTE: when it exits, it will close all tabs without saving them or prompting you to do so, so it is best to first manually save all those that need to be saved, to avoid losing work.

Having that said, I've got used to all these quirks and they don't bother me any more, although of course most of them are bugs to be fixed at some point.

Bug reports and suggestions

More than welcome in any case. As I mentioned, I've been working on rewriting MIDE, adding more features, etc. However, having more opinions on current limitations and bugs will help.

I must warn however, that I won't be able to quickly address the bugs, partly because I have very little time to work on MIDE at the moment, partly because this version is not supposed to be the final version, so I don't want to waste efforts on something that will anyway be heavily rewritten and transformed.

That said, making the current version work under Windows is probably not much work, and I may consider doing that if there is enough interest expressed by the community.

Collaboration and future development

I am not opening this for collaboration at this time, because the current version has the wrong architecture, and I plan on rewriting the core of it on my own. Once the core is ready, I plan to put this on Github and make this a normal collaborative project. Hopefully this will happen some time soon.

There are a number of features I plan for it, but I won't list them now, because it's a bit too far away. Once the core is ready, and the project is on Github, I will add a planned list of features.

License

You can treat this code as being MIT - licensed.

Leonid Shifrin
  • 114,335
  • 15
  • 329
  • 420
  • thanks for posting this @LeonidShifrin. I look forward to playing around with it this weekend! – billc May 06 '16 at 23:54
  • @billc Hope you will find it useful. – Leonid Shifrin May 06 '16 at 23:56
  • 1
    I'm kinda disappointed this doesn't work on Windows :( – RunnyKine May 07 '16 at 00:18
  • @RunnyKine it probably isn't very hard to tweak it to work on Windows, but I didn't have the time to do that. You can try running it on Windows, I just think the result would be rather ugly. One would need to adjust window sizes and such things. I will do that eventually, but no time right now. – Leonid Shifrin May 07 '16 at 00:34
  • How tough do you think it would be to modularize the notebook? I think if the it could be converted to some form of collection of packages and palettes inside a paclet it might help it be more extensible. – b3m2a1 Aug 29 '17 at 21:47
  • @b3m2a1 If you mean MIDE source, I had a different plan in mind. Rather than having a collection of palettes (which, when being extended, will only produce mess IMO), I planned a rewrite where there will be a very small core, and everything else will be plugins, using some plugin architecture model (like Eclipse, Atom, IntelliJ etc. have), and object orientation. But while I use MIDE daily and heavily at work (mostly as a window manager, sometimes also in dev. mode), I have zero time to continue this work at the moment, and it isn't clear when this situation changes. – Leonid Shifrin Aug 29 '17 at 21:55
  • 1
    @b3m2a1 In some way also, I don't want to modularize the notebook (MIDE source code), in a normal sense, because I want to see how far I can go with what I call "notebook-based project", where basically different modules are just sections and subsections of the notebook - and what tools will be necessary to keep the project manageable. For example, I was playing with custom loaders, which assign namespaces at run-time so that one doesn't need to do that explicitly. There can be other ways to achieve modularization effect. – Leonid Shifrin Aug 29 '17 at 22:00
  • Interesting thought. I do like the idea of a single development notebook, but in past experience it's gotten a little bit too slow and unwieldy to be fully workable for me. Hopefully WRI goes on a hiring spree to free people like you up to work on things like this :) – b3m2a1 Aug 29 '17 at 22:06
  • 1
    @b3m2a1 I wouldn't want to work on a project like this as a part of my WRI assignments. The project like this should be free and open source, and I don't want someone from the company to dictate me what to do here. Re: single development notebook - MIDE is currently about 5000 loc, and is a single-dev notebook. It actually gives you an option to load its own source as an example of its workings, at startup. And I have a bunch of ideas of how to scale that up to larger volumes of code. – Leonid Shifrin Aug 29 '17 at 22:11
  • I tended to hit load time issues when evaluating the definitions in cells. I was also up in the many thousands of loc, but I think the issue was the number of cells I was using. Each cell evaluation added some FE overhead and so I think I had a hundred or some such cells and it got too slow for iterative development, since I was too lazy and forgetful to evaluate Begin["`Private`"] before tweaking. But I'm sure a work-around could be found to circumvent that. I just went to auto-generated packages instead. – b3m2a1 Aug 29 '17 at 22:19
  • 1
    @b3m2a1 One of the things that are the top-priority for next features for MIDE is the support for packages, so that one can work with package code still cell by cell, and then only reload the cell with modified function without reloading entire package. This I need also for my current work, so hopefully I will find time to add this rather soon. – Leonid Shifrin Aug 30 '17 at 08:07