Re: Mathematica 6 Cell Grouping
- To: mathgroup at smc.vnet.net
- Subject: [mg79335] Re: Mathematica 6 Cell Grouping
- From: David Reiss <dbreiss at gmail.com>
- Date: Wed, 25 Jul 2007 02:02:11 -0400 (EDT)
- References: <f84if2$oh2$1@smc.vnet.net>
Hi Derek, I have not read your complete post yet, but I have to (hopefully helpful) comments. To do the sort of extraction of material from a notebook that you are wanting to do (in your case to be able to print a notebook without a bunch of ancilliary thngs in it such as input and Output cells) the rout of tagging is exactly the way to go. However, ther are some issues that make it slightly messy. One approach is, as you mentione, to tag the cells that you don't want, isolate them, and print out the complement of those cells. How does one do this? There are several strategies, but the ideal one requires some more sophisticated detail. Here's one. (Note that my approach here is to make sure not to potentially destroy the content in your original notebook, so I will be making a duplicate notebook and working on that.) 1) Select Input cells and tag them with a tag of your choosing, let's call it "mytag". 2) Select Output cells and tag them with the same tag (or a different one, but that might make thins a bit more complicated. 2a) note that if you tag the input cells and then execute them, then the output cells will also inherit that tag.. Also if you tag the output cells with a **different** tag, they will lose this tag when the input cells are re-eevaluated. So, the lesson here is, don't bother tagging the output cells with different gags unless you want to re-tag them each time you evaluate the input cells. 3) Call the notebook object of your original notebook nb and create a duplicate of it nbget=NotebookGet[nb]; nbnew=NotebookPut[nbget] I do it this way so that the nrew notebook nbnew has all of the same optoins as the original. 4) For nbnew remove all of the cells that you don't want nbf=NotebookFind[nbnew,"mytag",All,CellTags] NotebookDelete[nbf] Note that this last bit assumes that all fo the tagged cells are deletable and editable. 5) Now just print nbnew Comments: Mathematica does not have a direct means for selecting the **complement** of the cells with a tag. If it could, tehn you cold directly select those cells that don't have the tag "mytag" and open a noew notebook wth those cells in it. In A WorkLife FrameWork (http://scientificarts.com/worklife) the tagging palette as buttons to do exactly this ane quite a bit more. See http://scientificarts.com/worklife/documentation/taggingpalette.html and the screencast about tagging at http://scientificarts.com/worklife/screencasts/index.html I hoep that this helps, David On Jul 24, 5:57 am, yat... at mac.com wrote: > I have been trying to infer the CellGroupingRules option in order to > accomplish the following: > <snip>