latexxypic

Equality between two separate xy-pic diagrams in LaTeX


I have two xy-pic diagrams which are generated by a script. In a LaTeX equation environment, I would like to write something like

diagram1 = diagram2

where diagram1 and diagram2 are two separate xy-pic diagrams generated by this script, with the two centered vertically (as well as the = sign).

Is there an easy way to do this, without editing the diagrams and rewritting them as a larger xy-pic diagram?


Solution

  • If I understand you right I think you can accomplish what you want by using minipages. You might need to futz with the spacings and widths, but something like this works in my test:

    \begin{minipage}[c]{0.38\textwidth}
    \begin{xy}
        (0,-20)="a", (0,0)="b"
        \ar@{<.||}  @<24mm>  "a";"b"
        \ar@^{<.||} @<16mm>  "a";"b"
        \ar@_{<.||} @<8mm>   "a";"b"
        \ar@0{<.||}          "a";"b"
        \ar@1{<.||} @<-8mm>  "a";"b"
        \ar@2{<.||} @<-16mm> "a";"b"
        \ar@3{<.||} @<-24mm> "a";"b"
    \end{xy}
    \end{minipage}
    \hspace{0.03\textwidth}
    \begin{minipage}[c]{0.05\textwidth}
    ~~~~~\Large =
    \end{minipage}
    \hspace{0.08\textwidth}
    \begin{minipage}[c]{0.44\textwidth}
    \begin{xy}
        (0,-20)="a", (0,0)="b"
        \ar@{<.||}  @<24mm>  "a";"b"
        \ar@^{<.||} @<16mm>  "a";"b"
        \ar@_{<.||} @<8mm>   "a";"b"
        \ar@0{<.||}          "a";"b"
        \ar@1{<.||} @<-8mm>  "a";"b"
        \ar@2{<.||} @<-16mm> "a";"b"
        \ar@3{<.||} @<-24mm> "a";"b"
    \end{xy}
    \end{minipage}