summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
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_exa_soc.mf4
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdfbin235841 -> 236045 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_man_soc.mf42
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.pdfbin462405 -> 462957 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_manual.tex111
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.pdfbin122254 -> 174656 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex7
-rw-r--r--Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf100
10 files changed, 169 insertions, 103 deletions
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG b/Master/texmf-dist/doc/metapost/mcf2graph/CHANGELOG
index a3bee0be47d..3b29fbf0e96 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 2017-01-29
+ Changelog of mcf2graph software package by Akira Yamaji 2017-02-13
*******************************************************************************
+[ver. 4.10 / 2017-02-13]
+ -improve function EXT(),ext()
+ -update MCF syntax manual
+
[ver. 4.09 / 2017-01-29]
-add new function puts()
put string in EXT(),ext()
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/README b/Master/texmf-dist/doc/metapost/mcf2graph/README
index 15ae275aa52..5fde3c5e34b 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.09 2017-01-29
+ version : 4.10 2017-02-13
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 3cb3c1facd0..c906b10a0d9 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 2017.01.29
+% Molecular Coding Format for mcf_example.tex by Akira Yamaji 2017.02.13
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-input mcf2graph.mf; %%% it must be version 4.09 or later
+input mcf2graph.mf; %%% it must be version 4.10 or later
%-------------------------------------------------------------------------
font_wd#:=33mm#;
font_ht#:=24mm#;
diff --git a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_example.pdf
index 641c2fab99e..5512e3d7717 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 bf9e92058d3..0f8aaf33876 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 2017.01.29
+% Molecular Coding Format file for mcf_manual.tex by Akira.Yamaji 2017.02.13
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-input mcf2graph.mf; %% it must be version 4.09 or later
+input mcf2graph.mf; %% it must be version 4.10 or later
%------------------------------------------------------------------------
sw_auxout:=0;
sw_mol_frame:=0;
@@ -272,7 +272,7 @@ endfont
%***********************************************************************
beginfont("EN:change ring length")
margin_top_bottom:=2mm;
- font_ht#:=15mm#;
+ font_ht#:=20mm#;
sw_clip:=1;
sw_numberB:=1;
MCf(?6,4\,?6`1.2)
@@ -818,7 +818,7 @@ beginfont("EN:MCf() vt")
endfont
%***********************************************************************
beginfont("EN:EXT()")
- margin_left_right:=margin_top_bottom:=3mm;
+ margin_left_right:=margin_top_bottom:=5mm;
font_wd#:=70mm#;
font_ht#:=35mm#;
bond_len#:=8mm#;
@@ -826,14 +826,18 @@ beginfont("EN:EXT()")
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.52h);
- draw ((4mm,-2mm)--(0,0)--(25mm,0)) shifted (0.3w,0.48h);
- draw fullcircle scaled 3mm shifted p0;
- drawdot p1 withpen pencircle scaled 2mm;
- drawdot p2 withpen pensquare scaled 2mm;
- use_font(5pt#);
- puts((0.4w,0.6h))("Oxidation");
- puts((0.4w,0.35h))("Reduction");
+ draw_vector((0.7w,0.52h), 0,0.2mm,0.4w);
+ draw_vector((0.3w,0.48h),180,0.2mm,0.4w);
+ drawdot p0 withpen pencircle scaled 3pt;
+ drawdot p1 withpen pencircle scaled 3pt;
+ drawdot p2 withpen pencircle scaled 3pt;
+ label.bot("p0",p0);
+ label.bot("p1",p1);
+ label.bot("p2",p2);
+ label("Ox",(0.5w,0.6h));
+ label("Red",(0.5w,0.4h));
+ use_font(6pt#);
+ label("Reaction example",(0.5w,0.8h));
)
endfont
%***********************************************************************
@@ -844,15 +848,15 @@ beginfont("EN:ext()")
sw_solid:=0;
MCd(1,0.9)(0.1,0.5)(<30,Ph,3:/F,4:/Cl)
ext(
- drawdot p0 withpen pencircle scaled 2mm;
- draw p0--(p0+(wd,0))--(p0+(wd,ht));
+ drawdot p0 withpen pencircle scaled 3pt;
+ drawdot A6 withpen pencircle scaled 3pt;
+ drawdot B3 withpen pencircle scaled 3pt;
+ label.bot("p0",p0);
+ label.ulft("A6",A6);
+ label.rt("B3",B3);
)
MCd(1,0.9)(0.9,0.5)(<30,Ph,3:/F,4:/Cl)
- ext(
- draw_vector(p6,a6-180,l);
- drawdot p0 withpen pensquare scaled 2mm;
- draw p0--(p0+(wd,0))--(p0+(wd,ht));
- )
+ ext(draw p0--(p0+(wd,0))--(p0+(wd,ht));)
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 656035e1754..eec407f55b5 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 a3468a88fc1..d9636c5d350 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 2017.01.29
+% Molecular Coding Format manual by Akira Yamaji 2017.02.13
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper]{article}
%%%%\usepackage{graphicx}
@@ -927,27 +927,28 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
\newpage
\subsection{Function EXT()}
\begin{verbatim}
-(Extra graphic to font)
+(Add extra graphic to font)
w: font width
h: font height
wd: font width-margin_left_right*2
ht: font height-margin_top_bottom*2
+ em: embedded font size
p0: x=margin_left_right
y=margin_top_bottom
n: molecular number
p[m]: molecular origin position
- (1<=m<=molecular count)
-(Function)
- puts(pos)(string):
- put string at pos
- use_font(wd#):
- make string font for puts()
- (font width = wd#)
- draw_vector(pos,angle,length):
+(Function for EXT(),ext())
+ draw_vector(pos,angle,thickness,length):
draw vector at pos
+ use_font(wd#):
+ make font for 'label'
+ label:
+ sw_label_mp=0: ** default
+ use embedded font
+ sw_label_mp=1:
+ use original metapost 'label'
- %----------------------------------
beginfont()
sw_font_frame:=3;
%----------------------------------
@@ -957,20 +958,19 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
(<30,?6,$(3,6)dl,@(2,5)//O)
%----------------------------------
EXT(
- draw ((0,0)--(25mm,0)--(21mm,2mm))
- shifted (0.3w,0.52h);
- draw ((4mm,-2mm)--(0,0)--(25mm,0))
- shifted (0.3w,0.48h)
- draw fullcircle scaled 3mm
- shifted p0;
- drawdot p1
- withpen pencircle scaled 2mm;
- drawdot p2
- withpen pensquare scaled 2mm;
- %----------------------------------
- use_font(5pt#);
- puts((0.4w,0.6h))("Oxidation");
- puts((0.4w,0.35h))("Reduction");
+ draw_vector((0.7w,0.48h), 0,0.2mm,0.4w):
+ draw_vector((0.3w,0.52h),180,0.2mm,0.4w):
+ drawdot p0 withpen pencircle scaled 3pt;
+ drawdot p1 withpen pencircle scaled 3pt;
+ drawdot p2 withpen pencircle scaled 3pt;
+ %----------------------------------
+ label.bot("p0",p0);
+ label.bot("p1",p1);
+ label.bot("p2",p2);
+ label("Ox",(0.5w,0.6h));
+ label("Red",(0.5w,0.4h));
+ use_font(6pt#); % **defalt 5pt#
+ label("Reaction example",(0.5w,0.8h));
)
%----------------------------------
endfont
@@ -980,31 +980,33 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
\newpage
\subsection{Function ext()}
\begin{verbatim}
-(Extra graphic to molecule)
- wd: molecular width
- ht: molecular height
- p0: origin of molecular structure
- n: atom number
- l: bond length
- p[m]: atom position of A[m]
- a[m]: branch angle of A[m]
- (1<=m<=atom count)
+(Add extra graphic to molecule)
+ wd: molecular width
+ ht: molecular height
+ p0: origin of molecular structure
+ l: bond length
+ An: atom number
+ A[m]: atom position
+ A[m]bra: branch angle of A[m]
+ Bn: bond number
+ B[m]: bond position
+ B[m]ang: bond angle
beginfont()
- %-------------------------------
+ %----------------------------------
MCd(1,0.9)(0.1,0.5)(<30,Ph,3:/F,4:/Cl)
ext(
- drawdot p0 withpen pencircle scaled 2mm;
- draw p0--(p0+(wd,0))--(p0+(wd,ht));
+ drawdot p0 withpen pencircle scaled 3pt;
+ drawdot A6 withpen pencircle scaled 3pt;
+ drawdot B3 withpen pencircle scaled 3pt;
+ label.bot("p0",p0);
+ label.ulft("A6",A6);
+ label.rt("B3",B3);
)
- %-------------------------------
+ %----------------------------------
MCd(1,0.9)(0.9,0.5)(<30,Ph,3:/F,4:/Cl)
- ext(
- draw_vector(p6,a6-180,l);
- drawdot p0 withpen pensquare scaled 2mm;
- draw p0--(p0+(wd,0))--(p0+(wd,ht));
- )
- %-------------------------------
+ ext(draw p0--(p0+(wd,0))--(p0+(wd,ht));)
+ %----------------------------------
endfont
\end{verbatim}
\MCFstructure
@@ -1036,16 +1038,20 @@ pk font,PNG,SVG,EPS or MDL MOL file(V2000).\\
\begin{verbatim}
tag3:="cMW"; var3:="calc_weight";
tag4:="cFM"; var4:="calc_formula";
-%-----------------------------------------
+%--------------------------------
beginfont()
MCf(<30,?6,3=d,
@(2,6)N,@(2,6)/_,@(1,5)//O,
|,-4=?5,2=dl,@(1,3)N,3:/_)
endfont
-%-----------------------------------------
+beginfont(......)
+ ...........
+endfont
+..............
%% Output to mcf_man_soc-info.aux %%
..... ;C:85;cMW:194.19174;cFM:C8H10N4O2
+.......................................
** default value
tag1:="F"; var1:="jobname";
@@ -1063,13 +1069,22 @@ beginfont("EN:Tocopherol","CAS:59-02-9")
7:O,@(1,2,5)/_,8:/*_^60,6:/OH,
8\,|,!12,@(4,8)/*_,12:/_)
endfont
+beginfont(......)
+ ...........
+endfont
+..............
%% Output to mcf_man_soc-info.aux %%
F:mcf_man_soc;C:86;EN:Tocopherol;CAS:59-02-9
............................................
-*F:filename *C:char number EN:molecular name
-CAS:CAS number *:default output
+1* F:filename
+2* C:char number
+3 EN:molecular name
+4 CAS:CAS number
+
+*:default output
+
\end{verbatim}
\MCFstructure
%-----------------------------------------------------------------------------
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 9d792f89f10..5aabd3d1b3d 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 32373b33a9a..af0caea790b 100644
--- a/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex
+++ b/Master/texmf-dist/doc/metapost/mcf2graph/mcf_mplib_exa.tex
@@ -1,10 +1,13 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2017.01.29
+% Example of MCF typest with LuaLaTeX(luamplib) by A.Yamaji 2017.02.13
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% mcf2graph.mf it must be version 4.09 or later
+%%% mcf2graph.mf it must be version 4.10 or later
\documentclass{article}
%------------------------------------------------------------------------------
\usepackage{luamplib}%
+\usepackage{lmodern}%
+\usepackage[T1]{fontenc}%
+\usepackage{textcomp}%
\mplibcodeinherit{enable}%
\mplibverbatim{enable}%
\everymplib{if unknown Ph1:
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
index 7fa4db15f74..c2d6f991841 100644
--- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
+++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 4.09 Copyright (c) 2013-2017 Akira Yamaji
+% mcf2graph ver 4.10 Copyright (c) 2013-2017 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,
@@ -30,7 +30,7 @@
% Set output report : mpost -s ahlength=2 FILENAME
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tracingstats:=1;
-message " This is mcf2graph ver 4.0 2017.1";
+message " This is mcf2graph ver 4.1 2017.2";
%-------------------------------------------------------------------------------------------------
newinternal nA,nB,nC,nD,nE,nF,char_num,str_cnt,def_num,def_int,tbl_cnt;
numeric save_para[],comD[][],parD[][],cntD[],tbl_str_wd[],tbl_atom[],tbl_subst[][],tbl_atom_wt[],
@@ -39,8 +39,8 @@ string tbl_atom_str[],strD[],var[],tag[],mp_log_name,aux_delimiter;
picture atom_font[],str_font[],mol_stru[],save_pict;
%-------------------------------------------------------------------------------------------------
char_num:=str_cnt:=proc_end:=0;
-sw_numberA:=sw_numberB:=sw_mol_frame:=sw_auxout:=sw_solid:=sw_expand:=sw_font_frame:=0;
-sw_atom_frame:=sw_report:=sw_MOLout:=sw_subst_off:=sw_bond_single:=sw_auxfix:=sw_clip:=0;
+sw_numberA:=sw_numberB:=sw_mol_frame:=sw_auxout:=sw_solid:=sw_expand:=sw_font_frame:=sw_clip:=0;
+sw_atom_frame:=sw_report:=sw_MOLout:=sw_subst_off:=sw_bond_single:=sw_auxfix:=sw_label_mp:=0;
numberA_start:=numberB_start:=1; numberA_end:=numberB_end:=4095; aux_max:=max_inf_num:=20;
aux_delimiter:=";"; var1:="jobname"; tag1:="F"; var2:="char_num"; tag2:="C";
for i=3 upto aux_max: var[i]:=tag[i]:=""; endfor
@@ -63,9 +63,13 @@ if (known green)and(known ahlength):
def # = enddef;
def Cp(expr s) = if known s: if s<>0: withcolor color_list[s] fi fi enddef;
def define_pixels(text s) = enddef;
+ if sw_label_mp=0: def label = label_ext enddef; fi
else: f_MP:=0;
- def Cp(expr s) = enddef; def color = transform enddef;
- mode_setup; def printf expr s= message s enddef;
+ def Cp(expr s) = enddef;
+ def color = transform enddef;
+ def label = label_ext enddef;
+ def printf expr s= message s enddef;
+ mode_setup;
fi
ahangle:=45; ahlength:=4;
clearit;
@@ -80,7 +84,9 @@ ratio_char_bond:=1.5; ratio_bondgap_bond:=0.15; ratio_zebragap_bond:=0.
ratio_zebra_black:=0.4; ratio_wedge_bond:=0.12; ratio_atomgap_atom:=0.050;
offset_thickness#:=0.2pt#; offset_bond_gap#:=0.3pt#; offset_zebra_gap#:=0.1pt#;
offset_atom#:=0.8pt#; offset_wedge#:=0.4pt#; thickness_font_frame#:=0.2pt#;
-max_bond_length#:=10mm; bond_len#:=8mm#; font_wd#:=30mm#; font_ht#:=20mm#;
+max_bond_length#:=10mm; bond_len#:=8mm#;
+font_wd#:=30mm#; font_ht#:=20mm#;
+labeloffset:=3bp; default_emb_font#:=5pt#;
%--------------------------------------------------------------------------------------------------
def_emb_start:=500; % 500 => 2499 for embedded definition (max 2000)
def_usr_start:=2500; % 2500 => 2999 for user definition (max 500)
@@ -95,10 +101,10 @@ def_com(1)(si,dl,dr,db,dm,tm,wf,wb,bd,bz,zf,zb,dt,wv,nl,vf,vb,si_,wf_,wb_,bd_);
%--------------------------------------------------------------------------------------------------
def parameter_list=
sw_report,sw_numberA,sw_numberB,sw_mol_frame,sw_auxout,sw_solid,sw_expand,sw_MOLout,
- sw_atom_frame,sw_font_frame,sw_subst_off,sw_bond_single,sw_clip,
+ sw_atom_frame,sw_font_frame,sw_subst_off,sw_bond_single,sw_clip,sw_label_mp,
margin_left_right,margin_top_bottom,ratio_atom_bond,ratio_thickness_bond,ratio_char_bond,
ratio_chain_ring,max_bond_width,ratio_bondgap_bond,ratio_zebra_black,ratio_zebragap_bond,
- ratio_wedge_bond,ratio_atomgap_atom,ratio_bond_width,font_wd#,font_ht#,
+ ratio_wedge_bond,ratio_atomgap_atom,ratio_bond_width,font_wd#,font_ht#,labeloffset,
bond_len#,offset_atom#,offset_wedge#,max_bond_length#,offset_zebra_gap#,offset_bond_gap#,
thickness_font_frame#,offset_thickness#,numberA_start,numberA_end,numberB_start,numberB_end
enddef;
@@ -302,9 +308,13 @@ enddef;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def EXT(text s)=
begingroup
- save w,h,wd,ht,n,p; pair p[];
+ save w,h,wd,ht,n,p,em;
+ pair p[];
+ use_font(default_emb_font#);
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;
+ p0:=(margin_left_right,margin_top_bottom);
+ em:=emb_font_size;
+ n:=cntM;
for i=1 upto n: p[i]:=posM[1][i]; endfor
s addto mol_stru[0] also currentpicture; clearit; f_ext:=1;
endgroup;
@@ -312,18 +322,28 @@ enddef;
%--------------------------------------------------------------------------------------------------
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
+ save wd,ht,n,l,p,zw,sp,ep,em,A,B;
+ numeric A[]bra,B[]ang;
+ pair p[],A[],B[],sp,ep;
+ use_font(default_emb_font#);
+ wd:=mol_wd;
+ ht:=mol_ht;
+ l:=bond_len;
+ em:=emb_font_size;
+ p0:=(minX,minY);
+ An:=cntA; Bn:=cntB;
+ for i=1 upto An: A[i]:=posA[i]; A[i]bra:=ang_br[i]; endfor
+ for i=1 upto Bn: sp:=posA[sB[i]]; ep:=posA[eB[i]]; B[i]:=0.5[sp,ep]; B[i]ang:=angB[i]; endfor
s addto mol_stru[cntM] also currentpicture; clearit;
endgroup;
enddef;
%--------------------------------------------------------------------------------------------------
def use_font(expr WD)=
- save_pict:=currentpicture;
+ save_pict:=currentpicture; clearit;
for i=1 upto 128: f_char[i]:=1; endfor
proc_char_setup(str_font)(WD);
- str_wd#:=WD;
- define_pixels(str_wd);
+ emb_font_size#:=WD;
+ define_pixels(emb_font_size);
currentpicture:=save_pict;
enddef;
%--------------------------------------------------------------------------------------------------
@@ -333,11 +353,35 @@ def puts(expr PA)(expr STR)=
cp:=PA;
for i=0 upto length(STR)-1:
nA:=ASCII(pic_c(i,STR));
- addto currentpicture also str_font[nA] shifted (cp-(0,str_wd*tbl_char_dp[nA]));
- cp:=cp+(str_wd*tbl_char_wd[nA],0);
+ addto currentpicture also str_font[nA] shifted (cp-(0,emb_font_size*tbl_char_dp[nA]));
+ cp:=cp+(emb_font_size*tbl_char_wd[nA],0);
endfor
endgroup;
enddef;
+%--------------------------------------------------------------------------------------------------
+vardef label_ext@#(expr STR,POS) =
+ save oft,fx,fy,wds;
+ pair oft,oft.lft,oft.rt,oft.top,oft.bot,oft.ulft,oft.llft,oft.urt,oft.lrt;
+ wds:=0;
+ for i=0 upto length(STR)-1:
+ wds:=wds+emb_font_size*tbl_char_wd[ASCII(pic_c(i,STR))];
+ endfor
+ 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;
+ oft.bot:= ( 0, -1); fx.bot:=0.5; fy.bot:=1;
+ oft.top:= ( 0, 1); fx.top:=0.5; fy.top:=0;
+ oft.ulft:=(-.7, .7); fx.ulft:=1; fy.ulft:=0;
+ 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@#,emb_font_size*fy@#))(STR);
+enddef;
+%-------------------------------------------------------------------------------------------------
+def draw_vector(expr POS,ROT,THICK,LEN)=
+ fill (-2mm,-(.5THICK+.4mm))--(0,0)--(-2mm,.5THICK+.4mm)--(-2mm,.5THICK)--(-LEN,.5THICK)--
+ (-LEN,-.5THICK)--(-2mm,-.5THICK)--cycle rotated ROT shifted POS;
+enddef;
%=================================================================================================
def MCf(text s)= MCd(1,1)(.5,.5)(s) enddef; % MC fill draw
%-------------------------------------------------------------------------------------------------
@@ -441,11 +485,6 @@ def draw_corner(expr LX,LY,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)=
- fill (-2mm,-1mm)--(0,0)--(-2mm,1mm)--(-2mm,.4mm)--(-LEN,.4mm)--
- (-LEN,-.4mm)--(-2mm,-.4mm)--cycle rotated ROT shifted POS;
-enddef;
-%-------------------------------------------------------------------------------------------------
def proc_size_setup=
if (bond_len#*ratio_atom_bond+offset_atom#)<.8bond_len#:
atom_wd#:=bond_len#*ratio_atom_bond+offset_atom#;
@@ -803,8 +842,9 @@ enddef;
%---------------------------------------------------------------
char_size_set( 1)( 1)( 0)("CGHMNOQ");
char_size_set(.9)( 1)( 0)("ABDEFIJKLPRSTUVWXYZ-+/><m");
-char_size_set(.7)( 1)( 0)(" ()0123456789nhj=*bdiltf");
-char_size_set(.7)( 1)(.15)("pqg");
+char_size_set(.7)( 1)( 0)(" ()0123456789nhj=*bdtf");
+char_size_set(.5)( 1)( 0)("il");
+char_size_set(.7)( 1)(.24)("pqg");
char_size_set(.7)(.8)( 0)("acekosuvxzwry");
char_size_set(.4)( 1)( 0)(".,:;'`");
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -862,7 +902,7 @@ FD("5")(draw Z12--Z16 hL; draw Z13--(hP,.49aH) vL;
FD("6")(draw Z19..(fW,.5fW)..(hW,fW)..(hP,.5fW)..cycle; cutdraw (hP,.4aH)--Z06);
FD("7")(draw (0,.fH)--Z16 hL; draw (aW-1.2hP,aH-fP)--(.4aW,0) vL scaled 1.2);
FD("8")(draw POh; draw (hP,.75aH)...Z14...(fW,.75aH)...Z20...cycle;);
-FD("9")(draw Z19..(fW,.5fW)..(hW,fW)..(hP,.5fW)..cycle sH .32aH; cutdraw (fW,.6aH)--Z07);
+FD("9")(draw (Z19..(fW,.5fW)..(hW,fW)..(hP,.5fW)..cycle) sH .32aH; cutdraw (fW,.6aH)--Z07);
FD("A")(draw Z02--Z06--Z05 vL scaled 1.14; draw .33[Z02,Z06]--.33[Z05,Z06]);
FD("B")(draw Z13--Z14{right}..(.9fH,.75aH)..{left}(.5aW,hH)--Z09--(.5aW,hH){right}..
(.9fH,.25aH)..{left}Z19--Z03; draw Z02--Z18 vL);
@@ -901,7 +941,7 @@ FD("c")(cutdraw SP(.06,.94)Z10..Z14..Z09..Z19..cycle);
FD("d")(draw Z19..Z10..Z11..Z09..cycle; draw Z05--(fW,1.2aH) vL);
FD("e")(cutdraw SP(0,.92)Z10..Z14..Z09..Z19..cycle; draw Z10--Z09);
FD("f")(cutdraw (.5aW,0)--(.5aW,.75aH){up}..(.75aW,fH)..{down}(fW,.8aH); draw Z08--Z17 hL);
-FD("g")(draw Z19..Z10..Z11..Z09..cycle sH .3aH; cutdraw Z15--(fW,hP)..(hW,0)..(.1aW,fP));
+FD("g")(draw (Z19..Z10..Z11..Z09..cycle) sH .3aH; cutdraw Z15--(fW,hP)..(hW,0)..(.1aW,fP));
FD("h")(draw Z02..(hP,.3aH){up}..(hW,.7fH)..{down}(fW,.3aH)..Z05; draw (hP,.3aH)--Z18 vL);
FD("i")(draw Z07--(hW,.63aH) vL; draw Z14 wpcs 1.4fP);
FD("j")(draw Z19--(hW,.63aH) vL; draw Z19..(.25aW,-hP)..Z01; draw Z14 wpcs 1.4fP);
@@ -911,9 +951,9 @@ FD("m")(cutdraw Z02..(hP,.3aH){up}..(.28aW,.7fH)..{down}(hW,.3aH)..Z07;
cutdraw (hW,.3aH){up}..(.7aW,.7aH-hP)..{down}(fW,.3aH)..Z05; draw (hP,.3aH)--(hP,.7aH) vL);
FD("n")(cutdraw Z02..(hP,.3aH){up}..(hW,.7fH)..{down}(fW,.3aH)..Z05; draw (hP,.3aH)--(hP,.7aH) vL);
FD("o")(draw Z19..Z10..Z14..Z09..cycle);
-FD("p")(draw Z19..Z10..Z11..Z09..cycle sH .3aH; draw (hP,0)--Z18 vL);
-FD("q")(draw Z19..Z10..Z11..Z09..cycle sH .3aH; draw (fW,0)--Z15 vL);
-FD("r")(cutdraw SP(.35,.72)Z19..Z10..Z14..Z09..cycle sH -fP; draw Z02--Z18 vL);
+FD("p")(draw (Z19..Z10..Z11..Z09..cycle) sH .3aH; draw (hP,0)--Z18 vL);
+FD("q")(draw (Z19..Z10..Z11..Z09..cycle) sH .3aH; draw (fW,0)--Z15 vL);
+FD("r")(cutdraw (SP(.35,.72)Z19..Z10..Z14..Z09..cycle) sH -fP; draw Z02--Z18 vL);
FD("s")(cutdraw SP(.05,.45)PO; cutdraw SP(.55,.95)PO; draw (fW,.3aH){up}..{up}(hP,.7aH));
FD("t")(draw Z07--Z06 vL; draw (0,.66aH)--(aW,.66aH) hL);
FD("u")(cutdraw Z18..(hP,.55aH){down}..Z19..(fW,.55aH){up}..Z15; draw Z15--Z05 vL);