5

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}
  • The \newline is in this line of your code: \psframebox[]{stop}\\`. Just remove the \\`. – Stefan Kottwitz Aug 25 '10 at 22:40
7

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}
}}
6

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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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