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.

Using minipage, is posible to split the (a) (b) letters above any figures, in order to perfectly center them?

enter image description here

\begin{figure}[tpb]
            \subfloat[]{
               \begin{minipage}{0.45\linewidth}   %tamaño
                   \includegraphics[width=1\columnwidth,keepaspectratio]{matlab/pdr_12345_p.pdf}
                \end{minipage}}  
            \subfloat[]{
            \hspace{5mm}    \begin{minipage}{0.45\linewidth}
                    \includegraphics[width=1\columnwidth,keepaspectratio]{matlab/pdr_11111_p.pdf}

                \end{minipage}} 
    \end{figure}

thanks in advance!

share|improve this question
add comment

1 Answer 1

You could use the subcaption package to induce an automatic line break between the caption's "number" (letter, actually) and text. The subcaption package also provides the environment subfigure (plus subtable); using it allows you to combine \subfloat directive and minipage environment into a single environment.

The following MWE shows how this may done. (Note that I haven't provided a caption for the overall figure float as your example didn't seem to require one.)

\documentclass[a4paper,twoside]{report}
\usepackage{subcaption}
\captionsetup[sub]{labelsep=newline}
\usepackage[demo]{graphicx} % remove '[demo]' for real version
\begin{document}
\begin{figure}
   \begin{subfigure}{0.45\linewidth}   
      \includegraphics[width=\columnwidth,keepaspectratio]{matlab/pdr_12345_p.pdf}
      \caption{First Subfigure}
   \end{subfigure}
   \hspace{\fill}   % separate the two subfigures as much as possible
   \begin{subfigure}{0.45\linewidth}
      \includegraphics[width=\columnwidth,keepaspectratio]{matlab/pdr_11111_p.pdf}
      \caption{Second Subfigure}
   \end{subfigure} 
\end{figure}

\end{document}

enter image description here

share|improve this answer
add comment

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.