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 am trying to show a set of pictures using subfigure. The first line seems OK, but the second line has a different alignment than the first line, even though the two lines are exactly the same. How can I fix it?

Code:

\begin{figure*}
    \centering
        \begin{subfigure}
                \centering
                \includegraphics[width=\imagewidth,height=\imageheigth]{image1}
        \end{subfigure}
        ~
        \begin{subfigure}
                \centering
                \includegraphics[width=\imagewidth,height=\imageheigth]{image2}
        \end{subfigure}


    ..............
    ..............
    ~
    \begin{subfigure}
            \centering
            \includegraphics[width=\imagewidth,height=\imageheigth]{imageN}
    \end{subfigure} \\
    ~
    \begin{subfigure}
            \centering
            \includegraphics[width=\imagewidth,height=\imageheigth]{image(N+1)}
    \end{subfigure}
    ..............
    ..............
    ~
     \begin{subfigure}
            \centering
            \includegraphics[width=\imagewidth,height=\imageheigth]{image(2N)}
    \end{subfigure}
    \caption{some stuff her} 
    \label{fig:stuff}
     \end{figure*}
share|improve this question
    
Do the imageN and image1 figures have the same size? –  percusse Jul 31 '12 at 11:33
    
Yes, figure sizes are exactly the same. –  rooter Jul 31 '12 at 11:36
    
Your code is just a fragment not showing relevant detail but the line starting \\ ~ has white space to the left of the leftmost figure so will be out of line. I would delete all the ~ (use \hspace{1cm} where you need space, it is clearer. and delete the \\ just use a blank line paragraph break. –  David Carlisle Jul 31 '12 at 12:09
add comment

closed as too localized by percusse, Torbjørn T., Joseph Wright Jul 31 '12 at 13:46

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

Ok, I solved it finally. The reason was a misplaced ~. Thanks for your support.

share|improve this answer
add comment

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