Adjusting in-line xy-pic diagrams to the baseline

Here is one possible way

Sample output

\documentclass{article}

\usepackage[all]{xy}

\begin{document}

Consider the diagram $\xy (0,12)+{\xymatrix { & \bullet \ar[dr] & \\ \bullet
\ar[rr] \ar[ur] & & \bullet }} \endxy$ with appropriate baseline.

\end{document}

The \xymatrix produces an object that can be shifted in standard xy style , here by (0,12) in the natural coordinate system, meaning 0 to the right and 12 up.


You can raise the diagram by its depth (the vertical extent below the baseline), but also taking into account that the \xymatrix is surrounded by \fboxsep space around all sides.

\documentclass{article}
\usepackage{amsmath}
\usepackage[all,cmtip]{xy}

\begin{document}

Consider the diagram
\raisebox{\dimexpr\depth-\fboxsep}{%
  $\xymatrix{ & \bullet \ar[dr] & \\ \bullet \ar[rr] \ar[ur] & & \bullet }$%
}
blah blah blah

\end{document}

enter image description here

I'd also make it smaller, if you really want it to be inline.

\documentclass{article}
\usepackage{amsmath}
\usepackage[all,cmtip]{xy}

\begin{document}

Consider the diagram
\raisebox{\dimexpr\depth-\fboxsep}{%
  $\xymatrix@R-1pc@C-1pc{ & \bullet \ar[dr] & \\ \bullet \ar[rr] \ar[ur] & & \bullet }$%
} 
blah blah blah

\end{document}

enter image description here

Tags:

Xy Pic