2
$\begingroup$

I have a lot of text in my Notebook (Format>Style>Text), and I would like to have the full width text, then insert an image on the left, and have the text continue down the right side of the image, then continue full width afterwards. Is there a way to do this?

Thanks for any help.

$\endgroup$
1

2 Answers 2

1
$\begingroup$

A bit tricky to automate, but might help.

text = StringTake[ExampleData[{"Text", "Prufrock"}], {226, 1252}];
columntext1 = StringTake[text, 450];
columntext2 = StringDrop[text, 408];
column1 = 
  Graphics[{White, Rectangle[{0, 0}, {170, 240}], Black, 
    Inset[TextCell[columntext1, LineSpacing -> {0, 16}, 
      TextJustification -> 1], {0, 240}, {Left, Top}, {170, 
      Automatic}]}, PlotRange -> {{0, 170}, {0, 240}}, 
   BaseStyle -> {FontFamily -> "Times", FontWeight -> "Plain", 
     FontSize -> 14}];

column2 = 
  Graphics[{White, Rectangle[{0, 0}, {330, 179}], Black, 
    Inset[TextCell[columntext2, LineSpacing -> {0, 16}, 
      TextJustification -> 1], {0, 179}, {Left, Top}, {330, 
      Automatic}]}, PlotRange -> {{0, 330}, {0, 179}}, 
   BaseStyle -> {FontFamily -> "Times", FontWeight -> "Plain", 
     FontSize -> 14}];

image = ExampleData[{"TestImage", "Couple2"}];
clippedimage = 
  Graphics[{Blue, Rectangle[{0, 0}, {150, 218}], 
    Inset[image, {95, 100}, {Center, Center}, {260, 260}]},
   PlotRange -> {{0, 150}, {0, 218}}, ImageSize -> 150];

Graphics[{White, Rectangle[{0, 0}, {330, 400}],
  Inset[clippedimage, {75, 290}, {Center, Center}, {150, 218}],
  Inset[column1, {245, 280}, {Center, Center}, {170, 240}],
  Inset[column2, {165, 85}, {Center, Center}, {330, 179}]},
 PlotRange -> {{0, 330}, {0, 400}}, ImageSize -> 330]

enter image description here

$\endgroup$
0
$\begingroup$
GridBox[{{cat, 
    "xxxx lkajsdflkj sdflkj aldkfj laskjdf lkasjd flkjas dflkja \
sdlfkj asdlfkj aslkdjf alskdjf "}, {" ", " "}}, 
  ColumnWidths -> {8, 15}, ColumnLines -> True, 
  GridFrame -> True] // DisplayForm

enter image description here

$\endgroup$
1
  • $\begingroup$ Well, going with the simplest first, I had to add RowAlignments -> {Top, Top} to get the text to start at the top, then Text[text] instead of just text to clean it up, but I still cant get rid of the indentations of all lines but the top. Also, I see \n's where there should be returns. $\endgroup$
    – Paul R.
    Commented Jan 27, 2019 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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