summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG27
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/README2
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf24
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdfbin281005 -> 281216 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex2
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf141
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdfbin588104 -> 590835 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex100
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdfbin172010 -> 172266 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex4
-rw-r--r--Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf167
11 files changed, 336 insertions, 131 deletions
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG b/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG
index 74ba391dbda..51a235a68b6 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG
@@ -1,6 +1,31 @@
*******************************************************************************
- Changelog of mcf2graph software package by Akira Yamaji 2019-05-11
+ Changelog of mcf2graph software package by Akira Yamaji 2019-05-26
*******************************************************************************
+[ver. 4.42 / 2019-05-26]
+ -add function for add()
+ plus : circled plus
+ minus : circled minus
+ lonepair : lonepair
+ -add binop for add()
+ a ** b : a scaled b
+ a /* b : point of b scaled a
+ -add variable for add()
+ A[n]up : dir An
+ A[n]left : dir An+90
+ A[n]right : dir An-90
+ A[n]down : dir An+180
+ B[n]up : dir Bn
+ B[n]left : dir Bn+90
+ B[n]right : dir Bn-90
+ B[n]down : dir Bn+180
+ -change variable for add()
+ A[n]dir => A[n]ang
+ A[n]ang : angle of An
+ B[n] => Bm[n]
+ B[n] : bond position => path
+ -improve label emulation
+ -update MCF manual
+
[ver. 4.41 / 2019-05-11]
-change syntax
|<=,=>| => |=,=|
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/README b/Master/texmf-dist/doc/metapost/mcf2graph/README
index 3cd62eb060f..eb58b0df7a7 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/README
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/README
@@ -1,7 +1,7 @@
********************************************************************************
mcf2graph : Convert Molecular Coding Format to graphics with METAFONT/METAPOST
Author : Akira Yamaji
- version : 4.41 2019-05-11
+ version : 4.42 2019-05-26
E-mail : mcf2graph@gmail.com
Located at : http://www.ctan.org/pkg/mcf2graph
********************************************************************************
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf
index c225b302cc2..67bb2b2aad6 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_exa_soc.mf
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Molecular Coding Format for mcf_example.tex by Akira Yamaji 2019.05.11
+% Molecular Coding Format for mcf_example.tex by Akira Yamaji 2019.05.26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-input mcf2graph.mf; %%% it must be version 4.41 or later
+input mcf2graph.mf; %%% it must be version 4.42 or later
%-------------------------------------------------------------------------
fsize:=(33mm,24mm);
max_blength:=4.5mm;
@@ -27,8 +27,6 @@ var4:="cal_MW"; tag4:="cMW";
%%%% sw_rep_out:=1;
%%%% sw_mol_out:=1;
%%%% outputformat:="png"; hppp:=vppp:=0.1; outputtemplate:="%j-%3c.png";
-%---------------------------------------------------------------------------
-%ext(defaultscale:=.5; label.bot(decimal(char_num)&":"&inf_EN,(.5w,0));)
%***************************************************************************
beginfont("EN:Acetamiprid","MW:222.676","FM:C10H11ClN4")
MC(<30,Ph,2:N,1:/Cl,4:\,!,N,/_,!,/_,!!,N,!,CN)
@@ -395,3 +393,21 @@ beginfont("EN:Atoropin","MW:289.375")
endfont
%***************************************************************************
bye
+wb:#,$3:/!OH~wv)
+endfont
+%***************************************************************************
+bye
+******************
+bye
+wb:#,$3:/!OH~wv)
+endfont
+%***************************************************************************
+bye
+e
+***********************************
+bye
+e
+e
+********************************
+bye
+e
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf
index ddb0920295e..128d46905f3 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex
index 8199e247681..5e26c477d72 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.tex
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Example of MCF typeset by LaTeX mcf_examples.tex by A.Yamaji 2019.05.11
+% Example of MCF typeset by LaTeX mcf_examples.tex by A.Yamaji 2019.05.26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper]{article}
\usepackage{graphicx}
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf
index f0b051ade6b..65e65761a6d 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2019.05.11
+% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2019.05.26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-input mcf2graph.mf; %% it must be version 4.41 or later
+input mcf2graph.mf; %% it must be version 4.42 or later
%------------------------------------------------------------------------
sw_mframe:=0;
sw_expand:=0;
@@ -114,18 +114,12 @@ beginfont("EN:Chain 1")
add(
defaultscale:=0.5;
labeloffset:=2bp;
- drawarrow .7[B7s,B7e]{dir(B7dir-90)}..{dir(B1dir-90)}.7[B1s,B1e];
- label.ulft("-30",.7[B7s,B7e]);
- drawarrow .7[B8s,B8e]{dir(B8dir+90)}..{dir(B2dir+90)}.7[B2s,B2e];
- label.llft("45",.7[B8s,B8e]);
- drawarrow .7[B9s,B9e]{dir(B9dir-90)}..{dir(B3dir-90)}.7[B3s,B3e];
- label.ulft("-45",.7[B9s,B9e]);
- drawarrow .7[B10s,B10e]{dir(B10dir+90)}..{dir(B4dir+90)}.7[B4s,B4e];
- label.llft("30",.7[B10s,B10e]);
- drawarrow .7[B11s,B11e]{dir(B11dir-90)}..{dir(B5dir-90)}.7[B5s,B5e];
- label.ulft("-30",.7[B11s,B11e]);
- drawarrow .7[B12s,B12e]{dir(B12dir+90)}..{dir(B6dir+90)}.7[B6s,B6e];
- label.llft("60",.7[B12s,B12e]);
+ drawarrow B7/*.7{B7right}..{B1right}B1/*.7; label.ulft("-30",B7/*.7);
+ drawarrow B8/*.7{B8left}..{B2left}B2/*.7; label.llft("45",B8/*.7);
+ drawarrow B9/*.7{B9right}..{B3right}B3/*.7; label.ulft("-45",B9/*.7);
+ drawarrow B10/*.7{B10left}..{B4left}B4/*.7; label.llft("30",B10/*.7);
+ drawarrow B11/*.7{B11right}..{B5right}B5/*.7; label.ulft("-30",B11/*.7);
+ drawarrow B12/*.7{B12left}..{B6left}B6/*.7; label.llft("60",B12/*.7);
)
endfont
%***********************************************************************
@@ -141,18 +135,12 @@ beginfont("EN:Chain 2")
add(
defaultscale:=0.5;
labeloffset:=2bp;
- drawarrow .7[B7s,B7e]{dir(B7dir-90)}..{dir(B1dir-90)}.7[B1s,B1e];
- label.ulft("-60",.7[B7s,B7e]);
- drawarrow .7[B8s,B8e]{dir(B8dir+90)}..{dir(B2dir+90)}.7[B2s,B2e];
- label.llft("60",.7[B8s,B8e]);
- drawarrow .7[B9s,B9e]{dir(B7dir-90)}..{dir(B3dir-90)}.7[B3s,B3e];
- label.ulft("-60",.7[B9s,B9e]);
- drawarrow .7[B10s,B10e]{dir(B10dir+90)}..{dir(B4dir+90)}.7[B4s,B4e];
- label.llft("60",.7[B10s,B10e]);
- drawarrow .7[B11s,B11e]{dir(B11dir-90)}..{dir(B5dir-90)}.7[B5s,B5e];
- label.ulft("-60",.7[B11s,B11e]);
- drawarrow .7[B12s,B12e]{dir(B12dir+90)}..{dir(B6dir+90)}.7[B6s,B6e];
- label.llft("60",.7[B12s,B12e]);
+ drawarrow B7/*.7{B7right}..{B1right}B1/*.7; label.ulft("-60",B7/*.7);
+ drawarrow B8/*.7{B8left}..{B2left}B2/*.7; label.llft("60",B8/*.7);
+ drawarrow B9/*.7{B7right}..{B3right}B3/*.7; label.ulft("-60",B9/*.7);
+ drawarrow B10/*.7{B10left}..{B4left}B4/*.7; label.llft("60",B10/*.7);
+ drawarrow B11/*.7{B11right}..{B5right}B5/*.7; label.ulft("-60",B11/*.7);
+ drawarrow B12/*.7{B12left}..{B6left}B6/*.7; label.llft("60",B12/*.7);
)
endfont
%***********************************************************************
@@ -229,10 +217,8 @@ beginfont("EN:rotate 1")
MC(``1,0,0,<90,0,<-90,0,0,{1,2,3,4,5}=vf,
{3,4^180}:/_~dt)
add(
- drawarrow .7[B6s,B6e]{dir(B6dir+90)}..{dir(B3dir+90)}.7[B3s,B3e];
- label.urt("90",.7[B6s,B6e]);
- drawarrow .7[B7s,B7e]{dir(B7dir-90)}..{dir(B4dir-90)}.7[B4s,B4e];
- label.urt("-90",.7[B7s,B7e]);
+ drawarrow B6/*.7{B6left}..{B3left}B3/*.7; label.urt("90",B6/*.7);
+ drawarrow B7/*.7{B7right}..{B4right}B4/*.7; label.urt("-90",B7/*.7);
)
endfont
%***********************************************************************
@@ -554,10 +540,10 @@ beginfont("EN:mangle")
blength:=6mm;
mangle:=0;
MCat(0.2,0.5)(Ph)
- add(drawarrow((A1 shifted (aw,0)) rotated A1dir..A1);)
+ add(drawarrow((A1 shifted (aw,0)) rotated A1ang..A1);)
mangle:=30;
MCat(0.8,0.5)(Ph)
- add(drawarrow((A1 shifted (aw,0)) rotated A1dir..A1);)
+ add(drawarrow((A1 shifted (aw,0)) rotated A1ang..A1);)
endfont
%***********************************************************************
beginfont("EN:blength=0")
@@ -967,7 +953,7 @@ beginfont("EN:MCat()")
for j=0 step 0.25 until 1:
MCat(j,i)(Ph,4:N)
add(
- drawarrow((A1 shifted (aw,0)) rotated A1dir..A1);
+ drawarrow((A1+A1up**aw)..A1);
label(decimal(mangle),p0+(0.5w,0.5h));
)
mangle:=mangle+15;
@@ -976,19 +962,20 @@ beginfont("EN:MCat()")
endfont
%***********************************************************************
beginfont("EN:add()")
- fsize:=(50mm,20mm);
- msize:=(1,0.7); MCat(0,0.5)(<30,?6,3=dl,4:/CH3)
- add(
- label.top("+",A7);
- drawarrow B3{dir(B3dir-90)}..
- {dir(B7dir+90)}0.4[B7s,B7e];
+ fsize:=(70mm,20mm);
+ msize:=(1,0.85); MCat(0,0)(<30,Ph,3=dl,4:/NH2)
+ add(labeloffset:=.7aw;
+ label.top(lonepair 90,A7);
+ drawarrow (A7+up**1.2aw){A7left}..{B7right}B7/*0.3;
+ drawarrow B3m{B3right}..A3+(1.5aw,.5aw)..{A3down}A3;
)
- msize:=(1,0.7); MCat(1,0.5)(<30,?6,4://CH3)
- add(
- labeloffset:=0bp;
- label.lrt("+",A3);
+ MCat(1,0)(<30,?6,{1,5}=dl,4://NH2)
+ add(labeloffset:=.7aw;
+ label.top(plus,A7);
+ label.urt(minus,A3);
+ label(lonepair A3ang,A3+A3up**.7aw);
)
- ext(drawdblarrow (0.4w,0.5h)..(0.55w,0.5h);)
+ ext(drawdblarrow (0.4w,0.4h)..(0.55w,0.4h);)
endfont
%***********************************************************************
beginfont("EN:ext()")
@@ -1142,3 +1129,69 @@ beginfont("EN:Cholesterol","CAS:57-88-5","FM:C27H46O","MW:386.65")
endfont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bye
+%%%%%%%%%%%%%%%%%%%
+bye
+bye
+5}:/_,
+ 4:*\^75,NH,!,//O,!,/*NH2,!,Ph)
+endfont
+%***************************************************************************
+beginfont("EN:Cholesterol","CAS:57-88-5","FM:C27H46O","MW:386.65")
+ fsize:=(60mm,15mm);
+ MC(
+ <30,?6,{-4,-2}=?6,-4=?5,7=dl,
+ 1:*/OH,{4,12}:*/_^60,9:*/H^60,
+ 10:/*H^180,11:/*H^-60,17:/*H^-54,
+ -1:@,18,/*_,-60,!3,/_,!,
+ )
+endfont
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+bye
+%%%%%%%%%%%%%%%%%%%
+bye
+bye
+12:\*^-15,O,60,//O,-60)
+endfont
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+beginfont("EN:Ampicillin","MW:349.405")
+ fsize:=(60mm,15mm);
+ MC(<45,?4,-3=?5,2:N,7:S,
+ {3^45,4^-45}:/*H,1://O^15,5:/*COOH^-18,{6^35,6^-35}:/_,
+ 4:*\^75,NH,!,//O,!,/*NH2,!,Ph)
+endfont
+%***************************************************************************
+beginfont("EN:Cholesterol","CAS:57-88-5","FM:C27H46O","MW:386.65")
+ fsize:=(60mm,15mm);
+ MC(
+ <30,?6,{-4,-2}=?6,-4=?5,7=dl,
+ 1:*/OH,{4,12}:*/_^60,9:*/H^60,
+ 10:/*H^180,11:/*H^-60,17:/*H^-54,
+ -1:@,18,/*_,-60,!3,/_,!,
+ )
+endfont
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+bye
+%%%%%%%%%%%%%%%%%%%
+bye
+bye
+
+bye
+bye
+bye
+%%%
+bye
+bye
+%%%%%%%%%%%%%%%
+bye
+bye
+:@,18,/*_,-60,!3,/_,!,
+ )
+endfont
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+bye
+%%%%%%%%%%%%%%%%%%%
+bye
+bye
+%%%%%%%
+bye
+bye
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf
index 33067cd995e..1b6a29efdef 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex
index d4de4fc7810..a17dfb80d72 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Molecular Coding Format manual by Akira Yamaji 2019.05.11
+% Molecular Coding Format manual by Akira Yamaji 2019.05.26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper]{article}
%%%%\documentclass[a4paper,twoside]{article}
@@ -1040,8 +1040,7 @@ MCat(1, .5)(<30,Ph,4:/COOH,3:/NH2)
for j=0 step 0.25 until 1:
MCat(j,i)(Ph,4:N)
add(
- drawarrow((A1 shifted (aw,0))
- rotated A1dir..A1);
+ drawarrow((A1+A1up**aw)..A1);
label(decimal(mangle),
p0+(0.5w,0.5h));
)
@@ -1066,51 +1065,56 @@ MCat(1, .5)(<30,Ph,4:/COOH,3:/NH2)
l: bond length
An: atom number
A[m]: atom position
- A[m]dir: branch direction of A[m]
+ A[m]ang: branch angle of A[m]
+ A[m]up: dir A[m]ang
+ A[m]left: dir A[m]ang+90
+ A[m]right: dir A[m]ang-90
+ A[m]down: dir A[m]ang+180
Bn: bond number
+ B[m]: bond(path)
B[m]s: bond start position
+ B[m]m: bond middle position
B[m]e: bond end position
- B[m]: bond position(0.5[B[m]s,B[m]e])
- B[m]dir: bond direction
-
+ B[m]ang: bond angle
+ B[m]up: dir B[m]ang
+ B[m]left: dir B[m]ang+90
+ B[m]right: dir B[m]ang-90
+ B[m]down: dir B[m]ang+180
+ plus : '+' circled
+ minus : '-' circled
+ circlediam = 0.6aw (default)
+ circlepen = 0.2bp (default)
+ lonepair r: ':' rotated r
+ lonepairdiam = 0.3aw (default)
+ lonepairspace = 0.7aw (default)
+ a ** b : a scaled b
+ a /* b : point b of a
%----------------------------------------
beginfont()
- fsize:=(50mm,20mm);
- %---------------------------------------
- msize:=(1,0.7);
- MCat(0,0.5)(<30,?6,3=dl,4:/CH3)
- add(
- label.top("+",A7);
- drawarrow B3{dir(B3dir-90)}..
- {dir(B7dir+90)}0.4[B7s,B7e];
- )
- %---------------------------------------
- MCat(1,0.5)(<30,?6,4://CH3)
- add(
- labeloffset:=0bp;
- label.lrt("+",A3);
- )
- %---------------------------------------
- ext(
- drawdblarrow (0.4w,0.5h)..(0.55w,0.5h);
- )
- %---------------------------------------
+ fsize:=(60mm,20mm);
+ msize:=(1,0.85);
+ MCat(0,0)(<30,Ph,3=dl,4:/NH2)
+ add(
+ labeloffset:=.7aw;
+ label.top(lone_pair 90,A7);
+ drawarrow (A7+up**1.2aw){A7left}
+ ..{B7right}B7/*0.3;
+ drawarrow B3m{B3right}..
+ A3+(1.5aw,.5aw)..{A3down}A3;
+ )
+ MCat(1,0)(<30,?6,{1,5}=dl,4://NH2)
+ add(
+ labeloffset:=.7aw;
+ label.top(plus,A7);
+ label.urt(minus,A3);
+ label(lonepair A3ang,A3+A3up**.7aw);
+ )
+ ext(drawdblarrow (.4w,.4h)..(.55w,.4h);)
endfont
\end{verbatim}
\MCFgraph
-\begin{verbatim}
-label:
- defaultfont: label font
- defaultfont="draw": draw font
- **default defaultfont="draw"
-
-drawarrow & drawdblarrow:
- sw_arrow=0: emulation mode
- sw_arrow=1: plain.mp mode
- **default sw_arrow=0
-\end{verbatim}
%-----------------------------------------------------------------------------
-\newpage
+%%%\newpage
\subsection{Function ext()}
\begin{verbatim}
(Extra graphic to font)
@@ -1134,28 +1138,24 @@ ext(label(inf_EN,(.5w,0));) => all font
%========================================
beginfont()
fsize:=(70mm,30mm;); blength:=0.065;
- %---------------------------------------
MCat(0.1,0.5)
(<-210,60`1,60`1,60`1,{1,3}=dl,
1:/R1,4:/R2^-60)
add(defaultscale:=0.6;
label.bot("Diene",p0+(0.5w,0));)
- %---------------------------------------
MCat(0.4,0.5)
(<-30,-60`1,1=dl,1:/R3,2:/R4^60)
add(defaultscale:=0.6;
- label.bot("Dienophile",p0+(0.5w,0));)
- %---------------------------------------
+ label.bot("Dienophile",p0+(.5w,0));)
MCat(0.9,0.5)
(<30,?6,6=dl,2:/R2,3:/R4,4:/R3,5:/R1)
- %---------------------------------------
ext(
- drawarrow (0.52w,0.5h)..(0.6w,0.5h);
- defaultscale:=0.7;
- label("+",(0.25w,0.5h));
- ratio_thickness_char:=0.125;
- label.bot("Diels-Alder Reaction",
- (0.5w,h));
+ drawarrow (.52w,.5h)..(.6w,.5h);
+ defaultscale:=0.7;
+ label("+",(0.25w,0.5h));
+ ratio_thickness_char:=0.125;
+ label.bot("Diels-Alder Reaction",
+ (.5w,h));
)
%---------------------------------------
endfont
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf
index d7345f5a1ef..46bae635603 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex
index bf4a8e9797e..cbc52714123 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2019.05.11
+% Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2019.05.26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% mcf2graph.mf it must be version 4.41 or later
+%%% mcf2graph.mf it must be version 4.42 or later
\documentclass{article}
%------------------------------------------------------------------------------
\usepackage{luamplib}%
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
index 12652c004bf..364e83f1a5f 100644
--- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
+++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 4.41 Copyright (c) 2013-2019 Akira Yamaji
+% mcf2graph ver 4.42 Copyright (c) 2013-2019 Akira Yamaji
%
% Permission is hereby granted, free of charge, to any person obtaining a copy of this software
% and associated documentation files (the "Software"), to deal in the Software without restriction,
@@ -36,7 +36,7 @@
% Set to use plain.mp (label,arrow,atom) : mpost -s labeloffset=2 FILENAME
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tracingstats:=1;
-message " This is mcf2graph ver 4.41 2019.05";
+message " This is mcf2graph ver 4.42 2019.05";
%-------------------------------------------------------------------------------------------------
newinternal char_num,str_cnt,sub_usr,sub_int,tbl_cnt,sharp_char;
numeric save_num[],comD[][],parD[][],cntD[],tbl_atom[],tbl_subst[][],
@@ -44,7 +44,7 @@ numeric save_num[],comD[][],parD[][],cntD[],tbl_atom[],tbl_subst[][],
string save_str[],tbl_atom_str[],strD[],var[],tag[],out_file_name,out_file_aux,out_file_rep,
aux_delimiter,atomfont,save_atomfont,save_defaultfont;
pair save_pair[],msize,mposition,fsize,fmargin,save_mposition;
-picture mol_stru[];
+picture mol_stru[],save_picture,temp_picture;
path arrow_path,arrow_head;
%-------------------------------------------------------------------------------------------------
char_num:=str_cnt:=proc_end:=mangle:=sw_label_emu:=sw_calc:=sw_extall:=0;
@@ -97,12 +97,19 @@ if (known green)and(known ahlength):
def endchar = endfig enddef;
def printf expr s= write s to out_file_name enddef;
def # = enddef;
+ vardef totalweight expr a= 0 enddef;
def Cp(expr s) = if known s: if s<>0: withcolor color_list[s] fi fi enddef;
def ext(text TXT)= sw_extall:=sw_calc:=1; def EXTALL = TXT enddef; enddef;
if atomfont="": atomfont:="draw"; fi % default atom font
if defaultfont="": defaultfont:="draw"; fi % default label font
%-----------------------------------------------------------------------------------------
else: f_MP:=0;
+ %-----------------------------------
+ def image = image_emu enddef;
+ def llcorner = llcorner_emu enddef;
+ def lrcorner = lrcorner_emu enddef;
+ def urcorner = urcorner_emu enddef;
+ def ulcorner = ulcorner_emu enddef;
string defaultfont;
dotlabeldiam:=3bp;
def Cp(expr s) = enddef;
@@ -126,7 +133,7 @@ ratio_thickness_bond:=0.015; ratio_thickness_char:=0.1;
ratio_char_bond:=1.5; ratio_bondgap_bond:=0.15; ratio_zebragap_bond:=0.12;
ratio_zebra_black:=0.4; ratio_wedge_bond:=0.12; ratio_atomgap_atom:=0.050;
offset_thickness:=0.2bp; offset_bond_gap:=0.3bp; offset_zebra_gap:=0.1bp;
-offset_atom:=0.8pt; offset_wedge:=0.4bp;
+offset_atom:=0.8pt; offset_wedge:=0.4bp; max_labelsize:=20mm;
thickness_fframe:=0.2bp; thickness_mframe:=0.2bp; thickness_aframe:=0.1bp;
max_blength:=10mm; blength:=0; mangle:=0;
%--------------------------------------------------------------------------------------------------
@@ -139,6 +146,7 @@ defaultsize:=8bp;
defaultscale:=1;
labeloffset:=3bp;
ext_defaultline:=0.5bp;
+lonepairdiam:=lonepairspace:=circlediam:=circlepen:=0;
%==================================================================================================
sub_emb_start:=500; % 500 => 2499 for embedded sub structure (max 2000)
sub_usr_start:=2500; % 2500 => 2999 for user sub structure (max 500)
@@ -157,7 +165,7 @@ def parameter_list=
sw_aframe,sw_fframe,sw_subst_off,sw_single,sw_trimming,sw_arrow,sw_label_emu,
ratio_atom_bond,ratio_thickness_bond,ratio_char_bond,
ratio_chain_ring,ratio_bondgap_bond,ratio_zebra_black,ratio_zebragap_bond,ratio_thickness_char,
- ratio_wedge_bond,ratio_atomgap_atom,
+ ratio_wedge_bond,ratio_atomgap_atom,lonepairdiam,lonepairspace,
blength,offset_atom,offset_wedge,max_blength,offset_zebra_gap,offset_bond_gap,
thickness_fframe,thickness_mframe,thickness_aframe,offset_thickness,
numberA_start,numberA_end,numberB_start,numberB_end,
@@ -214,7 +222,7 @@ def beginfont(text s)=
inf_NO,inf_EN,inf_JN,inf_FM,inf_CAS,inf_USE,inf_EXA,inf_EXB,inf_MW;
%------------------------------------------------------------------------------------------------
def ext=ext_font enddef;
- def add=add_mol enddef;
+ def add=add_mole enddef;
%------------------------------------------------------------------------------------------------
inf_NO:=inf_EN:=inf_JN:=inf_FM:=inf_CAS:=inf_USE:=inf_EXA:=inf_EXB:=inf_MW:="";
cal_MW:=cal_MW_str:=cal_FM:="";
@@ -478,18 +486,35 @@ def ext_setup=
fi
enddef;
%--------------------------------------------------------------------------------------------------
-def add_mol(text TXT)=
+def add_mole(text TXT)=
begingroup
- save w,h,n,l,p,am,aw,A,B;
- numeric A[]dir,B[]dir;
- pair p[],A[],B[],B[]s,B[]e;
+ save w,h,n,l,p,am,aw,A,B,plus,minus,lonepair,**,/*;
+ numeric A[]dir,B[]up,A[]ang,B[]ang;
+ pair p[],A[],B[],B[]s,B[]e,B[]m,A[]up,A[]left,A[]right,A[]down,
+ B[]up,B[]left,B[]right,B[]down;
+ path B[];
ext_setup;
+ def plus=circled_plus_add enddef;
+ def minus=circled_minus_add enddef;
+ def lonepair=lone_pair_add enddef;
+ let **=scaled;
+ primarydef a /* b = point b of a enddef;
w:=mol_wd; h:=mol_ht; l:=blength; aw:=atom_wd;
p0:=(minX,minY);
An:=cntA; Bn:=cntB;
- for i=1 upto An: A[i]:=posA[i]; A[i]dir:=angX[i]; endfor
+ lonepairdiam:=0.3aw;
+ lonepairspace:=.7aw;
+ circlediam:=.6aw;
+ circlepen:=.2bp;
+ for i=1 upto An:
+ A[i]:=posA[i]; A[i]ang:=angX[i]; A[i]up:=dir(angX[i]);
+ A[i]left:=dir(angX[i]+90); A[i]right:=dir(angX[i]-90); A[i]down:=dir(angX[i]+180);
+ endfor
for i=1 upto Bn:
- B[i]s:=posA[sB[i]]; B[i]e:=posA[eB[i]]; B[i]:=0.5[B[i]s,B[i]e]; B[i]dir:=angB[i];
+ B[i]s:=posA[sB[i]]; B[i]e:=posA[eB[i]]; B[i]m:=0.5[B[i]s,B[i]e];
+ B[i]:=B[i]s--B[i]e;
+ B[i]ang:=angB[i]; B[i]up:=dir(angB[i]);
+ B[i]down:=dir(angB[i]+180); B[i]left:=dir(angB[i]+90); B[i]right:=dir(angB[i]-90);
endfor
TXT addto mol_stru[cntM] also currentpicture; clearit;
endgroup;
@@ -512,23 +537,100 @@ def ext_font(text TXT)=
endgroup;
enddef;
%--------------------------------------------------------------------------------------------------
-vardef label_emu@#(expr STR,POS) = %% modified 'thelabel@#(expr s,z)' of plain.mp
- save oft,fx,fy,wds,sC,bA;
- pair oft,oft.lft,oft.rt,oft.top,oft.bot,oft.ulft,oft.llft,oft.urt,oft.lrt;
+vardef image_emu(text TXT) =
+ save_picture:=currentpicture;
+ currentpicture:=nullpicture;
+ TXT;
+ temp_picture:=currentpicture;
+ currentpicture:=save_picture;
+ temp_picture
+enddef;
+%--------------------------------------------------------------------------------------------------
+vardef scan_picture(expr PIC,SD)=
+ save save_pic,nA,nB,nC,nD,nE,nS,iw,erase_h,erase_v;
+ picture save_pic;
+ path erase_h,erase_v;
+ nD:=0.2bp;
+ if (SD=1)or(SD=3): nS:=-max_labelsize; nE:=max_labelsize; nB:=nD; nC:=-nD;
+ elseif (SD=2)or(SD=4): nS:=max_labelsize; nE:=-max_labelsize; nB:=-nD; nC:=0;
+ fi
+ if (SD=1)or(SD=2):
+ erase_h:=unitsquare xscaled 2max_labelsize yscaled nD shifted (-max_labelsize,nC);
+ elseif (SD=3)or(SD=4):
+ erase_v:=unitsquare xscaled nD yscaled 2max_labelsize shifted (nC,-max_labelsize);
+ fi
+ save_pic:=currentpicture;
+ currentpicture:=PIC;
+ erase fill unitsquare scaled nD shifted (-max_labelsize,-max_labelsize);
+ iw:=totalweight currentpicture;
+ if iw>=0:
+ for i=nS step nB until nE:
+ if (SD=1)or(SD=2): erase fill erase_h shifted (0,i);
+ elseif (SD=3)or(SD=4): erase fill erase_v shifted (i,0);
+ fi
+ nA:=i;
+ exitif (totalweight currentpicture)<iw;
+ endfor
+ else:
+ nA:=0;
+ fi
+ currentpicture:=save_pic;
+ nA
+enddef;
+%--------------------------------------------------------------------------------------------------
+vardef llcorner_emu(expr b)= (scan_picture(b,3),scan_picture(b,1)) enddef;
+vardef lrcorner_emu(expr b)= (scan_picture(b,4),scan_picture(b,1)) enddef;
+vardef urcorner_emu(expr b)= (scan_picture(b,4),scan_picture(b,2)) enddef;
+vardef ulcorner_emu(expr b)= (scan_picture(b,3),scan_picture(b,2)) enddef;
+%--------------------------------------------------------------------------------------------------
+vardef circled_plus_add=
+ save nA,nB;
+ nA:=circlediam;
+ nB:=circlepen;
+ image(draw fullcircle scaled nA withpen pencircle scaled nB;
+ draw (-.5nA,0)--(.5nA,0) withpen pencircle scaled nB;
+ draw (0,-.5nA)--(0,.5nA) withpen pencircle scaled nB;
+ )
+enddef;
+%--------------------------------------------------------------------
+vardef circled_minus_add=
+ save nA,nB;
+ nA:=circlediam;
+ nB:=circlepen;
+ image(draw fullcircle scaled nA withpen pencircle scaled nB;
+ draw (-.5nA,0)--(.5nA,0) withpen pencircle scaled nB;
+ )
+enddef;
+%--------------------------------------------------------------------
+vardef lone_pair_add expr ANG=
+ save nA,nB;
+ nA:=lonepairdiam;
+ nB:=lonepairspace;
+ image(draw (0,0) withpen pencircle scaled nA;
+ draw ((0,nB) rotated ANG) withpen pencircle scaled nA;)
+enddef;
+%--------------------------------------------------------------------------------------------------
+vardef label_emu@#(expr OBJ,POS) = %% modified 'thelabel@#(expr s,z)' of plain.mp
+ save oft,fx,fy,wds,sC,bA,pA,pB,pC,pD;
+ pair oft,oft.lft,oft.rt,oft.top,oft.bot,oft.ulft,oft.llft,oft.urt,oft.lrt,pA,pB,pC,pD;
string sC;
picture bA;
wds:=0;
- for i=0 upto length(STR)-1:
- sC:=pic_c(i,STR);
- if not((sw_label_emu=1)and((sC="_")or(sC="^"))):
- if (defaultfont="draw")or(f_MP=0):
- wds:=wds+defaultscale*defaultsize*tbl_char_wd[ASCII(sC)];
- else:
- bA:=sC infont defaultfont scaled defaultscale;
- wds:=wds+xpart(lrcorner bA-llcorner bA);
+ %---------------------------------------------------------------
+ if string OBJ:
+ for i=0 upto length(OBJ)-1:
+ sC:=pic_c(i,OBJ);
+ if not((sw_label_emu=1)and((sC="_")or(sC="^"))):
+ if (defaultfont="draw")or(f_MP=0):
+ wds:=wds+defaultscale*defaultsize*tbl_char_wd[ASCII(sC)];
+ else:
+ bA:=sC infont defaultfont scaled defaultscale;
+ wds:=wds+xpart(lrcorner bA-llcorner bA);
+ fi
fi
- fi
- endfor
+ endfor
+ fi
+ %---------------------------------------------------------------
oft:= ( 0, 0); fx:=0.5; fy:=0.5;
oft.lft:= ( -1, 0); fx.lft:=1; fy.lft:=0.5;
oft.rt := ( 1, 0); fx.rt :=0; fy.rt :=0.5;
@@ -538,11 +640,20 @@ vardef label_emu@#(expr STR,POS) = %% modified 'thelabel@#(expr s,z)' of plain.m
oft.urt:= ( .7, .7); fx.urt:=0; fy.urt:=0;
oft.llft:=(-.7,-.7); fx.llft:=1; fy.llft:=1;
oft.lrt:= ( .7,-.7); fx.lrt:=0; fy.lrt:=1;
- puts(POS+(labeloffset*oft@#)-(wds*fx@#,defaultscale*defaultsize*fy@#))(STR);
+ %---------------------------------------------------------------
+ if string OBJ:
+ puts(POS+(labeloffset*oft@#)-(wds*fx@#,defaultscale*defaultsize*fy@#))(OBJ);
+ elseif picture OBJ:
+ pA:=llcorner(OBJ);
+ pB:=urcorner(OBJ);
+ pC:=.5(pB-pA) xscaled xpart(oft@#) yscaled ypart(oft@#);
+ pD:=.5(pA+pB);
+ addto currentpicture also OBJ shifted (POS+labeloffset*oft@#+pC-pD);
+ fi
enddef;
%-------------------------------------------------------------------------------------------------
-vardef dotlabel_emu@#(expr STR,POS)=
- label_emu@#(STR,POS); draw POS withpen pencircle scaled dotlabeldiam;
+vardef dotlabel_emu@#(expr OBJ,POS)=
+ label_emu@#(OBJ,POS); draw POS withpen pencircle scaled dotlabeldiam;
enddef;
%==================================================================================================
def drawarrow_emu expr PAT = arrow_path:=PAT; draw_arrow enddef;