1

In an array there are three options r, c, l for flushing right, centered and flushing left. But how about flushing up and down and centered vertically? As an example in the array below, I want the left entry be centered vertically and not to be up!

\[\begin{array}{cc}
        \begin{array}{c}
        \xymatrix{A\ar[r] & A\ar[r] & A}
        \end{array} & \xymatrix{ & A & \\
        A\ar[ur]\ar[r]\ar[dr] & A & A\ar[ul]\ar[l]\ar[dl]\\
        & A & }
        \end{array}\]
2

adjustbox can be used to provide a vertical alignment adjustment via the valign key-value:

enter image description here

\documentclass{article}

\usepackage{xypic,adjustbox}

\begin{document}

\[
  \begin{array}{cc}
    \adjustbox{valign=c}{\xymatrix{A\ar[r] & A\ar[r] & A}} &
      \adjustbox{valign=c}{\xymatrix{ & A & \\
        A\ar[ur]\ar[r]\ar[dr] & A & A\ar[ul]\ar[l]\ar[dl] \\
        & A & }}
  \end{array}
\]

\end{document}

The vertical anchor is repositioned to the centre of the construction.

| improve this answer | |
  • Is it possible to have to \xymatrix under each other in adjustbox like array by using something like \\ ? – AmirHosein Sadeghimanesh Nov 8 '16 at 9:36
  • 1
    @AmirHoseinSadeghiManesh: Sure. Put whatever you like in a n array, and wrap that inside an \adjustbox. – Werner Nov 8 '16 at 16:14

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.