Welcome to the most active Linux Forum on the web.
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org [LaTeX] Centreing a xymatrix in figure environment
 Linux - Software This forum is for Software issues. Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

 06-12-2005, 01:35 AM #1 solarize LQ Newbie   Registered: May 2005 Location: Amsterdam, the Netherlands Distribution: Fedore Core 3 Posts: 20 Rep: [LaTeX] Centreing a xymatrix in figure environment I'm trying to center some xy-pic code but using \centering or center environments fails to do so. Anybody know why and how I can solve it? Here the code I try to center: Code: \begin{figure} \centering \xymatrix@-1pc@R=10pt@C=0.4pt{ & & & & & *+[F-:<5pt>]{Q_r} \ar@{-}[dl] \ar@{-}[dr] \\ & & & & *+[F]{S_1} \ar@{-}[dl] & \ldots & *+[F]{S_n} \ar@{-}[dr] \\ & & & *+[F-:<5pt>]{Q_1} \ar@{-}[dl] \ar@{-}[dr] & & \ldots & & *+[F-:<5pt>]{Q_n} \ar@{-}[dl] \ar@{-}[dr]\\ & & *+[F]{S_{n+1}} \ar@{-}[dl] & \ldots & *+[F]{S_{n+m}} \ar@{-}[dr] & & & & &\\ & *+[F-:<10pt>]{Q_{n+1}} \ar@{-}[dl] \ar@{-}[dr] & & \ldots & & *+[F-:<10pt>]{Q_{n+m}} \ar@{-}[dl] \ar@{-}[dr] & & & \\ & & & & & & & } \caption{A DPN domain graph.} \label{fig:dpn_cluster} \end{figure}
 06-12-2005, 06:58 PM #2 jgombos Member   Registered: Jul 2003 Posts: 256 Rep: I'm not familiar with the type of object you're centering, or if it has any special requirements. My knee-jerk suggestion would be to try doing an \hfill before and after your xypic, or whatever the heck that thing is. If you get to a point where you're ready to give up on an elegent solution, you can always force some space on the left using \hspace.
 06-12-2005, 07:10 PM #3 mjrich Senior Member   Registered: Dec 2001 Location: New Zealand Distribution: Debian Posts: 1,046 Rep: You can use \centerline{} if you wish. Thus, your code becomes Code: \begin{figure} \centerline{ \xymatrix@-1pc@R=10pt@C=0.4pt{ & & & & & *+[F-:<5pt>]{Q_r} \ar@{-}[dl] \ar@{-}[dr] \\ & & & & *+[F]{S_1} \ar@{-}[dl] & \ldots & *+[F]{S_n} \ar@{-}[dr] \\ & & & *+[F-:<5pt>]{Q_1} \ar@{-}[dl] \ar@{-}[dr] & & \ldots & & *+[F-:<5pt>]{Q_n} \ar@{-}[dl] \ar@{-}[dr]\\ & & *+[F]{S_{n+1}} \ar@{-}[dl] & \ldots & *+[F]{S_{n+m}} \ar@{-}[dr] & & & & &\\ & *+[F-:<10pt>]{Q_{n+1}} \ar@{-}[dl] \ar@{-}[dr] & & \ldots & & *+[F-:<10pt>]{Q_{n+m}} \ar@{-}[dl] \ar@{-}[dr] & & & \\ & & & & & & & } } \caption{A DPN domain graph.} \label{fig:dpn_cluster} \end{figure} Cheers, mj
 06-13-2005, 01:44 AM #4 solarize LQ Newbie   Registered: May 2005 Location: Amsterdam, the Netherlands Distribution: Fedore Core 3 Posts: 20 Original Poster Rep: Super.... centerline{} worked. Thanks! Although strange that \centering and \begin{center} ... \end{center} didn't?!?!?!?