问题描述
我正在写我的论文,我正在努力将 2 个图像彼此相邻放置,以便第二个图像将沿着第一个图像垂直居中.我也尝试使用 subfigure
而不是 subfloat
但它们都不起作用.
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 trying to use subfigure
instead of subfloat
but neither of them works.
这是 alt 文本 http://img51.imageshack.us/img51/1174/screenshot20100224at712 的外观.png
我的代码是:
egin{figure}[H]
centering subfloat[H][sparse($mathbf{A}$)]{includegraphics[width=0.28 extwidth]{sparsesmall} label{sparse}}
subfloat[H][full($mathbf{A}$)]{includegraphics[width=0.55 extwidth]{fullsmall}label{full}}
caption{Representation of $mathbf{A}$ in MATLAB}
label{schematic}
end{figure}
有什么建议可以让它看起来比现在更好吗?谢谢
Any suggestions to make it look better than now? Thx
推荐答案
编辑:似乎 subfig
包有问题,尤其是在使用 hyperref 时.在这种情况下,请尝试 this answer 中提到的 subcaption
包.
Edit: it seems like subfig
package has problems, particularly when working with hyperref. In that case, try subcaption
package as mentioned in this answer.
如果你使用 subfig
包,你可以轻松做到这一点.解决方案在手册的第5.4节:p>
If you use subfig
package, you can do this easily. The solution is in section 5.4 of the manual:
ewsavebox{ empbox}
egin{figure}[H]
sbox{ empbox}{includegraphics[width=0.28 extwidth]{sparsesmall}}
subfloat[sparse($mathbf{A}$)]{usebox{ empbox}label{sparse}}%
qquad
subfloat[full($mathbf{A}$)]{vbox to ht empbox{%
vfil
includegraphics[width=0.55 extwidth]{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.
这篇关于子图的垂直对齐 LATEX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!