summaryrefslogtreecommitdiff
path: root/graphics/mcf2graph/mcf2graph.mp
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/mcf2graph/mcf2graph.mp')
-rw-r--r--graphics/mcf2graph/mcf2graph.mp59
1 files changed, 28 insertions, 31 deletions
diff --git a/graphics/mcf2graph/mcf2graph.mp b/graphics/mcf2graph/mcf2graph.mp
index 87238a2132..2dd08fb804 100644
--- a/graphics/mcf2graph/mcf2graph.mp
+++ b/graphics/mcf2graph/mcf2graph.mp
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% mcf2graph ver 4.91 Copyright (c) 2013-2023 Akira Yamaji
+% mcf2graph ver 4.92 Copyright (c) 2013-2023 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,
@@ -17,23 +17,23 @@
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mcf2graph is MetaPost macro package convert Molecular Coding Format(MCF) to graphic file
-% eps/sgv/png/mdl molfile
+% sgv/eps/png/mdl molfile
%--------------------------------------------------------------------------------------------------
% This package is located at : http://www.ctan.org/pkg/mcf2graph
% Suggestion or request mail to : mcf2graph@gmail.com
%--------------------------------------------------------------------------------------------------
-% Set outputformat to "eps" (.mps) : mpost FILENAME
-% Set outputformat to "png" (.png) : mpost -s ahangle=1 FILENAME
-% Set outputformat to "svg" (.svg) : mpost -s ahangle=2 FILENAME
-% Set outputformat to "eps" (.eps) : mpost -s ahangle=3 FILENAME
-% Set output information aux file (for TeX) : mpost -s ahlength=1 FILENAME
-% Set output information aux file (for spread sheet) : mpost -s ahlength=2 FILENAME
-% Set output aux library file : mpost -s ahlength=3 FILENAME
-% Set output MOL file (V2000) : mpost -s ahlength=5 FILENAME
-% Set output MOL file (V3000) : mpost -s ahlength=6 FILENAME
-% Set output report : mpost -s ahlength=7 FILENAME
+% Set outputformat to "svg" (.svg) : mpost FILENAME *default
+% Set outputformat to "png" (.png) : mpost -s ahangle=1 FILENAME
+% Set outputformat to "eps" (.eps) : mpost -s ahangle=2 FILENAME
+% Set outputformat to "eps" (.mps) : mpost -s ahangle=3 FILENAME
+% Set output information aux file (for TeX) : mpost -s ahlength=1 FILENAME
+% Set output information aux file (for spread sheet) : mpost -s ahlength=2 FILENAME
+% Set output aux library file : mpost -s ahlength=3 FILENAME
+% Set output MOL file (V2000) : mpost -s ahlength=5 FILENAME
+% Set output MOL file (V3000) : mpost -s ahlength=6 FILENAME
+% Set output report : mpost -s ahlength=7 FILENAME
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-message "* This is mcf2graph ver 4.91 2023.01.09";
+message "* This is mcf2graph ver 4.92 2023.01.29";
tracingstats:=1; prologues:=3; warningcheck:=0;
%-------------------------------------------------------------------------------------------------
newinternal string EN_;
@@ -43,8 +43,8 @@ string save_str[],tbl_atom_str[],str_tbl[],tag[],info_s[],arg_s[],aux_delimiter
file_input,file_output,default_temp_file,mpfont,atomfont,tempc,temps,blanks;
pair save_pair[],msize,mposition,fsize,fmargin,dum,save_mposition;
%-------------------------------------------------------------------------------------------------
-fig_num:=str_cnt:=tbl_cnt:=mangle:=sw_expand:=sw_frame:=sw_trimming:=sw_ext_all:=0;
-sw_abbreviate:=sw_numbering:=sw_output:=0; numbering_start:=1; numbering_end:=4095;
+fig_num:=str_cnt:=tbl_cnt:=mangle:=sw_expand:=sw_frame:=sw_trimming:=sw_ext_all:=sw_abbreviate:=0;
+sw_numbering:=sw_output:=0; numbering_start:=1; numbering_end:=4095;
%-------------------------------------------------------------------------------------------------
aux_max:=max_inf_num:=20; aux_delimiter:=";"; blanks:= " "; dum:=(-4091,0);
for i=1 upto aux_max: tag[i]:=""; endfor
@@ -83,18 +83,17 @@ def warning(expr s)= message "% "&decimal(fig_num)&fdr(3)(incr warning_cnt)&")"&
default_library:="mcf_library.mcf"; default_temp_file:="temp.mcf";
mpfont:="uhvr8r"; atomfont:="draw"; defaultfont:=mpfont;
%--default ahangle=45---------------------------------------------------------------------
-if ahangle=0: outputformat:="eps"; % eps format(.mps)
-ef ahangle=1: outputformat:="png"; hppp:=vppp:=0.12; % png format(600dpi)
+if ahangle=1: outputformat:="png"; hppp:=vppp:=0.12; % png format(600dpi)
ef ahangle=11: outputformat:="png"; hppp:=vppp:=0.06; % png format(1200dpi)
-ef ahangle=2: outputformat:="svg"; % svg format
-ef ahangle=3: outputformat:="eps"; % eps format(.eps)
-ef ahangle=45: outputformat:="eps"; % eps format(.mps) *default
+ef ahangle=2: outputformat:="eps"; % eps format(.eps)
+ef ahangle=3: outputformat:="eps"; % eps format(.mps)
+ef ahangle=45: outputformat:="svg"; % svg format *default
fi
%--default ahlength=4---------------------------------------------------------------------
if ahlength=1: sw_output:=Info; % output aux file
ef ahlength=2: sw_output:=Info+Table; % output aux file(Table mode)
ef ahlength=3: sw_output:=Info+Mcode; % output aux library
-ef ahlength=4: sw_output:=Fig; % *default
+ef ahlength=4: sw_output:=Fig; % output figure *default
ef ahlength=5: sw_output:=MOL2k; % output MOL(V2000)
ef ahlength=6: sw_output:=MOL3k; % output MOL(V3000)
ef ahlength=7: sw_output:=Report; % output report
@@ -104,11 +103,11 @@ if bboxmargin=3: ext(defaultfont:=mpfont; defaultscale:=.3; label.rt(inf_EN,(0,0
ef bboxmargin=4: sw_output:=Fig+Calc;
ext(defaultfont:=mpfont; defaultscale:=.3;
label.rt(inf_EN&" / "&cal_MW&" / "&decimal(num_MW-scantokens(inf_MW)),(0,0));) fi
-%--default outputtemplate:="%j-%3c."&"mps"------------------------------------------------
-if (outputformat="eps")and(ahangle<>3): outputtemplate:="%j-%3c."&"mps";
-ef outputformat="svg": outputtemplate:="s%3c-%{EN_}.svg";
-ef outputformat="png": outputtemplate:="p%3c-%{EN_}.png";
-else: outputtemplate:="%j-%3c."&outputformat; fi
+%--default outputtemplate:="%j-%3c."&"svg"------------------------------------------------
+if outputformat="svg": outputtemplate:="s%3c-%{EN_}.svg";
+ef outputformat="png": outputtemplate:="p%3c-%{EN_}.png";
+ef (outputformat="eps")and(ahangle=3): outputtemplate:="%j-%3c.mps";
+else: outputtemplate:="%j-%3c."&outputformat; fi
%-----------------------------------------------------------------------------------------
if sw_output>=Info:
message "* jobname="&jobname; message "* numbersystem="&numbersystem;
@@ -119,11 +118,9 @@ if sw_output>=Info:
message "* library file name="&jobname&"-lib.aux";
ef ahlength=5: message "* output MOL file(V2000)"; message "* "&jobname&"-nnn-"&"inf_EN"&".mol";
ef ahlength=6: message "* output MOL file(V3000)"; message "* "&jobname&"-nnn-"&"inf_EN"&".mol";
- ef ahlength=7: message "* output report file"; message "* file name="&jobname&"-report.txt"; fi
- message "* outputformat="&outputformat;
- if outputformat="png": message "* hppp="&decimal(hppp)&"/vppp="&decimal(vppp); fi
- message "* outputtemplate="&outputtemplate;
- message "* atomfont="&atomfont; message "* defaultfont="&defaultfont; fi
+ ef ahlength=7: message "* output report file"; message "* file name="&jobname&"-report.txt";
+ fi
+fi
clearit;
%--------------------------------------------------------------------------------------------------
?3:=?20:=Ph:=Ph1:=Ph2:=hz:=0; vt:=1;