0

I am looking for the simplest way to connect two equation boxes with an arrow. Currently I am using the empheq. This is what I have done so far:

\usepackage{empheq}
\usepackage[most]{tcolorbox}
\newtcbox{\mymath}[1][]{%
    nobeforeafter, math upper, tcbox raise base,
    enhanced, sharp corners, colback=white!10, colframe=red!30!black, boxrule=2pt}

\begin{empheq}[box={%
       \mymath[colback=red!30,drop lifted shadow, sharp corners]}]{equation*}
       \color{black} \mathrm{x^2+x+3=1}
    \end{empheq}
    \begin{empheq}[box={%
       \mymath[colback=red!30,drop lifted shadow, sharp corners]}]{equation*}
       \color{black} \mathrm{x^2+x+2=0}
    \end{empheq}

And I got this:

enter image description here

I want that boxes look like this:

enter image description here

I would appreciate any help!

  • 2
    you are probably more likely to get help if you provide a full minimal example instead of just a snippet – daleif Aug 2 '17 at 16:03
4

Note that in the absence of a working example, I decided to provide something that does not make use of empheq or tcolorbox. The former is likely to be easy to add afterwards, and the latter seemed overkill just for those rectangles.

\documentclass[tikz]{standalone}   

\usepackage{amsmath}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[every node/.style = {draw}, very thick]
    \node (a) at (0, 2) {$x^2 + x + 3 = 1$};
    \node (b) at (0, 0) {$x^2 + x + 2 = 0$};
    \draw[->] (a) to (b);
\end{tikzpicture}
\end{document}

enter image description here

If you really wish to use tcolorboxes and stuff, you should be able to put them in the nodes. Remove the draw option from the nodes' style to avoid having a double rectangle, then.

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.