2
$\begingroup$

I have some graphics in a notebook that I need to place in a slideshow and then add some commentary later by typing it in. The setup I an attempting to replicate is on slide 3 of a new Slideshow (the image of the wild-cat with formatted text next to it).

Minimal example of what I have tried.

Grid[{{
   Column[{Plot[x, {x, -1, 1}], Grid[{{"Stats grid", 2.2}}]}],
   TextCell[Placeholder["Commentary"], "SubitemParagraph"]
   }}, Alignment -> {Left, Top}]

enter image description here

I cannot enter text into the "Commentary" placeholder in either the notebook that this is created in nor in the slideshow notebook when I copy and paste the cell.

The slideshow is a combination of results from a few notebooks and I can't place all the code in the slideshow notebook. It would not be manageable to maintain.

How do I generate a cell that behaves as the "wild-cat" cell in that appears in a new slideshow? A solution that allows me to include a placeholder for the copy-n-paste and then keeps the editing of the text interactive as with the "wild-cat" cell.

$\endgroup$
3
$\begingroup$

Just replace TextCell with Style and print the whole as a new TextCell with explicit "ShowStringCharacters" -> False option (this option is set by default for the "Output" cells, but the cells intended for interactive input have no this option by default):

CellPrint@TextCell[
  Grid[{{Column[{Plot[x, {x, -1, 1}], Grid[{{"Stats grid", 2.2}}]}], 
     Style[Placeholder["Commentary"], "SubitemParagraph"]}}, 
   Alignment -> {Left, Top}], "Text", "ShowStringCharacters" -> False]

screenshot

Now you can select the placeholder and type into it. Typed text will have the style "SubitemParagraph", subscripts and superscripts can be created using usual keyboard shortcuts:

screenshot

$\endgroup$
6
  • $\begingroup$ Nope. As you type the Commentary the text in the grid under the plot turns to FullForm. Notice the quotes around Stats grid. The real grid under the plot has formatting that turns into SubscriptBoxes and the like. It becomes no longer readable. $\endgroup$
    – Edmund
    Aug 2 '16 at 11:21
  • $\begingroup$ @Edmund I have updated the answer, please try again. $\endgroup$ Aug 2 '16 at 11:31
  • $\begingroup$ That seems to be the ticket. Where did you find the "ShowStringCharacters"option? Is it undocumented? (+1) $\endgroup$
    – Edmund
    Aug 2 '16 at 11:44
  • $\begingroup$ It is basically documented, but understanding of the specifics of working of this option I have found by experimentation: it doesn't simply turns on/off display of the quotation marks ", but also triggers rendering of the string representation of boxes (the linear syntax). $\endgroup$ Aug 2 '16 at 12:00
  • $\begingroup$ @Edmund If my solution works for you, please Accept it. $\endgroup$ Aug 3 '16 at 3:11
2
$\begingroup$

Using TextGrid instead may work for you:

TextGrid[{{Column[{Plot[x, {x, -1, 1}], Grid[{{"Stats grid", 2.2}}]}],
    TextCell[Placeholder["Commentary"], "SubitemParagraph"]}}, 
 Alignment -> {Left, Top}]
$\endgroup$
1
  • $\begingroup$ TextGrid does not cooperate with the Grid under the graphic. As soon as I start to type the grid under the graphic switches into FullForm. The actual grids have lots of formatting and it turns into SubscriptBoxes and the like. Also the text I type into the Placeholder is not formatted in the requested style. $\endgroup$
    – Edmund
    Aug 1 '16 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.