発言者: 石原 守
発言日: 2008 01/22 08:00
発言元: 210.153.95.1
emath.sty と emathPh.sty の両方で定義されているようですね。
emath.sty の定義を生かすとだいじょうぶなようです。
\documentclass{jarticle}
\usepackage{graphicx,color}
\usepackage{emathPh}
% emath.sty から抜粋
\makeatletter
%
% 訂正
% \teisei[#1](#2)#3[#4]
% #1: 線の引き方についてのオプション引数で,
% s : 斜線(/) [デフォルト]
% r : 斜線(\)
% h : 横線
% d : 横二本線
% #2: 線の色
% #3: 線を引く対象
% #4: 訂正後の文字列
%
%{\catcode`\p=12\catcode`\t=12\gdef\@mumeisuu#1pt{#1}}%
%\def\mumeisuu#1{\expandafter\@mumeisuu\the#1}%
\def\mumeisuu#1{\strip@pt#1}%
\def\@Mumeisuu#1pt\@nil{#1}
\def\Mumeisuu#1{\expandafter\@Mumeisuu#1\@nil}
%\def\Mumeisuu#1#2{\setlength{\@tempdima}{#1}\edef#2{\strip@pt\@tempdima}}
\@ifundefined{syasen}{\def\syasen{\drawline}}{}%
\def\teisei{%
\@ifnextchar[{\@teisei}{\@teisei[s]}}%
\def\@teisei[#1]{%
\@ifnextchar({\@teisei@[#1]}{\@teisei@[#1](\empty)}}%
\def\@teisei@[#1](#2)#3{%
\@ifnextchar[{\@@teisei[#1](#2)#3}{\@@teisei[#1](#2){#3}[\empty]}}%
\def\@@teisei[#1](#2)#3[#4]{{\unitlength\p@
\ifmmode\setbox0\hbox{$#3$}\else\setbox0\hbox{#3}\fi
\ifx\empty#4\relax{%
\ifx\empty#2\else\color{#2}\fi%
\begin{picture}(0,0)%
\if#1r\relax
\syasen(0,\strip@pt\ht0)(\strip@pt\wd0,-\strip@pt\dp0)%
\else\if#1h\relax
\setlength{\templa}{\ht0}\addtolength{\templa}{-\dp0}%
\divide\templa by 2\relax
\syasen(0,\strip@pt\templa)(\strip@pt\wd0,\strip@pt\templa)%
\else\if#1d\relax
\setlength{\templa}{\ht0}\addtolength{\templa}{-\dp0}%
\divide\templa by 2\relax
\setlength{\templb}{\templa}\addtolength{\templb}{-0.8pt}%
\setlength{\templc}{\templa}\addtolength{\templc}{1.2pt}%
\syasen(0,\strip@pt\templb)(\strip@pt\wd0,\strip@pt\templb)%
\syasen(0,\strip@pt\templc)(\strip@pt\wd0,\strip@pt\templc)%
\else\if#1x\relax
\syasen(0,-\strip@pt\dp0)(\strip@pt\wd0,\strip@pt\ht0)%
\syasen(0,\strip@pt\ht0)(\strip@pt\wd0,-\strip@pt\dp0)%
\else\if#1S\relax
\put(0,1){\syasen(0,-\strip@pt\dp0)(\strip@pt\wd0,\strip@pt\ht0)}%
\put(0,-1){\syasen(0,-\strip@pt\dp0)(\strip@pt\wd0,\strip@pt\ht0)}%
\else
\syasen(0,-\strip@pt\dp0)(\strip@pt\wd0,\strip@pt\ht0)%
\fi\fi\fi\fi\fi
\end{picture}}\box0%
\else%
\ifmmode\setbox1\hbox{$#4$}\else\setbox1\hbox{#4}\fi
\ensuremath{\stackrel{\box1}{{%
\ifx\empty#2\else\color{#2}\fi%
\begin{picture}(0,0)%
\if#1r\relax
\syasen(0,\strip@pt\ht0)(\strip@pt\wd0,-\strip@pt\dp0)%
\else\if#1h\relax
\setlength{\templa}{\ht0}\addtolength{\templa}{-\dp0}%
\divide\templa by 2\relax
\syasen(0,\strip@pt\templa)(\strip@pt\wd0,\strip@pt\templa)%
\else\if#1d\relax
\setlength{\templa}{\ht0}\addtolength{\templa}{-\dp0}%
\divide\templa by 2\relax
\setlength{\templb}{\templa}\addtolength{\templb}{-0.8pt}%
\setlength{\templc}{\templa}\addtolength{\templc}{1.2pt}%
\syasen(0,\strip@pt\templb)(\strip@pt\wd0,\strip@pt\templb)%
\syasen(0,\strip@pt\templc)(\strip@pt\wd0,\strip@pt\templc)%
\else\if#1S\relax
\put(0,1){\syasen(0,-\strip@pt\dp0)(\strip@pt\wd0,\strip@pt\ht0)}%
\put(0,-1){\syasen(0,-\strip@pt\dp0)(\strip@pt\wd0,\strip@pt\ht0)}%
\else
\syasen(0,-\strip@pt\dp0)(\strip@pt\wd0,\strip@pt\ht0)%
\fi\fi\fi\fi
\end{picture}}\box0\relax
}}%
\fi%
}}%
%
% 訂正(拡張版)数式モードで使用すること.
%\teisei との違いは,
% 0.数式モードの中,という前提を付けた.
% 1.訂正後の文字列はオプション引数ではなく,必須の引数とした.
% 2.訂正後の文字列は小さめになった (scriptstyle)
% 3.訂正後の文字列の位置をオプションで
% 左上 上 右上(デフォルト)
% 左下 下 右下
% の6ヶ所を指定することができるようにした.
%
% \Teisei[#1](#2)#3[#4]#5
% #1: 線の引き方についてのオプション引数で,
% s : 斜線(/) [デフォルト]
% r : 斜線(\)
% h : 横線
% d : 横二本線
% #2: 線の色
% #3: 線を引く対象
% #4: 訂正後の文字位置
% r = 右上 (=tr=rt)(デフォルト)
% l = 左上 (=tl=lt)
% t = 上
% b = 下
% rb=br=右下
% lb=bl=左下
% #5: 訂正後の文字列 (scriptstyle)
%
\def\Teisei{%
\@ifnextchar[{\@Teisei}{\@Teisei[s]}}%
\def\@Teisei[#1]{%
\@ifnextchar({\@Teisei@[#1]}{\@Teisei[#1](\empty)}}%
\def\@Teisei@[#1](#2)#3{%
\@ifnextchar[{\@@Teisei[#1](#2){#3}}{\@@Teisei[#1](#2){#3}[r]}}%
\def\@@Teisei[#1](#2)#3[#4]#5{{%
\edef\mozi@iti{0}%
% 4 0 2
% {#3}
% 5 1 3
\expandafter\@tfor\expandafter\@c\expandafter:\expandafter=#4%
\do {\if r\@c\IAdd\mozi@iti{2}\mozi@iti\else
\if l\@c\IAdd\mozi@iti{4}\mozi@iti\else
\if b\@c\IAdd\mozi@iti{1}\mozi@iti\fi\fi\fi}%
\ifx\empty#5\@teisei@[#1](#2){#3}{}\else%
\ifcase\mozi@iti\overset{#5}{\@teisei@[#1](#2){#3}{}}%
\or\underset{#5}{\@teisei@[#1](#2){#3}{}}%
\or{\@teisei@[#1](#2){#3}{}}^{\,{#5}}%
\or{\@teisei@[#1](#2){#3}{}}_{\,{#5}}%
\or{}^{#5}{\@teisei@[#1](#2){#3}{}}%
\or{}_{#5}{\@teisei@[#1](#2){#3}{}}\fi
\fi}}%
\makeatother
\begin{document}
$\bunsuu{\Teisei(white){5}{\phantom{2}}}{\Teisei{6}{2}}
\times \bunsuu{\Teisei{9}{3}}{\Teisei(white){4}{\phantom{3}}}
= \bunsuu{15}{8}$
\end{document}
▼関連発言
│
└◆6980:Kz-graph.texについて [st] 01/18 11:18
└◆6982:Re:Kz-graph.texについて [tDB] 01/18 17:11
└◆6983:Re[2]:Kz-graph.texについて [st] 01/21 08:52
└◆6984:Re[3]:Kz-graph.texについて [tDB] 01/21 17:13
└◆6985:Re[4]:Kz-graph.texについて [st] 01/21 17:46
└◆6986:Re[5]:Teisei [石原 守] 01/22 08:00
└◆7003:Re[6]:Teisei [st] 01/23 12:33<-last