Re: finding text width
- From: Ulrike Fischer <news2@xxxxxxxxxxx>
- Date: Tue, 30 Sep 2008 12:48:49 +0200
Am Tue, 30 Sep 2008 02:11:45 -0700 (PDT) schrieb texuser:
Dear Tex users,
I need to find the text width of a particular column inside a tabular
and print it along with the data. But my present code prints only the
width or data. Please help me to print both.
\box0 not only outputs a box but also empties the box. Use \copy:
\documentclass{article}
\usepackage{array}
\newlength{\mywidth}
\def\widh#1{\settowidth{\mywidth}{#1}\the\mywidth:#1}
\newcolumntype{R}{>{\width}r<{\endwidth}}
\def\width{\setbox0=\hbox\bgroup}
\def\endwidth{\egroup\widh{\copy0}\box0}
%\def\endwidth{\egroup\copy0\widh{\box0}}
\begin{document}
\widh{aaa}
\begin{tabular}{lRl}
Meek & dfdf & entry \\
Meek & sddsdsd & entry \\
\end{tabular}
\end{document}
--
Ulrike Fischer
.
- References:
- finding text width
- From: texuser
- finding text width
- Prev by Date: Re: Vertical spacing in algorithm2e seems very uneven
- Next by Date: Re: Vertical spacing in algorithm2e seems very uneven
- Previous by thread: finding text width
- Next by thread: Vertical spacing in algorithm2e seems very uneven
- Index(es):
Relevant Pages
|