Re: 単位つきの数字から数字のみを取り出したい

名前: トノ
日時: 2007-03-09 18:56:44
IPアドレス: 61.124.93.*

>>47362 》 また,こういった小数つきの数字ではなく,整数に丸める関数があれば, 「丸める」というのが、単に小数部分の無視(絶対値の小さい方への切り捨てに なる)で構わないなら、以下のような方法でもできそうです。 \documentclass{jarticle}\relax \makeatletter \def\strip@pt@int{\expandafter\strip@pt@int@\the} \begingroup \catcode`\^^P=12 \lccode`\^^P=`\p \catcode`\^^T=12 \lccode`\^^T=`\t \lowercase{\@temptokena={% \def\strip@pt@int@#1.#2^^P^^T{#1}% }} \expandafter \endgroup \the\@temptokena \makeatother \begin{document} \newbox\A \setbox\A=\hbox{あいうえお} \the\wd\A \the\ht\A \the\dp\A \makeatletter \strip@pt@int\wd\A \quad \strip@pt@int\ht\A \quad \strip@pt@int\dp\A \makeatother \end{document}

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます。適宜改行を入れてください)