Vertical alignment of subfigures LATEX

前端 未结 4 1056
执笔经年
执笔经年 2021-01-31 04:04

I am working on my thesis and I am struggling with placing 2 images next to each other, so that the second image would be centered vertically along the first one. I was also try

4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 04:48

    Edit: it seems like subfig package has problems, particularly when working with hyperref. In that case, try subcaption package as mentioned in this answer.

    If you use subfig package, you can do this easily. The solution is in section 5.4 of the manual:

    \newsavebox{\tempbox}
    \begin{figure}[H]
    \sbox{\tempbox}{\includegraphics[width=0.28\textwidth]{sparsesmall}}
    \subfloat[sparse($\mathbf{A}$)]{\usebox{\tempbox}\label{sparse}}%
    \qquad
    \subfloat[full($\mathbf{A}$)]{\vbox to \ht\tempbox{%
      \vfil
      \includegraphics[width=0.55\textwidth]{fullsmall}
      \vfil}\label{full}}%
      \caption{Representation of $\mathbf{A}$ in MATLAB}\label{schematic}
    \end{figure}
    

    I haven't tested it, and there may be typos, but it should work.

提交回复
热议问题