0

Sample Cell 1

Cell["Much of point set topology consists in developing a convenient language to talk about when various points in a space are near to one another and about the notion of continuity. The key is that the same definitions can be applied to many disparate branches of math.", "Text"]

Split to multiple cells like

Sample Cell 2

Cell["Much of point set topology consists in developing a convenient", "Text"]
Cell[" language to talk about when various points in a space are near", "Text"]
Cell[" to one another and about the notion of continuity. The key is", "Text"]
Cell[" that the same definitions can be applied to many disparate ", "Text"]
Cell["branches of math.", "Text"]

Though, in this example, they are all plaint text, maybe much simpler, the problem might be harder when there are many inline math cells.


Here is an sample post for why I need this, I wanna make first light-green block text into multiple framed lines like what below Definition 4.1.1. http://quaternions.blog.163.com/blog/static/206082147201356102512774/


Bill's present method will not able to deal with the inline cells.

Upadte sample Cell 3 with inline cells

Cell[TextData[{"Much of point set topology", Cell[BoxData[\(TraditionalForm\`\(\ consists\ \)\)], FormatType -> "TraditionalForm"], "in developing a convenient language to  talk about ", Cell[BoxData[\(TraditionalForm\`when\)], FormatType -> "TraditionalForm"], " various points in a space are near to one another and about the notion of ", Cell[BoxData[\(TraditionalForm\`\(continuity\^2\)\)], FormatType -> "TraditionalForm"], ". The key is that the same definitions can be applied to many disparate branches of math."}], "Text"]
HyperGroups
  • 8,619
  • 1
  • 26
  • 63

1 Answers1

0

Take the first cell and give it a name:

myCell=Cell["Much of point set topology consists in developing a convenient language to  talk about when various points in a space are near to one another and about the notion of continuity. The key is that the same definitions can be applied to many disparate branches of math.", "Text"]

Here's a function to break it into pieces with about n/2 words in each piece:

breakCell[str_, n_] := Cell /@ StringJoin /@ 
    Partition[Riffle[StringSplit[First[List @@ str]], " "], n]

For example, applying breakCell to myCell gives:

breakCell[myCell, 15]

{Cell["Much of point set topology consists in developing"], 
 Cell[" a convenient language to talk about when "], 
 Cell["various points in a space are near to"], 
 Cell[" one another and about the notion of "], 
 Cell["continuity. The key is that the same definitions"], 
 Cell[" can be applied to many disparate branches "]}
bill s
  • 68,936
  • 4
  • 101
  • 191
  • Hi, bill, there would be some problems when arbitrarily add some inline cells in myCell – HyperGroups Jun 06 '13 at 03:44
  • Well... the code is right there -- I just took the First part. If there's more stuff, you will want to write something that handles that as well. – bill s Jun 06 '13 at 03:46
  • en, I should make my original cell just be cell with inline cells – HyperGroups Jun 06 '13 at 03:49
  • How about select the part of the cell you want and then choose Cell->Divide Cells from the menu. – bill s Jun 06 '13 at 04:23
  • ha, that's too [adj...] for frequent work. Actually I get my Sample Cell2 from Sample Cell1 in that way. – HyperGroups Jun 06 '13 at 04:26
  • bills, one similar question, welcome to be interested with that if had time. http://mathematica.stackexchange.com/questions/27114/split-one-string-about-a-fixed-width-with-syntaxq-true – HyperGroups Jun 17 '13 at 04:49