summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf')
-rw-r--r--Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf31
1 files changed, 19 insertions, 12 deletions
diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
index f0dedd16483..5a4802cb487 100644
--- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
+++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 4.49 Copyright (c) 2013-2020 Akira Yamaji
+% mcf2graph ver 4.50 Copyright (c) 2013-2020 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,
@@ -46,7 +46,7 @@ string save_str[],tbl_atom_str[],strD[],var[],tag[],mpc_name[],out_file_name,ou
out_file_rep,out_file_mpc,aux_delimiter,atomfont,save_atomfont,save_defaultfont;
pair save_pair[],msize,mposition,fsize,fmargin,save_mposition,posBs,posBe;
picture mol_stru[],save_picture,temp_picture;
-path arrow_path,arrow_head;
+path arrow_path,dottedline_path,line_path,arrow_head;
%-------------------------------------------------------------------------------------------------
char_num:=str_cnt:=proc_end:=mangle:=sw_label_emu:=sw_calc:=sw_ext_all:=0;
sw_numberA:=sw_numberB:=sw_aux_out:=sw_expand:=sw_fframe:=sw_mframe:=sw_aframe:=sw_trimming:=0;
@@ -60,8 +60,6 @@ if (known green)and(known ahlength):
color color_list[];
prologues:=3;
%-----------------------------------------------------------------------------------------
-%% fontmapfile "pdftex.map";
- %-----------------------------------------------------------------------------------------
atomfont:=defaultfont:="";
out_file_aux:=jobname&"-info.aux";
out_file_mpc:=jobname&"-mpc.txt";
@@ -114,6 +112,7 @@ else: f_MP:=0;
def urcorner = urcorner_emu enddef;
def ulcorner = ulcorner_emu enddef;
string defaultfont;
+ defaultscale:=1.2;
dotlabeldiam:=3bp;
def Cp(expr s) = enddef;
def color = transform enddef;
@@ -125,7 +124,7 @@ fi
clearit;
%--------------------------------------------------------------------------------------------------
message "---------------------------------------------";
-message "This is mcf2graph ver 4.49 2020.07";
+message "This is mcf2graph ver 4.50 2020.07";
if f_MP=1:
if bboxmargin=0: message "output no image file";
elseif bboxmargin=1: message "output first font only";
@@ -167,6 +166,7 @@ offset_thickness:=0.2bp; offset_bond_gap:=0.3bp; offset_zebra_gap:=0.1bp
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;
+dottedline_gap:=1.5bp;
%--------------------------------------------------------------------------------------------------
fsize:=(30mm,20mm); fmargin:=(0.4mm,0.4mm); msize:=(1,1); mposition:=(0.5,0.5);
%==================================================================================================
@@ -198,7 +198,7 @@ def parameter_list=
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,defaultsize,defaultscale,labeloffset,mangle,
- fsize,fmargin,msize,mposition,defaultfont,atomfont,
+ fsize,fmargin,msize,mposition,defaultfont,atomfont,dottedline_gap,
Me,Et,Pr,Bu,iPr,tBu,CF3,CCl3,CBr3,CH3,NH,NH2,NO2,OH,CHO,COOH,CN,SH,OMe,OEt,SMe,SEt,
!CH3,!NH2,!NO2,!OH,!CHO,!COOH,!CN,!SH,!2CH3,!2NH2,!2NO2,!2OH,!2CHO,!2COOH,!2CN,!2SH
enddef;
@@ -533,8 +533,7 @@ def add_to_molecule(text TXT)=
begingroup
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[]s,B[]e,B[]m,A[]up,A[]left,A[]right,A[]down,
- B[]up,B[]left,B[]right,B[]down;
+ pair p[],A[],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;
@@ -543,7 +542,7 @@ def add_to_molecule(text TXT)=
let ** = scaled;
let << = rotated;
primarydef a /* b = point b of a enddef;
- w:=mol_wd; h:=mol_ht; l:=blength; aw:=atom_wd;
+ w:=mol_wd; h:=mol_ht; l:=blen; aw:=atom_wd;
p0:=(minX,minY);
An:=cntA; Bn:=cntB;
lonepairdiam:=0.3aw;
@@ -692,7 +691,7 @@ 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;
+def drawarrow_emu expr PATH = arrow_path:=PATH; draw_arrow enddef;
%-------------------------------------------------------------------------------------------------
def draw_arrow text t = %% modified 'drawarrow' of plain.mp
filldraw arrow_head rotated ahead_angle(reverse arrow_path)
@@ -700,7 +699,7 @@ def draw_arrow text t = %% modified 'drawarrow' of plain.mp
draw arrow_path t
enddef;
%-------------------------------------------------------------------------------------------------
-def drawdblarrow_emu expr PAT = arrow_path:=PAT; draw_dblarrow enddef;
+def drawdblarrow_emu expr PATH = arrow_path:=PATH; draw_dblarrow enddef;
%-------------------------------------------------------------------------------------------------
def draw_dblarrow text t =
filldraw arrow_head rotated ahead_angle(arrow_path) shifted point 0 of arrow_path t;
@@ -708,13 +707,21 @@ def draw_dblarrow text t =
shifted point infinity of arrow_path t;
draw arrow_path t
enddef;
-%-------------------------------------------------------------------------------------------------
+%==================================================================================================
arrow_head:=(0,0)--(ahlength,-(sind 0.5ahangle)*ahlength)--
(ahlength, (sind 0.5ahangle)*ahlength)--cycle;
%-------------------------------------------------------------------------------------------------
def ahead_angle(expr p)=
angle direction .5ahlength/length(point 1 of p - point 0 of p) of p
enddef;
+%-------------------------------------------------------------------------------------------------
+def drawdottedline expr PATH = dottedline_path:=PATH; draw_dottedline enddef;
+def draw_dottedline text t =
+ line_path:=dottedline_path;
+ for i=0 step dottedline_gap/length(point 1 of line_path - point 0 of line_path) until 1:
+ drawdot (point i of line_path) t;
+ endfor
+enddef;
%=================================================================================================
def MCat(expr FW,FH)(text TXT)=
save_mposition:=mposition;