Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following flow chart but it appears uncentered. How can I center it?

\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{pst-blur}
\pagestyle{empty}

\begin{document}
\begin{center}
\psframebox[linearc=5mm,cornersize=absolute]{%
\begin{psmatrix}[rowsep=0.6,colsep=0.5]
\psovalbox[fillstyle=solid]{Begin} &
\psframebox[]{ChIP-seq} &
\psframebox[]{align to genome} &
\psdblframebox[framearc=.4,fillstyle=solid]{Find peaks} &
\psdblframebox[framearc=.4,fillstyle=solid]{Thresholding} &
\psdblframebox[framearc=.4,fillstyle=solid]{Analysis} &
\psframebox[]{stop} 
\ncline{->}{1,1}{1,2}
\ncline{->}{1,2}{1,3}
\ncline{->}{1,3}{1,4}
\ncline{->}{1,4}{1,5}
\ncline{->}{1,5}{1,6}
\ncline{->}{1,6}{1,7}
\end{psmatrix}}
\end{center}

\end{document}
share|improve this question
    
The \newline is in this line of your code: \psframebox[]{stop}\\`. Just remove the \\`. –  Stefan Kottwitz Aug 25 '10 at 22:40
    
My bad. Thanks @Stefan. –  denilw Aug 26 '10 at 16:29

2 Answers 2

up vote 6 down vote accepted

As frabjous already mentioned, the image is just too big and either image or margins require adjustment.

But there's trick how you can center oversized images: use \makebox. This way even your wide image gets properly centered:

\noindent\makebox[\textwidth]{%
\psframebox[linearc=5mm,cornersize=absolute]{%
\begin{psmatrix}
  ...
\end{psmatrix}
}}
share|improve this answer

As near as I can tell the only reason it isn't centered as it is that it is too large to fit within the margins. You have several options:

  • Scale the image down (sent the fonts smaller and the dimensions as well)
  • Change the paper size or margins with something like the geometry package
  • Put the page or the document as a whole in landscape mode

It is difficult to tell which of these options is the best without knowing more about the context.

share|improve this answer
    
Thank you for the answer, it was informative +1. I would prefer to center the image anyways through a hack rather than scale down in this case. –  denilw Aug 25 '10 at 21:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.