emath BBS

新規発言一覧最新記事過去一覧検索HOME

No.1157  Re:\Deruta を zayou 環境内で使えないのでしょうか
発言者: 石原 守
発言日: 2004 05/29 13:41
発言元: ntchba034214.chba.nt.adsl.ppp.infoweb.ne.jp

% http://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa/23663.html
% を利用して\Derutaもどきを作ってみました。ちょっと長いですが。
\documentclass{jarticle}
\usepackage{epic,eepic}
\usepackage[debug]{emathPs}
\pagestyle{empty}
\makeatletter
\def\simpleslantbox#1#2{% #1: angle (|#1| <= 30 degree), #2: text
%%% tau := tan(angle)
   \leavevmode
   \begingroup
   \setbox\@tempboxa\hbox{#2}%
   \dimen@#1\p@
   \ifdim\dimen@<\z@
      \def\@tempa{-#1}%
      \def\@hcorr{\the\@tempdima}%
   \else
      \def\@tempa{#1}%
      \def\@hcorr{\z@}%
   \fi
   \expandafter\CalculateTan\expandafter{\@tempa}%
   \@tempdima\ht\@tempboxa \@tempdima \UseTan\@tempa \@tempdima
   \edef\@hcorr{\@hcorr}%
   \advance\@tempdima\wd\@tempboxa
   \@tempdimb\ht\@tempboxa \@tempdimc\dp\@tempboxa
   \CalculateTan{#1}%
   \dimen@ \UseTan{#1}\p@ \divide\dimen@\tw@
   \edef\@x{\strip@pt\dimen@}%%% \@x = tau / 2
   \dimen@\@x\p@ \dimen@\@x\dimen@
   \edef\@xx{\strip@pt\dimen@}%%% \@xx = (tau / 2)^2
   \setbox\z@\hbox{%
      \@find@rotate@angle
      \@find@scaling@factor
      \wd\@tempboxa\z@ \ht\@tempboxa\z@ \dp\@tempboxa\z@%%% (*)
      \hskip\@hcorr
      \rotatebox{\@angleii}%
         {\scalebox{\@factori}[\@factorii]%
            {\rotatebox{\@anglei}{\box\@tempboxa}}}}%
   \wd\z@\@tempdima \ht\z@\@tempdimb \dp\z@\@tempdimc%%% (*)
   \box\z@
   \endgroup}
\def\@find@rotate@angle{%
   \@tempdima\@x\p@ \@tempdimb\@x\p@ \count@\@ne
   \def\@tempsign{+}%
   \@whilenum9>\count@\do{%
      \advance\count@\tw@
      \edef\@tempsign{\if+\@tempsign -\else +\fi}%
      \@tempdimb\@xx\@tempdimb
      \dimen@\@tempdimb \divide\dimen@\count@
      \advance\@tempdima\dimen@}%
   \@tempdima-28.64789\@tempdima \advance\@tempdima 45\p@
   \edef\@anglei{\strip@pt\@tempdima}%%% pi / 4 - (arctan (tau / 2)) / 2
   \advance\@tempdima-90\p@
   \edef\@angleii{\strip@pt\@tempdima}}%%% \@angleii = \@anglei - (pi/2)
\def\@find@scaling@factor{%
   \@tempdima\p@ \@tempdimb\p@
   \@tempdimb \@xx\@tempdimb
   \dimen@\@tempdimb \divide\dimen@\tw@
   \advance\@tempdima \dimen@
   \@tempdimb \@xx\@tempdimb
   \dimen@\@tempdimb \divide\dimen@ 8
   \advance\@tempdima-\dimen@
   \@tempdimb \@xx\@tempdimb
   \dimen@\@tempdimb \divide\dimen@ 16
   \advance\@tempdima \dimen@
   \@tempdimb \@xx\@tempdimb
   \dimen@\@tempdimb \multiply\dimen@ 5 \divide\dimen@ 128
   \advance\@tempdima-\dimen@
   \dimen@\@tempdima \advance\dimen@-\@x\p@
   \edef\@factori{\strip@pt\dimen@}%%% sqrt((tau/2)^2 + 1) - (tau/2)
   \dimen@\@tempdima \advance\dimen@\@x\p@
   \edef\@factorii{\strip@pt\dimen@}}%%% sqrt((tau/2)^2 + 1) + (tau/2)
\makeatother
\DeclareRobustCommand{\Deruta}{\simpleslantbox{30}{Δ}}

\begin{document}
\begin{pszahyou}[ul=6mm](-1.5,5)(-1,5)
  \small%
  \def\Fx{.3*(X-.4)**2+1}%
  \YTen\Fx{1.8}\A%
  \YTen\Fx{3.5}\B%
  \YGurafu*[linewidth=1]\Fx%
  \Put\hidariT[n]{$y=f(x)$}%
  \Put\A[syaei=xy,xlabel=x,ylabel={f(x)}]{}%
  %\Put\B[syaei=xy,xlabel={x+\Delta x},ylabel={f(x+\Delta x)}]{}%
  \Put\B[syaei=xy,xlabel={x+\Deruta x},ylabel={f(x+\Deruta x)}]{}%----コンパイルが停止します
  \Put{(2.3,-.18)}[s]{$\gets$}%
  \Tyokusen\A\B{}{}%
  \kuromaru{\A;\B}%
  \setlinewidth{1}%
  \Hen_ko[20]{(3.5,0)}{(1.8,0)}{$\Deruta x$}%
\end{pszahyou}
\end{document}

▼関連発言

1156:\Deruta を zayou 環境内で使えないのでしょうか [穂積] 05/29 12:44
 ├1157:Re:\Deruta を zayou 環境内で使えないのでしょうか [石原 守] 05/29 13:41
 └1158:Re:\Deruta を zayou 環境内で使えないのでしょうか [tDB] 05/29 14:04
  └1159:Re[2]:\Deruta を zayou 環境内で使えないのでしょうか [穂積] 05/29 15:00
   └1160:Re[3]:\Deruta を zayou 環境内で使えないのでしょうか [tDB] 05/29 15:21
    └1161:Re[4]:\Deruta を pszayou 環境内で使用 解決しました [穂積] 05/29 16:18<-last

Pass 保存


CGIROOM