Please how to horizontally center-justify the following array of figures with the subfig
package ?
\documentclass[11pt]{article}
\usepackage[dvips]{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[htp]
\centering
\subfloat[From $n=0$ to $n=-1$]{\label{fig:a}
\includegraphics[scale=0.45]{Figures/IncludePyramid_a_reverse.eps}
}
\qquad\qquad\qquad
\subfloat[From $n=-1$ to $n=0$]{\label{fig:aa}
\includegraphics[scale=0.45]{Figures/IncludePyramid_a.eps}
} \\
\subfloat[From $n=-1$ to $n=-2$]{\label{fig:b}
\includegraphics[scale=0.45]{Figures/IncludePyramid_b_reverse.eps}
}
\qquad\qquad\qquad
\subfloat[From $n=-2$ to $n=-1$]{\label{fig:bb}
\includegraphics[scale=0.45]{Figures/IncludePyramid_b.eps}
}
\\
\subfloat[From $n=-2$ to $n=-3$]{\label{fig:c}
\includegraphics[scale=0.45]{Figures/IncludePyramid_c_reverse.eps}
}
\qquad\qquad\qquad
\subfloat[From $n=-3$ to $n=-2$]{\label{fig:cc}
\includegraphics[scale=0.45]{Figures/IncludePyramid_c.eps}
}
\caption{Random walk on the Pascal pyramid}
\label{fig:bratelli}
\end{figure}
\end{document}
Best Answer
You have to work a bit harder. The following set of macros sets each subfloat in a zero width box, so adding filling space will do.
The
\csubfloat
macro has the same syntax as\subfloat
; beware, though, that images should not fill the whole line.The
\centerhfill
macro has an optional argument, default\quad
to add a space in the center. If it's not enough, you can experiment with\centerhfill[\qquad]
.In the example I have used the
demo
option tographicx
; don't use it yourself, but don't adddvips
either.The
\fakeig
macro is just for producing the test and you don't need it; just remove the lines and uncomment the\includegraphics
ones.Note a generous usage of
%
to mask end-of-lines that act like spaces, which are not wanted.Another option would be to include each
\subfloat
in aminipage
as wide as half the\textwidth
, but you have less control about the center spacing; this could be modified using a fraction of\textwidth
, say\begin{minipage}{.8\textwidth}
or similar.