[texhax] Can I invoke some tex command at commank like this?
E. Krishnan
ekmath at md5.vsnl.net.in
Fri Sep 26 21:49:17 CEST 2003
On Fri, 26 Sep 2003, Chakrit Nimmanant wrote:
> As you can see, TeX is very useful to determine
> the dimension of my "Evam". So,I want to invoke some
> TeX commands on standard input which can receive
> "Evam" as a parameter and returns a value of \wd0 to
> my standard output.
This is how I'd go about it in LaTeX:
Make a file named boxdim.tex contining the lines
\documentclass{article}
\begin{document}
\newlength{\boxwd}
\newlength{\boxht}
\newlength{\boxdp}
\typeout{}
\typein[\boxname]{Please type the box content}
\typeout{}
\settowidth{\boxwd}{\boxname}
\settowidth{\boxht}{\boxname}
\settodepth{\boxdp}{\boxname}
\typeout{}
\typeout{These are the dimensions of the box}
\typeout{}
\typeout{width = \the\boxwd}
\typeout{}
\typeout{height = \the\boxht}
\typeout{}
\typeout{depth = \the\boxdp}
\typeout{}
\end{document}
and compile the file with LaTeX.
(The empty "typeouts" are just cosmetic.)
--
Krishnan
More information about the texhax
mailing list