1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
********************************************************************************
mcf2graph : Convert Molecular Coding Format to graphics with Metafont/Metapost
Author : Akira Yamaji
version : 3.72 2015-09-22
E-mail : akira.yamaji5@gmail.com
Located at : http://mirror.ctan.org/pkg/graphics/mcf2graph
Home page : http://molecoding.cocolog-nifty.com/blog/
********************************************************************************
1. Introduction
Molecular Coding Format(MCF) is new linear notation represent chmical
structure diagram. This 'Coding' is named from coding(programing) technique
like adressing,grouping,macro. There are no Meta language commands in MCF.
mcf2graph.mf(metapost/metafont macro) convert MCF file to graphics file
(pk font/PNG/SVG/EPS) or MDL MOL file(V2000).
The software,MCF manual,TeX example can get from authors web site.
2. The distribution of software
( 1) README This file
( 2) mcf2graph.mf Macro of Metafont / Metapost
( 3) mcf_manual.tex MCF syntax manual(LaTeX file)
( 4) mcf_man_soc.mf Molecular difinition file for mcf_manual.tex
( 5) mcf_man_soc-032.eps No.32 EPS(with color) file of (4)
( 6) mcf_manual.pdf PDF of (3) (used LaTeX,dvipdfmx)
( 7) mcf_example.tex LaTeX example,
Make 'mcf_exa_soc-info.aux' before typeset
mpost -s ahangle=0 mcf_exa_soc.mf
( 8) mcf_exa_soc.mf Molecular difinition file for mcf_example.tex
( 9) mcf_example.pdf PDF of (7) (used LaTeX,dvipdfmx)
(10) mcf_mplib_exa.tex luamplib v2.11(LuaLaTeX) example
(11) mcf_example.pdf PDF of (10) typeset with LuaTeX(LuaLaTeX)
3. How to use mcf2graph with Metapost
( 1) mpost -s ahangle=1 FILENAME output PNG file. (default value is eps)
( 2) mpost -s ahangle=2 FILENAME output SVG file.
( 3) mpost -s ahangle=3 FILENAME output MDL Molfile(V2000)
( 4) mpost -s ahangle=0 FILENAME output no graphic file.
( 5) mpost -s ahlength=1 FILENAME output first definition only (for test)
( 6) mpost -s ahlength=2 FILENAME output checklist.
4. Molecular definition file example
input mcf2graph.mf; % input main system
font_wd#:=30mm#; font_ht#:=20mm#; % font width,font height
max_bond_width:=0.2; % max fond length/font width
%-----------------------------------------------------------------------
beginfont("EN:Acetamiprid") % Molecular name 1
MCf(^^30,Ph,4\,!,NH,!,!~dr,N,!,CN)% % Molecular Coding Format
endfont
%-----------------------------------------------------------------------
bye
5. How to use mcf2graph with TeX(latex)
Large number of molecular structures can be gathering by using TEX.
mcf_example.tex is example of using LaTeX.
\documentclass{article}
\usepackage[dvipdfmx]{graphicx}% Change option depend on your tex system
**********************************************************
% insert part of info.aux file
%-------------------------------------------------------------------------
\INFO{{F:MCF_SOC2}{C:0}{EN:Acetamiprid}}%
%-------------------------------------------------------------------------
% or insert next line
\input mcf_exa_soc-info.aux % filename of souce file : mcf_exa_soc.mf
6. How to use mcf2graph with luamplib(LuaLaTeX)
It is possible to write MCF in LaTeX text with luamplib(ver.2.11).
mcf_mplib_exa.tex is example of using luamplib(LuaLaTeX).
\documentclass{article}
%-------------------------------------------------------------------------------
\mplibcodeinherit{enable}%
\mplibverbatim{enable}%
\everymplib{if unknown Ph1: input mcf2graph.mf; fi}%
%-------------------------------------------------------------------------------
**********************************************************
\begin{mplibcode}
font_wd:=100mm; font_ht:=50mm;
beginfont("EN:Acetamiprid") % Molecular name 1
MCf(^^30,Ph,4\,!,NH,!,!~dr,N,!,CN)% % Molecular Coding Format
endfont
\end{mplibcode}
%----------------------------------------------------------------------------
7. License
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, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
8. Changelog
ver. 3.50 / 2015-07-11 first version uploaded to ctan.
ver. 3.51 / 2015-07-19 '?6`2' can use as '{,``2,?6,}'
ver. 3.52 / 2015-07-20 '!!4`2' can use as '{,``2,!4,}'
ver. 3.53 / 2015-07-29 support luamplib(LuaLaTeX)
ver. 3.54 / 2015-08-03 maximum item number of MOLinfo can be changed
ver. 3.55 / 2015-08-04 support luamplib(v2.11), renew mcf_mplib_exa.tex
ver. 3.57 / 2015-08-14 improve AUX file format
ver. 3.58 / 2015-08-18 improve calculation of molecular formula and weight
ver. 3.59 / 2015-08-23 update MCF syntax manual
ver. 3.61 / 2015-09-01 fix bug in local setting of font_wd# and font_ht#
ver. 3.62 / 2015-09-07 improve numbering bond, numbering atom,
update MCF syntax manual
ver. 3.63 / 2015-09-14 add command option of numbering address,
update MCF syntax manual
ver. 3.70 / 2015-09-16 add new command | ,change syntax of !,!!,?,??
ver. 3.71 / 2015-09-18 delete command !!,??
ver. 3.72 / 2015-09-22 change command ^^ to < and delete ^^
|