我的代码如下:
\documentclass{book}
\usepackage{graphicx}
\newbox\fightbox
\newcount\fightcount
\newcommand{\test}[1]{
\setbox\fightbox=\vbox{#1}%184.99pt
}
\begin{document}
\test{\includegraphics{./images/c02f001.pdf}}
\showthe\ht\fightbox
Running text
\end{document}
当我进行编译时,LaTeX 告诉框值是184.99954pt
,但我只需要提取值,即184.9954
仅提取pt
不需要的值,这可能吗?
答案1
用于\strip@pt
删除尺寸:
\documentclass{book}
\usepackage{graphicx}
\newbox\fightbox
\newcount\fightcount
\newcommand{\test}[1]{
\setbox\fightbox=\vbox{#1}%184.99pt
}
\begin{document}
\test{\includegraphics{example-image}}
\makeatletter
\strip@pt\ht\fightbox
\makeatother
Running text
\end{document}