MathGroup Archive 2011

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

Search the Archive

CreateDocument with nested CellGroup problem.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121834] CreateDocument with nested CellGroup problem.
  • From: Syd Geraghty <sydgeraghty at me.com>
  • Date: Tue, 4 Oct 2011 01:32:53 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hi all,

CreateDocument[
 CellGroup[{TextCell[CountryData[#, "Name"], "Section"], 
     ExpressionCell[
      GraphicsRow[{CountryData[#, "Shape"], 
        Quiet[DateListPlot[CountryData[#, {{"Population"}, {1970, 2005}}]]]}, 
       Frame -> All, ImageSize -> 600], "Output"]}, Closed] & /@ 
  CountryData["Africa"], WindowTitle -> "Africa", 
 StyleDefinitions -> "Creative/PastelColor.nb"]

outputs a document with select information about all the countries in Africa.

I wanted to extend it to take any of the continents as an argument but got stuck at trying to make a very simple extension to nest the original cell groups under the title cell "Africa" .

After an embarrassing amount of time spent trying many alternatives based on the documentation for nested cells in CellGroup and examples in CreateDocument I could not get the desired result.

The code below does not work and it seems that the pure function is not wrapped properly

So this is the closest I got:

CreateDocument[
 CellGroup[{TextCell["Africa", "Title"], 
     CellGroup[{TextCell[CountryData[#, "Name"], "Section"], 
       ExpressionCell[
        GraphicsRow[{CountryData[#, "Shape"], 
          Quiet[
           DateListPlot[CountryData[#, {{"Population"}, {1970, 2005}}]]]}, 
         Frame -> All, ImageSize -> 600], "Output"]}, Closed]}] & /@ 
  CountryData["Africa"], CellGrouping -> Manual, WindowTitle -> "Africa", 
 StyleDefinitions -> "Creative/PastelColor.nb"]


The "Title" cell is repeated for every country instead of nesting all the countries. A solution would be greatly appreciated.

Cheers .... Syd

Syd Geraghty B.Sc, M.Sc.

sydgeraghty at mac.com

Mathematica 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
ReleaseID:    8.0.1.0 (2063982, 2063639)
MacOS X V 10.7.1 Lion 
MacBook Pro 2.33 GHz Intel Core 2 Duo  3GB RAM


  • Prev by Date: Re: Simple fractal
  • Next by Date: Re: Solve - takes very long time
  • Previous by thread: Re: How to pass initial conditions to IDA methods via NDSolve?
  • Next by thread: Re: Size of Control[] and OpenerView in Manipulate