1
$\begingroup$

At present I am interested in
overlaying cells
without change of size.

Cells may be graphic or not graphic. For example, it can be a complicated mathematical formula or grid. Also cells may be output cell or text cell.

Here overlay and size is a common word of natural English, not a technical term/function in mathematica. Here size means the size as seen (in the working mma notebook) with the naked eye.

I'll mind alignment later, but in this post, I decided not to mind alignment.

Also, in the final result, each element should be selectable / editable.(with mouse click)

I want to start with the easy one.

How can we overly following two cells (the result of two codes) ?

First cell :

RowBox[{RowBox[{SuperscriptBox["x", "2"], "+", 
       FractionBox[SuperscriptBox["y", "2"], "3"]}], "\[Equal]", 
     "1"}] //
   BoxData // Cell[#, "Text"] & // CellPrint

Second cell :

Graphics[Circle[]]

enter image description here

'What I want is :' image was created by photoshop.

I've read Inset of document but it is not enough.

$\endgroup$

1 Answer 1

1
$\begingroup$

A start:

Graphics[{Circle[{0, 0}, 1], 
  Inset[Text[
    Style["\!\(\*SuperscriptBox[\(x\), \
\(2\)]\)+\!\(\*FractionBox[SuperscriptBox[\(y\), \(2\)], \(3\)]\)=1", 
     24]], {0, 0}]}]

enter image description here

If this question and any solution is to be of value to the community, we must be aware that it is extraordinarily unlikely that any two graphics will have precisely the size needed for the final figure. For that reason we should include an adjustment of the scale of at least one of the figures... most simply the fontsize of the text. The fontsize is a default parameter, in a sense absolutely arbitrary. Having a provision in the code to set it as needed is quite appropriate.

I ask the OP: Why is it essential that neither component image be scaled? What could be the possible value of that requirement?

$\endgroup$
2
  • $\begingroup$ Thank you, but in your answer, the size of X is bigger then Y... And it's not a fundamental problem. I am expecting a solution that brings the contents of the cell as it is, and reuses it. $\endgroup$
    – imida k
    Commented May 29, 2023 at 21:21
  • $\begingroup$ And where/how does the font size '24' come from ? It should be explained. $\endgroup$
    – imida k
    Commented May 29, 2023 at 21:26

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.