summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-11-05 21:34:03 +0000
committerKarl Berry <karl@freefriends.org>2016-11-05 21:34:03 +0000
commit23cd3d2a1aef72188cdf81d605085fd1b9554594 (patch)
tree597f800990046a5f2197bdfbec5e30199cbe163e /Master/texmf-dist
parent7d093de2b0b0e71f14058e72670e0686d8d12e93 (diff)
mcf2graph (5nov16)
git-svn-id: svn://tug.org/texlive/trunk@42442 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG6
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/README2
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdfbin246691 -> 246692 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf24
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdfbin434503 -> 436188 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex28
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdfbin122460 -> 122594 bytes
-rw-r--r--Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf77
8 files changed, 82 insertions, 55 deletions
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG b/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG
index 3e8ed27e034..3826f7ec8c4 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG
@@ -1,6 +1,10 @@
*******************************************************************************
- Changelog of mcf2graph software package by Akira Yamaji 2016-11-03
+ Changelog of mcf2graph software package by Akira Yamaji 2016-11-05
*******************************************************************************
+[ver. 4.04 / 2016-11-05]
+ -improve clipping mode
+ -update MCF syntax manual
+
[ver. 4.03 / 2016-11-03]
-miner update
-update MCF syntax manual
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/README b/Master/texmf-dist/doc/metapost/mcf2graph/README
index 6ff2a8d950d..2a152fe77da 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.03 2016-11-03
+ version : 4.04 2016-11-05
E-mail : mcf2graph@gmail.com
Located at : http://www.ctan.org/pkg/mcf2graph
********************************************************************************
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf
index 6ddc85e06cd..5efadc6d550 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_man_soc.mf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf
index 183e980b6bb..e334100deec 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2016.11.03
+% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2016.11.05
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
input mcf2graph.mf; %% it must be version 4.03 or later
%------------------------------------------------------------------------
@@ -691,15 +691,19 @@ endfont
%***********************************************************************
beginfont("EN:Switwch clipping")
font_ht#:=15mm#;
+ sw_font_frame:=3;
sw_mol_frame:=1;
- MCf(<30,Ph,4:/Cl,3:/F)
+ MCd(1,.7)(.2,.3)(Ph)
+ MCd(1,.7)(.8,.7)(Ph)
endfont
%-----------------------------------------------------------------------
beginfont("EN:Switwch clipping")
font_ht#:=15mm#;
+ sw_font_frame:=3;
sw_mol_frame:=1;
sw_clip:=1;
- MCf(<30,Ph,4:/Cl,3:/F)
+ MCd(1,.7)(.2,.3)(Ph)
+ MCd(1,.7)(.8,.7)(Ph)
endfont
%***********************************************************************
beginfont("EN:Switwch Solid ratio=0")
@@ -803,14 +807,15 @@ beginfont("EN:MCf()")
endfont
%***********************************************************************
beginfont("EN:EXT()")
- sw_solid:=1;
font_ht#:=26mm#;
bond_len#:=8mm#;
+ sw_font_frame:=3;
sw_mol_frame:=1;
- MCd(1,1)(0,0.5)(<30,Ph,2:/OH,5:/OH)
- MCd(1,1)(1,0.5)(<30,?6,$(3,6)dl,@(2,5)//O)
- EXT(draw ((0,0)--(26mm,0)--(22mm,2mm)) shifted (0.3w,0.5h);
- drawdot p1 withpen pencircle scaled 2mm;
+ MCd(1,0.8)(0.1,0.5)(<30,Ph,2:/OH,5:/OH)
+ MCd(1,0.8)(0.9,0.5)(<30,?6,$(3,6)dl,@(2,5)//O)
+ EXT(draw ((0,0)--(25mm,0)--(21mm,2mm)) shifted (0.3w,0.5h);
+ drawdot p0 withpen pencircle scaled 2mm;
+ drawdot p1 withpen pensquare scaled 2mm;
drawdot p2 withpen pensquare scaled 2mm;)
endfont
%***********************************************************************
@@ -820,7 +825,8 @@ beginfont("EN:ext()")
bond_len#:=10mm#;
MCf(<30,Ph,4:/Cl,3:/F)
ext(draw p0--(p0+(wd,0))--(p0+(wd,ht));
- draw_vector(p6,a6-180,l);)
+ draw_vector(p6,a6-180,l);
+ )
endfont
%***********************************************************************
beginfont("EN:Local setting 1")
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdf
index 6716e87e87c..25b0d186306 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 9629c6e4744..04ee963c93e 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 2016.11.03
+% Molecular Coding Format manual by Akira Yamaji 2016.11.05
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper]{article}
%%%%\usepackage{graphicx}
@@ -712,13 +712,15 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
\subsubsection{Clipping mode}
\begin{verbatim}
sw_clip:=0;
- MCf(<30,Ph,4:/Cl,3:/F)
+ MCd(1,0.7)(0.2,0.3)(Ph)
+ MCd(1,0.7)(0.8,0.7)(Ph)
** default: sw_clip=0
\end{verbatim}
\MCFstructure
\begin{verbatim}
sw_clip:=1;
- MCf(<30,Ph,4:/Cl,3:/F)
+ MCd(1,0.7)(0.2,0.3)(Ph)
+ MCd(1,0.7)(0.8,0.7)(Ph)
\end{verbatim}
\MCFstructure
%-----------------------------------------------------------------------------
@@ -748,7 +750,7 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
\MCFstructure
%-----------------------------------------
\begin{verbatim}
- (solid bond length,clipping)
+ (solid bond length and clip)
sw_solid:=2;
sw_clip:=1;
bond_len#=10mm#
@@ -853,8 +855,7 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
\newpage
\subsection{Function EXT()}
\begin{verbatim}
- (Extra graphic to font)
-
+(Extra graphic to font)
w: font width
h: font height
wd: font width-margin_left_right*2
@@ -867,13 +868,14 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
beginfont()
sw_mol_frame:=1;
- MCd(1,1)(0,0.5)(<30,Ph,2:/OH,5:/OH)
- MCd(1,1)(1,0.5)
+ MCd(1,0.8)(0.1,0.5)(<30,Ph,2:/OH,5:/OH)
+ MCd(1,0.8)(0.9,0.5)
(<30,?6,$(3,6)dl,@(2,5)//O)
EXT(
- draw ((0,0)--(26mm,0)--(22mm,2mm))
+ draw ((0,0)--(25mm,0)--(21mm,2mm))
shifted (0.3w,0.5h);
- drawdot p1 withpen pencircle scaled 2mm;
+ drawdot p0 withpen pencircle scaled 2mm;
+ drawdot p1 withpen pensquare scaled 2mm;
drawdot p2 withpen pensquare scaled 2mm;
)
endfont
@@ -882,8 +884,7 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
%-----------------------------------------------------------------------------
\subsection{Function ext()}
\begin{verbatim}
- (Extra graphic to molecule)
-
+(Extra graphic to molecule)
wd: molecular width
ht: molecular height
p0: origin of molecular structure
@@ -892,8 +893,7 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
p[m]: atom position of A[m]
a[m]: branch angle of A[m]
(1<=m<=atom count)
- draw_vector(pos,ang,len) :
- pos:position ang:angle len:length
+ draw_vector(position,angle,length)
beginfont()
MCf(<30,Ph,3:/F,4:/Cl)
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 29a70504ea3..90998d55bdf 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/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
index 668964031b3..4a110f441a0 100644
--- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
+++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 4.03 Copyright (c) 2013-2016 Akira Yamaji
+% mcf2graph ver 4.04 Copyright (c) 2013-2016 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 @@ newinternal nA,nB,nC,nD,nE,nF,def_num,def_int,tbl_cnt;
numeric save_para[],comD[][],parD[][],cntD[],tbl_str_wd[],tbl_atom[],tbl_subst[][],tbl_atom_wt[],
tbl_char_wd[],tbl_char_ht[],tbl_char_dp[];
string tbl_atom_str[],strD[],var[],tag[],mp_log_name,aux_delimiter;
-picture atom_font[],chem_structure;
+picture atom_font[],mol_stru[];
%-------------------------------------------------------------------------------------------------
char_num:=str_cnt:=proc_end:=0;
sw_numberA:=sw_numberB:=sw_mol_frame:=sw_auxout:=sw_solid:=sw_expand:=sw_font_frame:=0;
@@ -68,7 +68,8 @@ else: f_MP:=0;
mode_setup; def printf expr s= message s enddef;
fi
ahangle:=45; ahlength:=4;
-clearit; chem_structure:=currentpicture;
+clearit;
+for i=0 upto 20: mol_stru[i]:=nullpicture; endfor
%--------------------------------------------------------------------------------------------------
let DIV= /; let MUL= *; let LT= <; let GT= >; let AND= &; let :: = : ; let == = =;
%--------------------------------------------------------------------------------------------------
@@ -114,25 +115,45 @@ def restore_par(text t)= nA:=0;
def beginfont(text s)=
store_par(parameter_list);
begingroup
- save cntA,cntB,cntM,minX,minY,f_beginchar,numS,
- posB,posA,posM,lineB,sB,eB,angB,angA,lenB,ang_br,info;
+ save cntA,cntB,cntM,minX,minY,f_beginchar,numS,sftX,sftY,
+ posB,posA,posM,lineB,sB,eB,angB,angA,lenB,ang_br,info,pT;
numeric lineB[],sB[],eB[],angB[],angA[],lenB[],ang_br[],numS[];
- pair posB[],posA[],posM[];
+ pair posB[],posA[],posM[][],pT;
string info[];
%------------------------------------------------------------------------------------------------
for i:=1 upto max_inf_num: info[i]:=":"; endfor
f_beginchar:=inf_num:=cntM:=0;
for list=s: info[incr inf_num]:=list; endfor
char_num:=char_num+1;
+ posM[0][0]:=(0,0);
enddef;
%==================================================================================================
def endfont=
- if (sw_font_frame=1)or(sw_font_frame=3): EXT(draw_frame((0,0),w,h,thickness_font_frame);) fi
- if (sw_font_frame=2)or(sw_font_frame=3): EXT(draw_frame(p0,wd,ht,thickness_font_frame);) fi
- if sw_font_frame=4: EXT(draw_corner(w,h,thickness_font_frame);) fi
+ if sw_clip>0:
+ nA:=4095; nB:=-4095; nC:=4095; nD:=-4095;
+ for i=1 upto cntM:
+ if xpart(posM[1][i])<nA: nA:=xpart(posM[1][i]); fi
+ if xpart(posM[2][i])>nB: nB:=xpart(posM[2][i]); fi
+ if ypart(posM[1][i])<nC: nC:=ypart(posM[1][i]); fi
+ if ypart(posM[2][i])>nD: nD:=ypart(posM[2][i]); fi
+ endfor
+ font_wd#:=font_wd#*((nB-nA+2margin_left_right)/font_wd);
+ font_ht#:=font_ht#*((nD-nC+2margin_top_bottom)/font_ht);
+ for i=1 upto cntM:
+ posM[0][i]:=posM[0][i]+(margin_left_right-nA,margin_top_bottom-nC);
+ endfor
+ fi
+ %-----------------------------------------------------------------------------------------------
+ beginchar(char_num,font_wd#,font_ht#,0)
+ if (sw_font_frame=1)or(sw_font_frame=3): draw_frame((0,0),w,h,thickness_font_frame); fi
+ if (sw_font_frame=2)or(sw_font_frame=3):
+ nA:=w-2margin_left_right; nB:=h-2margin_top_bottom; pT:=(margin_left_right,margin_top_bottom);
+ draw_frame(pT,nA,nB,thickness_font_frame); fi
+ if sw_font_frame=4: draw_corner(w,h,thickness_font_frame); fi
if (sw_auxout=1)or(sw_checklist=1)or(sw_MOLout=1): proc_calc_out; fi
- currentpicture:=chem_structure;
- chem_structure:=nullpicture;
+ for i=0 upto cntM:
+ addto currentpicture also mol_stru[i] shifted posM[0][i]; mol_stru[i]:=nullpicture;
+ endfor
endchar;
clearit;
endgroup;
@@ -279,9 +300,10 @@ enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def EXT(text s)=
begingroup
- save wd,ht,n,p; pair p[]; wd:=w-2margin_left_right; ht:=h-2margin_top_bottom;
- p0:=(margin_left_right,margin_top_bottom); n:=cntM; for i=1 upto n: p[i]:=posM[i]; endfor
- s addto chem_structure also currentpicture; clearit;
+ save w,h,wd,ht,n,p; pair p[];
+ w:=font_wd; h:=font_ht; wd:=w-2margin_left_right; ht:=h-2margin_top_bottom;
+ p0:=(margin_left_right,margin_top_bottom); n:=cntM; for i=1 upto n: p[i]:=posM[1][i]; endfor
+ s addto mol_stru[0] also currentpicture; clearit;
endgroup;
enddef;
%--------------------------------------------------------------------------------------------------
@@ -289,7 +311,7 @@ def ext(text s)=
begingroup
save wd,ht,n,a,l,p; numeric a[]; pair p[]; wd:=mol_wd; ht:=mol_ht; l:=bond_len;
p0:=(minX,minY); n:=cntA; for i=1 upto n: p[i]:=posA[i]; a[i]:=ang_br[i]; endfor
- s addto chem_structure also currentpicture shifted (sftX,sftY); clearit;
+ s addto mol_stru[cntM] also currentpicture; clearit;
endgroup;
enddef;
%=================================================================================================
@@ -299,7 +321,7 @@ def MCd(expr RW,RH)(expr FW,FH)(text TX)=
begingroup
save com,par,adrA,adrB,f_bra,envT,envB,lenT,lineT,strAT,stkA,stkB,stkL,stkM,cntP,
bondL,temp_len,temp_cntB,f_end,f_term,rotT,adrS,f_lineT,f_rotT,f_lenT,f_envT,angT,tempB,
- glu,sftX,sftY,xpos,ypos,str_len,max_x,max_y,par_s,par_e,score_u,hat,f_char,lenB,
+ glu,xpos,ypos,str_len,max_x,max_y,par_s,par_e,score_u,hat,f_char,lenB,
ps_adr,ps_com,op_com,op_par,op_cnt,crR,colorA,colorB;
%-----------------------------------------------------------------------------------------------
save PA,PAs,PP,PG;
@@ -337,12 +359,6 @@ def MCd(expr RW,RH)(expr FW,FH)(text TX)=
fi
proc_char_setup;
%-----------------------------------------------------------------------------------------------
- if f_beginchar=0:
- if sw_clip=1: font_wd#:=font_wd#*((mol_wd+2margin_left_right)/font_wd);
- font_ht#:=font_ht#*((mol_ht+2margin_top_bottom)/font_ht); fi
- beginchar(char_num,font_wd#,font_ht#,0); f_beginchar:=1;
- fi
- %-----------------------------------------------------------------------------------------------
for i=1 upto cntB: if lineB[i]<si_ : draw_bond(i,sB[i],eB[i],angB[i],lineB[i]); fi endfor
for i=1 upto cntB: if lineB[i]>=si_: draw_bond(i,sB[i],eB[i],angB[i],lineB[i]); fi endfor
%-----------------------------------------------------------------------------------------------
@@ -357,11 +373,13 @@ def MCd(expr RW,RH)(expr FW,FH)(text TX)=
else: draw_atom(i,posA[i],ang_br[i],strD[numS[i]],tbl_str_wd[numS[i]]); fi
endfor
%-----------------------------------------------------------------------------------------------
- sftX:=margin_left_right-minX+(w-mol_wd-2margin_left_right)*FW;
- sftY:=margin_top_bottom-minY+(h-mol_ht-2margin_top_bottom)*FH;
- posM[incr cntM]:=(minX+sftX,minY+sftY);
- if sw_mol_frame=1: ext(draw_frame(p0,wd,ht,0.2pt);) fi
- addto chem_structure also currentpicture shifted (sftX,sftY);
+ sftX:=margin_left_right-minX+(font_wd-mol_wd-2margin_left_right)*FW;
+ sftY:=margin_top_bottom-minY+(font_ht-mol_ht-2margin_top_bottom)*FH;
+ posM[0][incr cntM]:=(sftX,sftY);
+ posM[1][cntM]:=(minX+sftX,minY+sftY);
+ posM[2][cntM]:=(max_x+sftX,max_y+sftY);
+ if sw_mol_frame=1: draw_frame((minX,minY),mol_wd,mol_ht,thickness_font_frame) fi
+ addto mol_stru[cntM] also currentpicture;
clearit;
endgroup;
enddef;
@@ -387,12 +405,11 @@ def ps_get(expr n)=
enddef;
%-------------------------------------------------------------------------------------------------
def draw_frame(expr PS,LX,LY,PN)=
- draw ((PN/2,PN/2)--(LX-PN/2,PN/2)--(LX-PN/2,LY-PN/2)--(PN/2,LY-PN/2)--cycle) shifted PS wpss PN;
+ draw ((0,0)--(LX,0)--(LX,LY)--(0,LY)--cycle) shifted PS wpss PN;
enddef;
%-------------------------------------------------------------------------------------------------
def draw_corner(expr LX,LY,PN)=
- drawdot (PN/2,PN/2) wpss PN; drawdot (LX-PN/2,PN/2) wpss PN;
- drawdot (LX-PN/2,LY-PN/2) wpss PN; drawdot (PN/2,LY-PN/2) wpss PN;
+ drawdot(0,0) wpss PN; drawdot(LX,0) wpss PN; drawdot(LX,LY) wpss PN; drawdot(0,LY) wpss PN;
enddef;
%-------------------------------------------------------------------------------------------------
def draw_vector(expr POS,ROT,LEN)=