垂直に揃えられたサブフロートキャプションは折り返しを防止します

垂直に揃えられたサブフロートキャプションは折り返しを防止します

これについていろいろ調べてみましたが、私の特定のドキュメントに対する解決策を見つけることができませんでした。

使用これ回答 幅の異なる2つの画像を並べて配置しました。

画像 (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上の画像では左の画像の両側に使用しました。その他のオプションについては、水平間隔を設定するためのコマンドは何ですか?

関連情報