LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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

Reply
 
Search this Thread
Old 06-12-2005, 02:35 AM   #1
solarize
LQ Newbie
 
Registered: May 2005
Location: Amsterdam, the Netherlands
Distribution: Fedore Core 3
Posts: 20

Rep: Reputation: 0
[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}
 
Old 06-12-2005, 07:58 PM   #2
jgombos
Member
 
Registered: Jul 2003
Posts: 256

Rep: Reputation: 32
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.
 
Old 06-12-2005, 08:10 PM   #3
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
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
 
Old 06-13-2005, 02:44 AM   #4
solarize
LQ Newbie
 
Registered: May 2005
Location: Amsterdam, the Netherlands
Distribution: Fedore Core 3
Posts: 20

Original Poster
Rep: Reputation: 0
Super.... centerline{} worked. Thanks!

Although strange that \centering and \begin{center} ... \end{center} didn't?!?!?!?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LaTeX forum / Where to ask LaTeX questions? max_sipos Linux - Software 2 12-21-2011 01:01 PM
LaTeX commands: texi2pdf, latex, dvipdf kaon Linux - Software 7 01-23-2005 04:32 PM
cannot insert latex environment using emacs (C-c C-e) with auctex parv Linux - Software 6 09-02-2004 02:19 AM
LaTeX pHoeNIgS Linux - Software 6 09-17-2003 01:09 PM
I don't have latex Crickit Linux - Software 3 05-07-2003 07:33 AM


All times are GMT -5. The time now is 07:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration