
我已經對此進行了搜索,但無法找到適合我的特定文件的解決方案。
使用這回答 我並排放置了兩張不同寬度的圖像。
我希望圖像 (a) 的文字不換行。理想情況下,我希望圖像位於非換行標題上方的中心。
微量元素
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\newsavebox{\myimage}
\begin{figure}
\centering
\savebox{\myimage}{\hbox{\rule{150pt}{150pt}}}% Store largest image
\subfloat[First caption text is a bit longer and wraps.]{\usebox{\myimage}} \quad
\subfloat[Second fits on one line.]{\raisebox{\dimexpr.5\ht\myimage-.5\height\relax}{\rule{100pt}{20pt}}}
\caption{This is a figure.}
\end{figure}
\end{document}
答案1
只需在較大影像的一側添加一些空間即可。這將使標題不換行:
\documentclass{article}
\usepackage{graphicx,subfig}
\newsavebox{\myimage}
\begin{document}
\begin{figure}
\centering
\savebox{\myimage}{\hbox{\rule{150pt}{150pt}}}% Store largest image
\subfloat[First caption text is a bit longer and wraps.]{\quad\usebox{\myimage}\quad} \quad
\subfloat[Second fits on one line.]{\raisebox{\dimexpr.5\ht\myimage-.5\height}{\rule{100pt}{20pt}}}
\caption{This is a figure.}
\end{figure}
\end{document}
上面我\quad
在左圖的兩側使用了。有關更多選項,請參閱水平間距有哪些指令?