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}\]

1 Answer 1

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .