63 lines
1.2 KiB
TeX
63 lines
1.2 KiB
TeX
\documentclass[10pt,dvips]{article}
|
|
\usepackage{amsmath}
|
|
\usepackage{amssymb}
|
|
\usepackage[usenames]{color}
|
|
\usepackage{ifxetex}
|
|
\usepackage{ifluatex}
|
|
|
|
% XeLaTeX compiler
|
|
\ifxetex
|
|
|
|
\usepackage{fontspec}
|
|
\usepackage{unicode-math}
|
|
|
|
% Uncomment these lines for alternative fonts
|
|
%\setmainfont{FreeSerif}
|
|
%\setmathfont{FreeSerif}
|
|
|
|
% LuaLaTeX compiler
|
|
\else\ifluatex
|
|
|
|
\usepackage{fontspec}
|
|
\usepackage{lualatex-math}
|
|
|
|
% LaTeX compiler
|
|
\else
|
|
|
|
% Uncomment this line for sans-serif maths font
|
|
%\everymath{\mathsf{\xdef\mysf{\mathgroup\the\mathgroup\relax}}\mysf}
|
|
|
|
\fi\fi
|
|
|
|
|
|
|
|
|
|
\pagestyle{empty}
|
|
\begin{document}
|
|
|
|
\newsavebox{\eqbox}
|
|
\newlength{\width}
|
|
\newlength{\height}
|
|
\newlength{\depth}
|
|
|
|
\begin{lrbox}{\eqbox}
|
|
\begin{math}
|
|
\displaystyle 12/b^2
|
|
|
|
\end{math}
|
|
\end{lrbox}
|
|
|
|
\settowidth {\width} {\usebox{\eqbox}}
|
|
\settoheight{\height} {\usebox{\eqbox}}
|
|
\settodepth {\depth} {\usebox{\eqbox}}
|
|
\newwrite\file
|
|
\immediate\openout\file=\jobname.bsl
|
|
\immediate\write\file{Depth = \the\depth}
|
|
\immediate\write\file{Height = \the\height}
|
|
\addtolength{\height} {\depth}
|
|
\immediate\write\file{TotalHeight = \the\height}
|
|
\immediate\write\file{Width = \the\width}
|
|
\closeout\file
|
|
\usebox{\eqbox}
|
|
\end{document}
|