[texhax] Character Box values

Uwe Lück uwe.lueck at web.de
Thu Sep 8 13:14:20 CEST 2005

>Is there any way to get Box values (width, height, depth) of some
>particular character? Actually I want to write diagonally by placing
>top-left corner of each character box at lower-right corner of the
>preceding character. Is it possible and how? Thanks

In general: TeX provides \wd, \ht, \dp, which could be applied to
\hbox{<character>}. LaTeX provides \settowidth etc. as in E. Krishnan's
suggestion. It is often helpful to have a look at manuals or tutorials.

Specifically: 1.) E. Krishnan's suggestion could be extended to
define a loop that could be applied to an arbitrary number of characters
in the string. 2.) A very  different approach where measuring is left to
TeX's internals: Determine the number N of characters, then set up
an alignment (LaTeX: tabular) with N columns, execute a \cr or \\ after
each character, precede the next character with n &'s when n characters
have been processed so far (use a double-loop). -- Of  course
implementing both of these algorithms needs some basic skill in
programming and basic knowledge of  TeX or LaTeX and some portion
of an hour to type in and to debug, depending on practice -- even this rough
sketch costed me at least 15 minutes (including debugging the wordings).
Personally I am very adverse to type loops, even when the algorithm is clear.

Lucky typesetting,
Uwe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/texhax/attachments/20050908/db24fe1c/attachment.htm