答案1
您可以记录起点和终点(在基线上),然后调整法线的高度和深度
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\makeatletter
\mbox{}\pdfsavepos\write\@auxout{\gdef\string\Ax{\the\pdflastxpos}\gdef\string\Ay{\the\pdflastypos}}%
\lipsum[1]%
\pdfsavepos\write\@auxout{\gdef\string\Bx{\the\pdflastxpos}\gdef\string\By{\the\pdflastypos}}
\ifx\Ax\@undefined\else
\typeout{Bounding box:
\the\dimexpr \Ax sp -\parindent\relax\space \the\dimexpr\By sp - \dp\strutbox\relax
\space
\the\dimexpr \Ax sp -\parindent+\textwidth\relax\space \the\dimexpr\Ay sp + \ht\strutbox\relax
}
\fi
\end{document}
我明白了
Bounding box: 134.26999pt 574.17682pt 479.26999pt 718.17682pt
假设文本不会超出页面(在这种情况下你需要做一些更复杂的事情)