MathGroup Archive 2004

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

Search the Archive

RE: Question: formatting text, sections

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45938] RE: [mg45903] Question: formatting text, sections
  • From: "David Park" <djmp at earthlink.net>
  • Date: Fri, 30 Jan 2004 04:16:10 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Jason,

To my mind, this is the one flaw in Automatic Grouping. (Still Automatic
Grouping is infinitely better than manual grouping.)

You can obtain your objective by:
1) adding the Text cell in the last subsection.
2) Use Shift-Ctrl-E (or menu/Formate/ShowExpression) to see the underlying
expression.
3) Add the option

CellGroupingRules->{"SectionGrouping",40}

at the end of the Cell statement

4) Use Shift-Ctrl-E to return to the normal display.

The Text cell will now be grouped with the Section and not with the
subsection.

I've pasted a sample notebook at the end of this posting.

You can look up CellGroupingRules in
HelpBrowser/FrontEnd/Cell Options/Cell Properties/CellGroupingRules

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: Jason Miller [mailto:millerj at truman.edu]
To: mathgroup at smc.vnet.net

I have a section in a Mathematica notebook that has several
subsections.  I want to end the section with some text, but that text
gets automagically included in the last subsection's cell bracket.  I'd
like it to occur outside (below) that cell bracket so that when I close
the subsection cell (to hide its contents), the last bit of text is
still visible to the reader.  Is there a slick/easy way to do this?

Thanks.

================================================================
Jason E. Miller, Ph.D.
Associate Professor of Mathematics
Truman State University
Kirksville, MO
http://pyrite.truman.edu/millerj/
660.785.7430

(************** Content-type: application/mathematica **************
                     CreatedBy='Mathematica 5.0'

                    Mathematica-Compatible Notebook

This notebook can be used with any Mathematica-compatible
application, such as Mathematica, MathReader or Publicon. The data
for the notebook starts with the line containing stars above.

To get the notebook into a Mathematica-compatible application, do
one of the following:

* Save the data starting with the line of stars above into a file
  with a name ending in .nb, then open the file inside the
  application;

* Copy the data starting with the line of stars above to the
  clipboard, then use the Paste menu command inside the application.

Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode.  Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).

NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing
the word CacheID, otherwise Mathematica-compatible applications may
try to use invalid cache data.

For more information on notebooks and Mathematica-compatible
applications, contact Wolfram Research:
  web: http://www.wolfram.com
  email: info at wolfram.com
  phone: +1-217-398-0700 (U.S.)

*******************************************************************)

(*CacheID: 232*)


(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[      2404,         94]*)
(*NotebookOutlinePosition[      3047,        116]*)
(*  CellTagsIndexPosition[      3003,        112]*)
(*WindowFrame->Normal*)



Notebook[{

Cell[CellGroupData[{
Cell["Section One", "Section"],

Cell[CellGroupData[{

Cell["Subsection 1", "Subsection"],

Cell[CellGroupData[{

Cell[BoxData[
    \(1 + 1\)], "Input"],

Cell[BoxData[
    \(2\)], "Output"]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["Subsection 2", "Subsection"],

Cell[CellGroupData[{

Cell[BoxData[
    \(2 + 2\)], "Input"],

Cell[BoxData[
    \(4\)], "Output"]
}, Open  ]]
}, Closed]],

Cell["This is a text cell to close out Section One", "Text",
  CellGroupingRules->{"SectionGrouping", 40}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Section Two", "Section"],

Cell["Continuining on....", "Text"]
}, Closed]]
},
FrontEndVersion->"5.0 for Microsoft Windows",
ScreenRectangle->{{0, 1280}, {0, 941}},
WindowSize->{492, 740},
WindowMargins->{{0, Automatic}, {Automatic, 0}}
]

(*******************************************************************
Cached data follows.  If you edit this Notebook file directly, not
using Mathematica, you must remove the line containing CacheID at
the top of  the file.  The cache data will then be recreated when
you save this file from within Mathematica.
*******************************************************************)

(*CellTagsOutline
CellTagsIndex->{}
*)

(*CellTagsIndex
CellTagsIndex->{}
*)

(*NotebookFileOutline
Notebook[{

Cell[CellGroupData[{
Cell[1776, 53, 30, 0, 73, "Section"],

Cell[CellGroupData[{
Cell[1831, 57, 34, 0, 38, "Subsection"],

Cell[CellGroupData[{
Cell[1890, 61, 38, 1, 30, "Input"],
Cell[1931, 64, 35, 1, 29, "Output"]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{
Cell[2015, 71, 34, 0, 30, "Subsection"],

Cell[CellGroupData[{
Cell[2074, 75, 38, 1, 30, "Input"],
Cell[2115, 78, 35, 1, 29, "Output"]
}, Open  ]]
}, Closed]],
Cell[2177, 83, 106, 1, 30, "Text",
  CellGroupingRules->{"SectionGrouping", 40}]
}, Open  ]],

Cell[CellGroupData[{
Cell[2320, 89, 30, 0, 73, "Section"],
Cell[2353, 91, 35, 0, 33, "Text"]
}, Closed]]
}
]
*)



(*******************************************************************
End of Mathematica Notebook file.
*******************************************************************)


  • Prev by Date: Re: Re: Simple question or how Mathematica getting on my nerves.
  • Next by Date: Defining a function in module problem?
  • Previous by thread: Question: formatting text, sections
  • Next by thread: Import[filename,"CSV"] is so slooooooooow!