MathGroup Archive 2007

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

Search the Archive

Re: Problems naming files with equation names

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80156] Re: Problems naming files with equation names
  • From: Albert <awnl at arcor.net>
  • Date: Tue, 14 Aug 2007 06:54:00 -0400 (EDT)
  • References: <f9p4mt$qj1$1@smc.vnet.net>

Hi chuck,


> My work with Mathematica usually is focused on studying functions and I'd like to organize my notebooks under these functions such as:
> 
> f[z]=Sqrt[z]/(1+z^2)
> 
> g[z]=Sqrt[z]/(1+z^5}
> 
> f[z]=Log[1+1/(Exp[z]Sqrt[z])
> 
> g[z]=(1+2z)/(1+Exp[z]Sqrt[z])
> 
> P[z]=z^{s-1}/(Exp[z-]-1)
> 
> f[z]=1/(z^2-z^3)^{1/3}
> 
> I got tons more.  I'd like a GUI interface to the File/Open/Save menu that displays my directories and file names as Mathematica Cells that I can edit to depict the equations contained in them.  I bet a whole dollar there's a way to do that. 

o.k., I understand. I think that the advise of Jens-Peer will probably 
be your best bet: Use some simple scheme to generate unique filenames, 
either by just numbers or probably something that has more meaning in 
case you look at the filenames without your customized GUI inteface. 
Then create a look-up-table which gives you a connection form filename 
to formula, either as just a list or probably even better in the form:

{filename -> formula, filename->formula}

then you can construct a custom Open/Save Dialog with the new feature 
which displays the formula, but opens the corresponding filename. I 
don't think there is a way to "overwrite" the menu item File/Save or 
File/Open, but you could make a palette which makes your custom menus 
available almost just as easy.

Here is a simple approach for a file-opener dialog which you probably 
can build on. It defines a directory where you could put all your 
notebooks and needs a rule as described abouve:

filenamerules={
"function1.nb"->Sqrt[z]/(1+z^2),
"funciton2.nb"->Sqrt[z]/(1+z^5),
"function3.nb"->Log[1+1/(Exp[z]Sqrt[z])]
};

functiondirectory=ToFileName[{$UserDocumentsDirectory,"Functions"}]

CreateDialog[
DynamicModule[{fn=filenamerules[[1,1]]},
Column[{
PopupMenu[Dynamic[fn],filenamerules],
Button["Open",NotebookOpen[ToFileName[{functiondirectory},fn]]]
}]]
]

Once you have this working you could think about all kind of extensions, 
like generating the lookup-table automatically from the contents of the 
files so you wouldn't have to fill that list manually. This could be 
done by searching for e.g. Title-cells and display the expression which 
is containd within those as the label for each file...

hth,

albert


  • Prev by Date: Re: Version 6 "Mathematica Book" - updated
  • Next by Date: Re: Manipulate and conflict in options to update front
  • Previous by thread: Re: Problems naming files with equation names
  • Next by thread: Re: Problems naming files with equation names