Re: xymtexでクメンを書く(何度もすいません)

名前: 藤田@京都工芸繊維大学
日時: 2003-09-11 10:58:41
IPアドレス: 133.16.167.*

>>21677 藤田@京都工芸繊維大学です. 次のソースリストをLaTeXにかけてください. \documentclass{jarticle} \usepackage{carom,aliphat,polymers,chemist,epic} \makeatletter %revised 2003/9/11 by S. Fujita \def\tetrahedral{\@ifnextchar[{\@tetrahedral[r}{\@tetrahedral[r]}} \def\@tetrahedral#1]#2{% \@reset@ylsw% \yltetrahedralposition{#2}% \if@ylsw \ifx\@@ylii\empty \def\@@ylii{0}\def\@@yli{0}\fi \fi \begin{ShiftPicEnvB}(0,0)(-\yl@shiftii,-\yl@shifti)/% (600,600)(-300,-300){tetrahedral}%2002/4/30 by S. Fujita (300,300)% \@tfor\member:=#1\do{% \expandafter\twoch@@r\member{}{}% \if\@@tmpa 0\relax {\putratom{47}{50}{\scriptsize\@@tmpb}}\fi}% \@tempdima=0pt \@forsemicol\member:=#2\do{% \ifx\member\empty\else \expandafter\@m@mb@r\member;\relax% \expandafter\threech@r\@membera{}{}% \ifx\@memberb\@yl\else \ifcase\@tmpa \setbox9=\hbox{\@memberb}% \ifdim\wd9<0.72em \@tempdima=0.72em {\putlratom{-40}{-33}{\hbox to.72em{\hss\@memberb\hss}}}% \else \ifWest@bond \@tempdima=\wd9 {\putlratom{-40}{-33}{\hbox to.72em{\hss\@memberb}}}%central atom %%%\global\West@bondfalse \else \@tempdima=\wd9 {\putlratom{-40}{-33}{\hbox to.72em{\@memberb\hss}}}%central atom \fi\fi \else%%no action \fi%end of ifcase \fi\fi}% %%%% \@forsemicol\member:=#2\do{% \ifx\member\empty\else \expandafter\@m@mb@r\member;\relax% \expandafter\threech@r\@membera{}{}% \ifx\@memberb\@yl\else \ifcase\@tmpa \or \ifWest@bond \Put@Direct(0,0){\kern-\@tempdima\kern0.72em\Northbond}% \else \Put@Direct(0,0){\Northbond}% \fi \or{% \ifWest@bond \Put@Direct(0,0){\kern-\@tempdima\kern0.72em\Westbond}% \else \Put@Direct(0,0){\Westbond}% \fi }% \or \ifWest@bond \Put@Direct(0,0){\kern-\@tempdima\kern0.72em\Southbond}% \else \Put@Direct(0,0){\Southbond}% \fi \or{% \advance\@tempdima by-0.72em \Put@Direct(0,0){\kern\@tempdima\Eastbond}} \fi%end of ifcase \fi\fi}% \end{ShiftPicEnvB}% \West@bondfalse \East@bondfalse }%end of macro tetrahedral \newif\ifEast@bond \newif\ifWest@bond \def\yltetrahedralposition#1{% \@@ylswfalse%%%\@reset@ylsw \West@bondfalse \East@bondfalse \@forsemicol\member:=#1\do{% \if@@ylsw\else \ifx\member\empty\else \expandafter\@m@mb@r\member;\relax \expandafter\threech@r\@membera{}{}\relax \ifx\@memberb\@yl\relax\@@ylswtrue\else\@@ylswfalse\fi \if@@ylsw \ifcase\@tmpa \or \gdef\@ylii{0}\gdef\@yli{-52}\global\@ylswtrue%N subst. on 1 \or \gdef\@ylii{52}\gdef\@yli{0}\global\@ylswtrue% \global\East@bondtrue%W subst. on 1 \or \gdef\@ylii{0}\gdef\@yli{52}\global\@ylswtrue%S subst. on 1 \or \gdef\@ylii{-52}\gdef\@yli{0}\global\@ylswtrue% \global\West@bondtrue%E subst. on 1 \fi%end of ifcase \fi\fi\fi}}% \makeatother \begin{document} \XyMTeX{}の作者の藤田@京都工芸繊維大学です. \verb/\tetrahedral/の現在の仕様では,中心原子を 一文字に限定し,中央揃えで出力しています.この仕様は, これまでにも,Si化合物や有機金属化合物を出力するような場合に, 不便であるとの指摘がありました.次のVersion 4で対処するつもりにしていますが, とりあえずは,上記のように改訂したものを使ってください. \begin{enumerate} \item 金属化合物などの例 \tetrahedral{0==Si;4==CH$_{3}$;2==CH$_{3}$;1==OCH$_{3}$;3==OCH$_{3}$} \tetrahedral{0==Sn;1==C$_{4}$H$_{9}$-$n$;% 3==C$_{4}$H$_{9}$-$n$;2==$n$-C$_{4}$H$_{9}$;4==Cl} \item 四級アンモニウム塩については,これまでは, \tetrahedral{0==N\rlap{$^{^{+}}$};4==CH$_{3}$;2==CH$_{3}$;% 1==CH$_{2}$CH$_{3}$;3==CH$_{2}$CH$_{3}$} \tetrahedral[{0+}]{0==N;4==CH$_{3}$;2==CH$_{3}$;% 1==CH$_{2}$CH$_{3}$;3==CH$_{2}$CH$_{3}$} \noindent のようにしていましたが,つぎのような出力も可能になりました. もっとも,この出力には好き嫌いがありそうですが. \tetrahedral{0==N$^{+}$;4==CH$_{3}$;2==CH$_{3}$;% 1==CH$_{2}$CH$_{3}$;3==CH$_{2}$CH$_{3}$} \item クメンについて, \bzdrh{4==\tetrahedral{2==(yl);0==CH;1==CH$_{3}$;4==CH$_{3}$}} \noindent のような出力が可能です. \item 左勝手の出力も,可能にしてあります. \begin{XyMcompd}(1000,500)(-400,200){cpd:1}{} \bzdrh{1==\tetrahedral{4==(yl);0==CH;1==CH$_{3}$;2==CH$_{3}$}} \end{XyMcompd} \fbox{% \begin{XyMcompd}(900,600)(-300,100){cpd:2}{} \bzdrh{1==\tetrahedral{4==(yl);0==Si;1==CH$_{3}$;2==CH$_{3}$;3==CH$_{3}$}} \end{XyMcompd}} \fbox{% \begin{XyMcompd}(900,600)(300,100){cpd:3}{} \bzdrh{4==\tetrahedral{2==(yl);0==Si;1==CH$_{3}$;4==CH$_{3}$;3==CH$_{3}$}} \end{XyMcompd}} ついでに,XyMcompd環境も紹介しておきます (あまり使っているのを見たことがないので). 化合物の領域を規定するのに使えるのと, \cref{cpd:1}のように化合物番号の参照ができます. 上の例の\cref{cpd:2}と\cref{cpd:3}では 領域を示すためにさらに\verb/\fbox/で囲んであります. \item クメンについては, 次のように\verb/\rtrigonal/命令を使うのも よいとおもいます. \bzdrh{4==\rtrigonal{0==CH;3==CH$_3$;2==CH$_3$;1==(yl)}} \bzdrh{4==\Rtrigonal{0==CH;3==CH$_3$;2==CH$_3$;1==(yl)}} \end{enumerate} \end{document}

この書き込みへの返事:

お名前
題名 
メッセージ(タグは <a href="...">...</a> だけ使えます)