Math & Sciencecentred xy-pic diagram with fleqn

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
lauraf
Posts: 29
Joined: Tue Jan 13, 2009 12:44 pm

centred xy-pic diagram with fleqn

Post by lauraf »

Hi all,

I am using the amsmath package with the fleqn option. This causes diagrams I have drawn with xy-pic to also be left-aligned, whereas I would like them centred.

For example:

Code: Select all

\documentclass{article}

\usepackage[all]{xy}

\usepackage[fleqn]{amsmath}


\begin{document}

\begin{displaymath}
\xymatrix{ 
{\bullet} \ar@{--}[d]\ar@{=}[dr]\ar@{-}[r] 
& {\bullet} \ar@{.}[d] \\ 
{\bullet} & {\bullet} \ar[l] }
\end{displaymath}

\end{document}
Is there any way to override fleqn? Or how else can I achieve this, i.e. left-aligned equations but centred diagrams?

Many thanks!
Laura

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10344
Joined: Mon Mar 10, 2008 9:44 pm

centred xy-pic diagram with fleqn

Post by Stefan Kottwitz »

Hi Laura,

you could use flalign*:

Code: Select all

\begin{flalign*}
    && \xymatrix{ ... } &&
\end{flalign*}
Stefan
LaTeX.org admin
lauraf
Posts: 29
Joined: Tue Jan 13, 2009 12:44 pm

Re: centred xy-pic diagram with fleqn

Post by lauraf »

Great, that works a treat ;)

Thanks Stefan!
Laura
Post Reply