答案1
如果您将图像放入,则可以从包中\box
获取其高度。然后可以给出一个可选参数来指定该框的高度,例如\heightof
calc
\parbox
https://en.wikibooks.org/wiki/LaTeX/Boxes。
\documentclass{article}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{calc}
\newsavebox\PictureBox
\begin{document}
\lipsum[1]
\begin{figure}[htb]
\centering
\sbox\PictureBox{%
\includegraphics[width=0.5\linewidth,height=0.5\linewidth]{example-image}}
\usebox\PictureBox\
\fboxsep=0pt%
\raisebox{\fboxrule}{\fbox{%
\parbox[b][\heightof{\usebox\PictureBox}-\fboxrule-\fboxrule][t]{0.4\linewidth}{%
\begin{itemize}
\item Ellipse
\item Circle
\item Square
\item Triangle
\item
\end{itemize}%
}}}
\caption{How can we write this?}
\label{fig:HowToWrite}
\end{figure}
\lipsum[2]
\end{document}