如何插入一张高度为文本高度30%的图片?

如何插入一张高度为文本高度30%的图片?

有什么用处?

\begin{figure} 
 \item { \includegraphics[height=0.3\lineheight]{./images/filename} 
} 
\end{figure} 

答案1

基线之间的正常距离是\baselineskip

\includegraphics[height=.3\baselineskip]{...}

或者可以计算高度,例如:

\newdimen\MyLineHeight % goes into the preamble
...
\settoheight{\MyLineHeight}{H}%
\includegraphics[height=.3\MyLineHeight]{...}

或者使用包calc

\usepackage{calc}% goes into the preamble
...
\includegraphics[height=\heightof{H}*3/10]{...}

相关内容