textdata inside textdata problem
- To: mathgroup at smc.vnet.net
- Subject: [mg78816] textdata inside textdata problem
- From: "Chris Chiasson" <chris at chiasson.name>
- Date: Tue, 10 Jul 2007 06:32:49 -0400 (EDT)
If I view a new notebook __in the "Printout: environment__ with the following cell as its only contents, Cell[TextData[{ "hello world ", Cell[TextData[{"what's up?"}]], " one two three" }], "Text"] I get a huge space after "what's up?" Why*? It doesn't show up in the Working environment. This happens with other Cells that I embed inside TextData for purposes of including box structures and for marking up and styling content consistently. The help documentation uses a different technique. It embeds boxes directly inside (what would be the outer) TextData without wrapping them in a Cell. Why does that even work (seems like it should be an erroneous notebook structure according to paclet:tutorial/TheStructureOfCells)? See, for example, the button in the first paragraph of paclet:tutorial/UnconstrainedOptimizationBrentsMethod. Should I be using a different embedded cell structure? *It seems to have something to do with the PageWidth option of Cell style "Text" in the "Printout" environment. One workaround (hack) is to add a modification to the "Printout" environment of the "InlineCell" style in a custom stylesheet: Cell[StyleData["InlineCell","Printout"], TextJustification->0, PageWidth->WindowWidth] Here is a simple real world example of using TextData inside TextData for a bibliography: Cell[TextData[{ "[BLB97] Theodore L. Brown, H. Eugene LeMay, Jr., and Bruce E. Bursten. ", Cell["Chemistry: The Central Science.", "BibliographyEntryTitle"], " 0-13-533480-2. Copyright (c) 1997. Prentice Hall. Upper Saddle River, New Jersey, United States of America." }], "Text", CellTags->"BLB97"] In my stylesheet, BibliographyEntryTitle has an option to make the text italic: Cell[StyleData["BibliographyEntryTitle", StyleDefinitions -> StyleData["Text"]], FontSlant->"Italic"] -- http://chris.chiasson.name/