%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Molecular Coding Format manual                by  Akira Yamaji 2021.02.21
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper]{article}
\usepackage[pdftex]{graphicx}
\usepackage[pdftex]{hyperref}
\usepackage{makeidx}
\makeindex
%---------------------
\usepackage{mcf_setup}
%%%%\pdfpkresolution=1200
%---------------------
\hypersetup{colorlinks=true,linkcolor=blue}
\topmargin=-18mm
\textheight=254mm
\textwidth=168mm
\oddsidemargin=0mm
%%%%\oddsidemargin=7mm
%%%%\evensidemargin=-7mm
\unitlength=1mm%
\makeatletter
%----------------------------------------------------------------------------
\newcount \fnum%
\newdimen \htman%
\newdimen \wdman%
\newdimen \htmans%
\newbox \fbox%
%----------------------------------------------------------------------------
\htman=45mm%
\wdman=94mm%
\htmans=42mm%
\fnum=29%
%----------------------------------------------------------------------------
\edef\MCFjobname{mcf_man_soc}%
%----------------------------------------------------------------------------
\edef\fext{pk}%
%%\edef\fext{mps}%
%%\edef\fext{png}%
%%\edef\fext{svg}%
%%\edef\fext{eps}%
%----------------------------------------------------------------------------
\font\@strufont=\MCFjobname\relax%
%----------------------------------------------------------------------------
\def\MCFgraph{%
\ifx\fext\@pk{\hspace{5mm}\@strufont\char\fnum}%
\else%
\edef\file@name{\MCFjobname-\z@num\fnum.\fext}%
\setbox\fbox=\hbox{\@strufont\char\fnum}%
\hspace{5mm}\includegraphics[width=\wd\fbox,height=\ht\fbox]{\file@name}%
\fi%
\global\advance\fnum\@ne\relax%
}%
%---------------------------------------------------------------------------
\def\put@char{%
  \begin{picture}(75,130)%
     \put(0,120){\bf [\NO]\EN}%
     \put(5,115){\small\tt FM:\fm{ }MW:\mw}%
     \put(5,0){\font\@strufont=\File\relax%
               \hbox{\@strufont\char\Char}}%
  \end{picture}%
}%
%----------------------------------------------------------------------------
\def\INFO#1{\@for\@temp:=#1\do{\tag@var\@temp}\put@char}%
%----------------------------------------------------------------------------
\begin{document}
\title{\Huge\sf Molecular Coding Format manual}
\author{Akira Yamaji}
\date{\today}
\maketitle
\begin{center} Located at http://www.ctan.org/pkg/mcf2graph \end{center}
\begin{center} Suggestion or request mail to: mcf2graph@gmail.com \end{center}
%-----------------------------------------------------------------------------
\thispagestyle{empty}
\vspace{5mm}%
{\@strufont%
\char1 \char2 \char3 \char4\\
\char5 \char6 \char7 \char8\\
\char9 \char10\char11\char12\\
\char13\char14\char15\char16\\
\char17\char18\char19\char20\\
\char21\char22\char23\char24\\
\char25\char26\char27\char28
}%
%-----------------------------------------------------------------------------
\twocolumn
\thispagestyle{empty}
\tableofcontents
%-----------------------------------------------------------------------------
\linethickness{0.08mm}%
%----------------------------------------------------------------------------
\newpage
\section{Introduction}
Molecular Coding Format(MCF) is new linear notation
represent chemical structure diagrams.
This Coding is named from programing technique
such as operator, array, scope, macro, adressing, etc.
mcf2graph convert from MCF to pk font, PNG, SVG, EPS, MOL file.
It is also able to calculate molecular weight,
exact mass, molecular formula.
%-----------------------------------------------------------------------------
\section{MCF syntax}
\subsection{Make bond}
\subsubsection{Chain}
\begin{verbatim}
  real number plus (+): Counterclockwize 
  real number minus(-): Clockwize

  <-10,-30,45,-45,30,-30,60
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Chain use !,!n}
\index{"!}%
\begin{verbatim}
  !  : take value 60 or -60 depend on
        current angle and environment
  !6 : !,!,!,!,!,!

  <-30,!,!,!,!,!,!
  <-30,!6
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Jump to atom}
\index{"@}%
\begin{verbatim}
  @n : Jump to An
  ** An: atom number(-999<=n<=4095)
       
  <-30,!6,@3,0,!,@5,-30
\end{verbatim}
\MCFgraph
%------------------------------------
\subsubsection{Branch bond}
\index{\textbackslash}%
\begin{verbatim}
  \ : 0

  <-30,!6,@3,\,!
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Branch modified bond}
\index{*\textbackslash}%
\index{\textbackslash*}%
\index{\textbackslash\textbackslash}%
\index{*\textbackslash*}%
\begin{verbatim}
   \   : 0
   *\  : 0~wf
   \*  : 0~zf
   \\  : 0~dm
   *\* : 0~wv

  <30,!8,
  @2,\,!,@4,*\,!,@6,\*,!,@8,\\,!,@10,*\*,!
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\index{\textasciicircum}% ^
\index{\textasciitilde}% ~
\index{`}%
\begin{verbatim}
  <30,!6,
  \~dr,!,   : 0~dr,!
  \`1.5,-90 : 0`1.5,-90
  \^15,-60  : 0^15,-60
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Connect atom}
\index{\&}%
\begin{verbatim}
  &n : Connect to An

  <-30,!6,@3,\,!3,&6~bd,@9,&4~bz
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Ring}
\index{?}%
\begin{verbatim}
  ?n : n membered ring(3<=n<=20)
  ?6 : <-120,60,60,60,60,60,&1
   ?6
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Rotate current angle}
\index{\textgreater}%
\begin{verbatim}
  <angle : rotate current angle

  0,0,<90,0,<-90,0,0,{1,2,3,4,5}=vf 
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Change bond type}
\subsubsection{Double,triple}
\index{\textasciitilde}%
\index{\textasciitilde\textasciitilde}%
\index{"!"!}%
\index{"!"!"!}%
\index{dm}%
\index{dl}%
\index{dr}%
\index{db}%
\index{tm}%
\begin{verbatim}
  a~type : ~~type,a
  dm  : double middle
  dl  : double left side
  dr  : double right side
  db  : double left or right side
  tm  : triple
  !!  : !~db  / !!! : !~tm

  <-30,!~dm,!,!~dl,!,!~dr,!~db,!~db,!,!~tm
  <-30,!~dm,!,!~dl,!,!~dr,!!  ,!!  ,!,!!!
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
    dm      dl     dr   db  db      tm
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Wedge}
\index{wf}%
\index{wb}%
\index{zf}%
\index{zb}%
\begin{verbatim}
  wf : wedge forward / wb : wedge backward
  zf : wedge dotted
  zb : wedge dotted backward

  <-30,!~wf,!,!~wb,!,!~zf,!,!~zb
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
    wf       wb       zf       zb
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Vector}
\index{vf}%
\index{vb}%
\begin{verbatim}
  vf:vector forward / vb:vector backward

  <-30,!~vf,!,!~vb
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
    vf        vb
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Dotted,wave}
\index{dt}%
\index{wv}%
\index{bd}%
\index{bz}%
\begin{verbatim}
  Bn=bond type : change bond type at Bn
  dt : dotted  /  wv : wave
  bd : broad  /  bz : broad dotted 

  <-30,!7,1=dt,3=wv,5=bd,7=bz
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
    dt      wv       bd       bz
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Change multiple bond type}
\index{vf}%
\begin{verbatim}
  {2,4,6}=dr : 2=dr,4=dr,6=dr

  <30,!7,{2,4,6}=dr
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Over line}
\index{si\_}%
\index{wf\_}%
\index{wb\_}%
\index{zf\_}%
\index{zb\_}%
\index{bd\_}%
\index{dl\_}%
\index{dr\_}%
\index{dm\_}%
\begin{verbatim}
  si_ : single over line 
  wf_ : wedge forward over line 
  wb_ : wedge backward over line 
  zf_ : wedge dotted forward over line 
  zb_ : wedge dotted backward over line 
  bd_ : broad over line 
  dl_ : duble left over line 
  dr_ : duble right over line 
  dm_ : duble over line 

  <30,!8,!,60,90`18,
  {2~si_,4~wf_,6~wb_,8~zf_,10~zb_,
   12~bd_,14~dl_,16~dr_,18~dm_}:/_`2
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Change bond length}
\subsubsection{Chain length}
\index{`}%
\begin{verbatim}
  (!,!n)`length : change length of !,!n

  <-30,!2,!4`1.2,!2
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\index{\#}%
\index{\#\#}%
\begin{verbatim}
 #n : bond length=n
 ## : reset bond length

  <-30,!2,#1.2,!4,##,!2
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Ring length}
\begin{verbatim}
  ?n`length : change ring length

  ?6,@4,\,?6`1.2
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Change atom}
\subsubsection{Insert atom}
\begin{verbatim}
  Insert hetero atom

  <-30,!2,O,!2,N,!2
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Addressed atom}
\index{:}%
\begin{verbatim}
  2:O : change A2 C to O
  {3,4}:N : change  A3,A4 C to N

  <30,!4,2:O,{3,4}:N
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Brock address}
\index{\textbar}% |
\begin{verbatim}
  | : divide brock

  ?6,@4,\,|,?6,2:O
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Reset brock address}
\index{\textbar\textbar}% ||
\begin{verbatim}
  || : reset brock adress

  ?6,@4,\,|,?6,||,2:N
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Absolute address}
\index{\$}% $
\begin{verbatim}
  $2:N : change A$2 C to N  **1<=n<=3095

  ?6,@4,\,|,?6,$2:N
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Relative address}
\begin{verbatim}
  -2:N : change A(-2) C to N **-999<=n<=-1

  ?6,@4,\,?6,-2:N
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Charged atom}
\begin{verbatim}
  p_ : positive / n_ : negative

<-30,!2,N,??,p_,!2,S,n_^180,
!6,7:N,7:??,9:S,7:n_,9:n_^180
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Fuse ring}
\subsubsection{Attached 1 bond}
\begin{verbatim}
  ?6,3=?6 : fuse ?6 at B3
  ** Bn(n:-999<=n<=4095): bond number

  ?6,3=?6
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\begin{verbatim}
  ** fused ring size depend on 
  attached bond length

  ?6,@4,\,?6`1.2,5=?6,11=?6
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\begin{verbatim}
  ?6,3=?6[13] : fuse ?6[13] at B3
  ?6[13]: 6 membered ring scaled 13/10
  ** ?m[n] (5<=m<=8,11<=n<=15)

  ?6,3=?6[13]
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\begin{verbatim}
  ?6,{-3,-4,-4,-2,-2,-4,-4}=?6
  ?6,{4,8,13,20,25,28,33}=?6
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Attached 2 bond}
\begin{verbatim}
  (4,11)=?6[4]  : fuse 4/6 ring to B11..B4
  (4,11)=?5[3]  : fuse 3/5 ring to B11..B4
  (4,11)=?4[2]  : fuse 2/4 ring to B11..B4
  ** ?m[n] (4<=m<=6,n=m-2)

1:<30,?6,3=?6,(11,4)=?6[4]
2:<30,?6,3=?6,(11,4)=?5[3]
3:<30,?6,3=?6,(11,4)=?4[2]
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
        1             2             3
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Attached 2 bond}
\begin{verbatim}
  (16,4)=?6[3] : fuse 3/6 ring to B16..B4
  (16,4)=?5[2] : fuse 2/5 ring to B16..B4
  ** ?m[n] (5<=m<=6,n=m-3)

1:?6,{3,10}=?6,(16,4)=?6[3]
2:?6,{3,10}=?6,(16,4)=?5[2]
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
         1                 2
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Attached 4 bond}
\begin{verbatim}
  (21,4)=?6[2] : fuse 2/6 ring to B21..B4

  MC(<-30,?6,{3,10,15}=?6,(21,4)=?6[2])

  ** ?m[n] (m=6,n=2)
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Spiro ring}
\begin{verbatim}
  @4,?5 : add ?5 at A4

  <30,!6,@4,?5

  @An : jump to An
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Group}
\subsubsection{Insert group}
\index{/}%
\index{Ph}%
\begin{verbatim}
  /  : single
  <-30,!,/_,!,/!,!3,/!2,!,/?!,
      !3,/??!,!,/Ph^-30,!

  ** /_   : methyl      /!  : ethyl
     /!2  : propyl      /?! : isopropyl
     /??! : tert-butyl  /Ph : phenyl
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Insert modified group}
\index{//}%
\index{*/}%
\index{/*}%
\index{*/*}%
\index{**}%
\begin{verbatim}
  //  : double (double middle)
  */  : wedge forward
  /*  : wedge dotted forward
  */* : wave
  **  : direct

  <30,!,//O,!2,/*H,!2,*/H,!2,*/*H,!2,**?3,!
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      //      /*     */     */*     **
\end{verbatim}
%-----------------------------------------------------------------------------
\index{\textasciicircum}% ^
\index{\textasciitilde}% ~
\index{`}%
\index{\textless}%
\begin{verbatim}
  ~ : change type
  ^ : change angle
  ` : change length
  > : change environment

  <-30,``1,!,
   /_`2^30,!2,/!2>lr,!2,/!2>rl,!)
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Add group}
\begin{verbatim}
  <30,!17,2:/_,4:/!,6:/!2,
   10:/?!,14:/??!,16:/Ph^-60
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Add modified group}
\begin{verbatim}
  ~,^,` : change type,angle,length

  <30,!6,
  {2~wf,4~zf,6^-30}:/_
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\begin{verbatim}

  ^,`,> : change angle,length,environment

  <-30,!7`1,
  3:/_`2^30,5:/!2>lr,7:/!2>rl
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Chain environment}
\subsubsection{Horizontal,vertical}
\index{hz}%
\index{vt}%
\index{"'}%
\begin{verbatim}
  >hz : horizontal environment (default)
  >vt : vertical environment

  ?4,
  {3^-90,3^-30,3^90}:/'(!3,"{hz}")>hz,
  {1^-60,1,1^60}:/'(!3,"{vt}")>vt
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Left-right,right-left}
\index{lr}%
\index{rl}%
\begin{verbatim}
  >lr : left-right environment
  >rl : right-left environment

  <-30,!6,
  {3^-30,3,3^30}:/'(!3,"{lr}")>lr,
  {5^-30,5,5^30}:/'(!3,"{rl}")>rl
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Fixed rotate angle}
\index{\textgreater}%
\begin{verbatim}
  >n : rotate n

  <30,!4,
  2:/!6>30,  % 2:\,30,30,30,30,30,30
  4:/!4>-45  % 4:\,-45,-45,-45,-45

\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Multi rotate angle}
\begin{verbatim}
  >'(90,-90,...) : rotate 90,-90,...

  <30,!6,6>'(90,-90,90,-90,90):/!5
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Miscellaneous}
%-----------------------------------------------------------------------------
\subsubsection{Abbreviated parts}
\index{NH}%
\index{N"!}%
\index{N"!2}%
\index{SO}%
\index{SOO}%
\begin{verbatim}
  NH  : N,/H~nl
  N!  : N,/_
  N!2 : N,/!
  SO  : S,//O
  SOO : S,//O^35,//^-35

  <-30,!2,NH,!2,N!,!2,N!2,SO,!2,SOO,!
\end{verbatim}
\MCFgraph
\index{?"!}%
\index{??}%
\index{??"!}%
\index{N?"!}%
\begin{verbatim}
  ?!   : /_,!
  ??   : /_^35,/_-35
  /?!  : isopropyl
  /??! : tert-butyl
  /N?! : dimethylamino

  <30,!9`1,?!,!,??,!,
  2:??,4:/??,6:/??!,8:/N?!
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Parts definition}
\begin{verbatim}
   '(..) : user defined parts

  iBuOH:='(!,/_,!,OH);
  MC(<30,?6,{4,6}:/iBuOH)
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Parts inline definition}
\begin{verbatim}
   <30,!, /'(!,/_,!,OH),
       !4,/'(!,/_,!,OH),!3

   <30,!8,{2,6}:/'(!,/_,!,OH)
\end{verbatim}
\MCFgraph
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Option parameter}
%------------------------------------------------------------------------------
\subsection{Angle parameter}
\index{mangle}%
\begin{verbatim}
  mangle=0   ** default

  MCat(0.2,0.5)(Ph)
  mangle:=30;
  MCat(0.8,0.5)(Ph)
\end{verbatim}
\MCFgraph
%------------------------------------------------------------------------------
\subsection{Size/Ratio parameter}
%-----------------------------------------------------------------------------
\subsubsection{Bond length}
\index{blength}%
\begin{verbatim}
  (fit to font size)
  blength=0   ** default
\end{verbatim}
\MCFgraph
%-----------------------------------------
\begin{verbatim}
  (ratio bond/font width)
  blength=0.1  ** (0<blength<=1)
  blength=60mm(width)*0.1=6mm
\end{verbatim}
\MCFgraph
%-----------------------------------------
\begin{verbatim}
  (bond length)
  blength=9mm
  ** (blength>1) ignore msize(w,h)
\end{verbatim}
\MCFgraph
%------------------------------------------------------------------------------
\subsubsection{Molecular size}
\index{msize}%
\begin{verbatim}
  msize=(1,1)  ** default
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------
\begin{verbatim}
  msize=(0.25,1)
  msize=40mm-4mm*0.25=9mm
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------
\begin{verbatim}
  msize=(11mm,11mm)
\end{verbatim}
\MCFgraph
%------------------------------------------------------------------------------
\subsubsection{Molecular position}
\index{mposition}%
\begin{verbatim}
  mposition=(0.5,0.5) ** default
\end{verbatim}
\MCFgraph
%--------------------------------------------------------------
\begin{verbatim}
  mposition=(1,0)
\end{verbatim}
\MCFgraph
%--------------------------------------------------------------
\begin{verbatim}
  mposition=(10mm,4mm)
\end{verbatim}
\MCFgraph
%------------------------------------------------------------------------------
\subsection{Size parameter}
%-----------------------------------------------------------------------------
\subsubsection{Font size}
\index{fsize}%
\begin{verbatim}
 fsize=(font width,font height)
 ** default: (30mm,20mm)

 fsize=(40mm,15mm)
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Font margin}
\index{fmargin}%
\begin{verbatim}
 fmargin=(margin left rigth,top bottom)
 ** default: (0.4mm,0.4mm)

 fmargin=(10mm,2mm)
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Offset thickness of bond}
\index{offset\_thickness}%
\begin{verbatim}
  default: offset_thickness=0.2pt
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      0pt       0.2pt       0.5pt
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Offset of double bond gap}
\index{offset\_bond\_gap}%
\begin{verbatim}
  default: offset_bond_gap=0.3pt
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      0.0pt      0.3pt      1.0pt
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Offset of atom width}
\index{offset\_atom}%
\begin{verbatim}
  default: offset_atom=0.8pt
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      0.0pt      0.8pt      2.0pt
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Offset of wedge width}
\index{offset\_wedge}%
\begin{verbatim}
  default:  offset_wedge=0.4pt
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      0.0pt      0.4pt      1.0pt
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Max bond length}
\index{max\_blength}%
\begin{verbatim}
  default:  max_blength=10mm
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
     6mm       8mm         20mm
\end{verbatim}
%-----------------------------------------------------------------------------
\subsection{Ratio parameter}
%-----------------------------------------------------------------------------
\subsubsection{Thickness/bond length}
\index{ratio\_thickness\_bond}%
\begin{verbatim}
  default:  ratio_thickness_bond=0.015
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      0.005      0.015      0.030
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Char/bond thickness}
\index{ratio\_char\_bond}%
\begin{verbatim}
  default:  ratio_char_bond=1.5
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      1.0        1.5        2.0
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Bond gap/bond length}
\index{ratio\_bondgap\_bond}%
\begin{verbatim}
  default:  ratio_bondgap_bond= 0.15
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      0.10       0.15       0.20
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Atom/bond length}
\index{ratio\_atom\_bond}%
\begin{verbatim}
  default:  ratio_atom_bond= 0.36
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
       0.25      0.36      0.46
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Wedge/bond length}
\index{ratio\_wedge\_bond}%
\begin{verbatim}
  default:  ratio_wedge_bond=0.12
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      0.10       0.12       0.20
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Font atom gap/atom length}
\index{ratio\_atomgap\_atom}%
\begin{verbatim}
  default:  ratio_atomgap_atom= 0.050
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
      0.0       0.050       0.12
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Chain/ring length}
\index{ratio\_chain\_ring}%
\begin{verbatim}
  default:  ratio_chain_ring= 0.66
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
       0.4         0.65        1.0
\end{verbatim}
%-----------------------------------------------------------------------------
\subsubsection{Zebra gap/bond length}
\index{ratio\_zebragap\_bond}%
\begin{verbatim}
  default:  ratio_zebragap_bond=0.12
\end{verbatim}
\MCFgraph
\vspace{-3mm}%
\begin{verbatim}
       0.06      0.12      0.20
\end{verbatim}
%-----------------------------------------------------------------------------
%%\newpage
%-----------------------------------------------------------------------------
\subsection{Drawing mode}
%-----------------------------------------------------------------------------
\subsubsection{Numbering atom}
\index{numberA}%
\index{numberA\_start}%
\index{numberA\_end}%
\begin{verbatim}
  numberA_start:=3; numberA_end:=8;
  default: sw_numberA=0 :
    numberA_start=1 numberA_end=4095
\end{verbatim}
\MCFgraph
\begin{picture}(5,20)
\put(0,14){\makebox[5mm]{\tt 1}}
\put(0, 8){\makebox[5mm]{\tt 2}}
\put(0, 2){\makebox[5mm]{\tt 3}}
\end{picture}
%-----------------------------------------------------------------------------
\subsubsection{Numbering bond}
\index{numberB}%
\index{numberB\_start}%
\index{numberB\_end}%
\begin{verbatim}
  numberB_start:=3; numberB_end:=8;
  default: sw_numberB=0 :
    numberB_start=1 numberB_end=4095
\end{verbatim}
\MCFgraph
\begin{picture}(5,20)
\put(0,14){\makebox[5mm]{\tt 1}}
\put(0, 8){\makebox[5mm]{\tt 2}}
\put(0, 2){\makebox[5mm]{\tt 3}}
\end{picture}
%-----------------------------------------------------------------------------
\subsubsection{Trimming mode}
\index{sw\_trimming}%
\begin{verbatim}
  sw_trimming:=0;  ** default
  msize:=(1,0.7);
  MCat(0.2,0.3)(Ph)
  MCat(0.8,0.7)(Ph)
\end{verbatim}
\MCFgraph
\begin{verbatim}
  sw_trimming:=1;
  MCat(0.2,0.3)(Ph)
  MCat(0.8,0.7)(Ph)
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Expand mode}
\index{sw\_expand}%
\begin{verbatim}
MCat(0, .5)(<30,Ph,4:/COOH,3:/NH2)
sw_expand:=1;
MCat(1, .5)(<30,Ph,4:/COOH,3:/NH2)
** default: sw_expand=0
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Group off mode}
\index{sw\_group\_off}%
\begin{verbatim}
  ** default: sw_group_off=0
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Single bond mode}
\index{sw\_single}%
\begin{verbatim}
  ** default: sw_single=0
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Frame}
%-----------------------------------------------------------------------------
\subsubsection{Font frame}
\index{sw\_fframe}%
\begin{verbatim}
  (Draw font frame)
  fmargin:=(5mm,2mm);
  sw_fframe=1
\end{verbatim}
\MCFgraph
\begin{verbatim}
  (Frame inside margin)
  sw_fframe=2
\end{verbatim}
\MCFgraph
\begin{verbatim}
  (Draw both frame)
  sw_fframe=3
\end{verbatim}
\MCFgraph
\begin{verbatim}
  (Small dot at corner)
  sw_fframe=4
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Molecular frame}
\index{sw\_mframe}%
\begin{verbatim}
  sw_mframe=1  ** default:sw_mframe=0
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Atom frame}
\index{sw\_aframe}%
\begin{verbatim}
  sw_aframe=1  ** default: sw_aframe=0
  MC(<30,COOH,!,COOH)
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Remove indent}
\index{sw\_indent\_off}%
\begin{verbatim}
  ** default  sw_indent_off=0
  beginfont(": Ph         ",
            ":  ,{1,4}:N  ",
            ":  ,{2,3}:/_ ")
  endfont

    mc1=" Ph"
    mc2="  ,{1,4}:N"
    mc3="  ,{2,3}:/_"

  sw_indent_off=1
    mc1="Ph"
    mc2=",{1,4}:N"
    mc3=",{2,3}:/_"

  mc="Ph,{1,4}:N,{2,3}:/_" ** 0 or 1
\end{verbatim}
%-----------------------------------------------------------------------------
\newpage
%-----------------------------------------------------------------------------
\subsection{Parameter setting}
\subsubsection{Local parameter setting}
\index{beginfont()}%
\index{endfont}%
\begin{verbatim}
  beginfont()
    MC(Ph)
  endfont
  beginfont()
    %--------------------------
    ratio_thickness_bond:=0.05;
    %--------------------------
    MC(Ph)
  endfont
  beginfont()
    MC(Ph)
  endfont
\end{verbatim}
\MCFgraph\MCFgraph\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Global parameter setting}
\begin{verbatim}
  beginfont()
    MC(Ph)
  endfont
  %--------------------------
  ratio_thickness_bond:=0.05;
  %--------------------------
  beginfont()
    MC(Ph)
  endfont
  beginfont()
    MC(Ph)
  endfont
\end{verbatim}
\MCFgraph\MCFgraph\MCFgraph
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Function}
%-----------------------------------------------------------------------------
\subsection{Function MC()}
\index{MC()}%
\begin{verbatim}
  (Draw molecule)

  msize=(a,b)        **default (1,1)
  mposition=(c,d)    **default (0.5,0.5)

  a: ratio molecular width/font width
  b: ratio molecular hight/font hight
  c: x axis position
  d: y axis position

  beginfont()
    MC(<30,Ph,3:/F,4:/Cl)
  endfont
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Function MCat()}
\index{MCat()}%
\begin{verbatim}
  (Draw molecule at mposition)

  MCat(c,d)(....) :

  mposition:=(c,d); MC(....)

  c: x axis position  d: y axis position

  defaultsize:=5bp;
  fsize:=(40mm,40mm); fmargin:=(3mm,3mm);
  blength:=0.1; sw_fframe:=1;
  mangle:=0;
  for i=1 step -0.5 until 0:
    for j=0 step 0.5 until 1:
      MCat(j,i)(Ph,4:N)
      add(drawarrow((A1+A1up**aw)..A1);
          label(decimal(mangle),
                p0+(0.5w,0.5h));
      )
      mangle:=mangle+30;
    endfor
  endfor

\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Function check\_mc()}
\index{check\_mc()}%
\begin{verbatim}
  (immediately compile)

  beginfont("EN:Pyridine")
    MC(Ph,<30,2:N)
  endfont

  (check mcf and compile)

  beginfont("EN:Pyridine",":<30,Ph,2:N")
    if check_mc(mc)=0: MC(scantokens(mc)) fi
  endfont

  ** error in mcf  check_mc(mc)=1
  beginfont("EN:Pyridine",":<30,Ph,2):N")
    if check_mc(mc)=0: MC(scantokens(mc)) fi
  endfont

\end{verbatim}
\MCFgraph\hspace{15mm}\MCFgraph
\begin{verbatim}
  check_mc(mc)=0   check_mc(mc)>=1
\end{verbatim}
%===============================================================================
\newpage
\subsection{Function add()}
\index{add()}%
\index{plus}%
\index{minus}%
\index{lonepair}%
\index{lonepairdiam}%
\index{lonepairspace}%
\index{circlediam}%
\index{circlepen}%
\index{w}%
\index{h}%
\index{aw}%
\index{em}%
\index{p0}%
\index{l}%
\index{/*}%
\index{**}%
\index{\textgreater\textgreater}%
\index{An}%
\index{A[]}%
\index{A[]ang}%
\index{A[]up}%
\index{A[]left}%
\index{A[]right}%
\index{A[]down}%
\index{Bn}%
\index{B[]}%
\index{B[]s}%
\index{B[]m}%
\index{B[]e}%
\index{B[]ang}%
\index{B[]up}%
\index{B[]left}%
\index{B[]right}%
\index{B[]down}%
\index{defaultscale}%
\index{labeloffset}%
\begin{verbatim}
(Add graphic to molecule)

 w:       molecular width
 h:       molecular height
 aw:      atom font size
 em:      label font size
 p0:      origin of molecular structure
 l:       bond length

 An:      atom number
 A[m]:    atom position
 A[m]ang: branch angle of A[m]
 A[m]up:    dir A[m]ang
 A[m]left:  dir A[m]ang+90
 A[m]right: dir A[m]ang-90
 A[m]down:  dir A[m]ang+180

 Bn:      bond number
 B[m]:    bond(path)
 B[m]s:   bond start position
 B[m]m:   bond middle position
 B[m]e:   bond end position
 B[m]ang: bond angle
 B[m]up:    dir B[m]ang
 B[m]left:  dir B[m]ang+90
 B[m]right: dir B[m]ang-90
 B[m]down:  dir B[m]ang+180

 plus  : '+' circled
 minus : '-' circled
   circlediam = 0.6aw (default)
   circlepen =  0.2bp (default)

 lonepair r: ':' rotated r
   lonepairdiam  = 0.3aw (default)
   lonepairspace = 0.7aw (default)

 ** : scaled
 << : rotated
 a /* b : point b of a

beginfont("EN:add() 1")
 fsize:=(75mm,45mm);
 sw_aframe:=sw_mframe:=1;
 max_blength:=12mm;
 msize:=(.91,.85);
 MCat(.5,.8)(<30,?6,{2,5}:O)
 %-------------------------------------
 add(
  defaultscale:=.8;
  labeloffset:=.3aw;
  dotlabel.lft("p0",p0);
  dotlabel.rt( "p0+(w,h)",p0+(w,h));
  dotlabel.ulft("A1",A1);
  drawarrow A1..A1+(l,0)<<A1ang;
  dotlabel.lrt( "B3s",B3s);
  dotlabel.rt("B3m",B3m);
  drawarrow B3m..B3m+(l,0)<<(B3ang+90);
  dotlabel.ulft("A6",A6);
  drawarrow A1{A1down}..A6;
  dotlabel.urt( "B3e",B3e);
  label.rt("An="&decimal(An)&" / "&
    "Bn="&decimal(Bn),p0+(-w,-1.5em));
  label.rt("aw="&decimal(aw),p0+(w,-1.5em));
  label.rt("em="&decimal(em),p0+(0,-1.5em));
  label.rt("w="&decimal(w),p0+(-w,-3em));
  label.rt("h="&decimal(h),p0+(0,-3em));
  label.rt("l="&decimal(l),p0+(w,-3em));
 )
endfont
\end{verbatim}
\MCFgraph
\begin{verbatim}
beginfont("EN:add() 2")
 fsize:=(60mm,20mm);
 msize:=(1,0.85);
 %---------------------------------------
 MCat(0,0)(<30,Ph,3=dl,4:/NH2)
 %---------------------------------------
 add(
  labeloffset:=.7aw;
  label.top(lone_pair 90,A7);
  drawarrow 
    (A7+up**1.2aw){A7left}
     ..{B7right}B7/*0.3;
  drawarrow
    B3m..A3+B2up**1.5aw..{A3down}A3;
 )
 %---------------------------------------
 MCat(1,0)(<30,?6,{1,5}=dl,4://NH2)
 %---------------------------------------
 add(
  labeloffset:=.7aw;
  label.top(plus,A7);
  label.urt(minus,A3);
  label(lonepair A3ang,A3+A3up**.7aw);
 )
 %---------------------------------------
 ext(drawdblarrow (.4w,.4h)..(.55w,.4h);)
 %---------------------------------------
endfont
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\newpage
\subsection{Function ext()}
\index{ext()}%
\index{w0}%
\index{h0}%
\index{aw}%
\index{em}%
\index{n}%
\index{ratio\_thickness\_char}%
\index{defaultscale}%
\begin{verbatim}
(Extra graphic to font)
 
 w:    font width
 h:    font height
 w0:   font width-2xpart(fmargin)
 h0:   font height-2ypart(fmargin)
 aw:   atom font size
 em:   label font size
 p0:   fmargin

 n:    molecular number
 p[m]: molecular origin position
 w[m]: molecular width
 h[m]: molecular height

 ratio_thickness_char:
   pen thickness / char width
%----------------------------------------
beginfont()
 fsize:=(70mm,30mm;);
 blength:=0.065;
 %---------------------------------------
 MCat(0.1,0.5)(
   <-210,60`1,60`1,60`1,{1,3}=dl,
   1:/R1,4:/R2^-60
   )
   add(
     defaultscale:=0.6;
     label.bot("Diene",p0+(0.5w,0));
   )
 MCat(0.4,0.5)(
   <-30,-60`1,1=dl,1:/R3,2:/R4^60)
   add(defaultscale:=0.6;
   label.bot("Dienophile",p0+(.5w,0));
  )
 MCat(0.9,0.5)(
   <30,?6,6=dl,2:/R2,3:/R4,4:/R3,5:/R1
 )
 %---------------------------------------
 ext(
  drawarrow (.52w,.5h)..(.6w,.5h);
  defaultscale:=0.7;
  label("+",(0.25w,0.5h));
  ratio_thickness_char:=0.125;
  label.bot("Diels-Alder Reaction",
            (.5w,h));
 )
 %---------------------------------------
endfont
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsubsection{Local ext() setting}
\begin{verbatim}
beginfont("EN:?3")
  fsize:=(12mm,15mm);
  MCat(0.5,1)(<30,?3)
endfont
beginfont("EN:?4")
  fsize:=(12mm,15mm);
  MCat(0.5,1)(?4)
  %-------------------------------
  ext(label.top(inf_EN,(0.5w,0));)
  %-------------------------------
endfont
beginfont("EN:?5")
  fsize:=(12mm,15mm);
  MCat(0.5,1)(?5)
endfont
beginfont("EN:?5")
  fsize:=(12mm,15mm);
  MCat(0.5,1)(?6)
endfont
\end{verbatim}
\MCFgraph\MCFgraph\MCFgraph\MCFgraph
\subsubsection{Global ext() setting}
\index{ext\_clear}%
\begin{verbatim}
ext_clear: reset global ext()

beginfont("EN:?3")
  fsize:=(12mm,15mm);
  MCat(0.5,1)(<30,?3)
endfont
%-------------------------------
ext(label.top(inf_EN,(0.5w,0));)
%-------------------------------
beginfont("EN:?4")
  fsize:=(12mm,15mm);
  MCat(0.5,1)(?4)
endfont
beginfont("EN:?5")
  fsize:=(12mm,15mm);
  MCat(0.5,1)(?5)
endfont
%---------
ext_clear;
%---------
beginfont("EN:?6")
  fsize:=(12mm,15mm);
  MCat(0.5,1)(?6)
endfont
\end{verbatim}
\MCFgraph\MCFgraph\MCFgraph\MCFgraph
%-----------------------------------------------------------------------------
\newpage
%-----------------------------------------------------------------------------
\section{MCF example}
%-----------------------------------------------------------------------------
\subsection{Luciferin}
\index{check\_mc()}%
\begin{verbatim}
beginfont("EN:Luciferin","MW:280.33",
  %-------------------------------------
  ": <30,Ph,3=?5,@8,\,?5,{9,16}=dl,    ",
  ": {9,14}:N,{7,11}:S,1:/OH,-2:*/COOH ")
  %-------------------------------------
  fsize:=(50mm,20mm);
  if check_mc(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Colchicine}
\begin{verbatim}
beginfont("EN:Colchicine","MW:385.41",
  %-------------------------------------
  ": <30,Ph,{1,2,6}:/O!,-4=?7,-5=?7,  ",
  ": {-1,-4,-6}=dl,-2://O,-3:/O!,     ",
  ": @9,\,NH,!,//O,!                  ")
  %-------------------------------------
  fsize:=(50mm,20mm);
  if check_mc(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Paclitaxel}
\begin{verbatim}
beginfont("EN:Paclitaxel","MW:853.91",
  %------------------------------------
  ": ?6,5=dl,@3,#1,36,45,45,45,45,##, ",
  ": &.$5",                           ",
  ": -4=?6,-4=?4,-1=wb,-3=wf,-1:O,||, ",
  ": 4:??,6:/_,{3^-60,15}:*/OH,       ",
  ": 8:/*H^-60,",                     ",
  ": 9:*/_^60,10://O,                 ",
  ": @1,\,O,!,//O,!,*/OH,!,/Ph,60~wf, ",
  ":   NH,-60,//O,60,Ph,              ",
  ": @7,\*,O,-45,//O,60,Ph,           ",
  ": @11,*\,O,-60,//O,60,             ",
  ": @12,\*^-15,O,60,//O,-60          ")
  %------------------------------------
  fsize:=(50mm,25mm);
  if check_mc(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Lycorine}
\begin{verbatim}
beginfont("EN:Lycorine","MW:287.31")
  %--------------------------------------
  ": Ph,-4=?6,-2=?6,6=?5,(9,12)=?5[3], ",
  ": 13=dl,8:N,{15,17}:O,              ",
  ": 9:/*H^180,10:*/H^60,              ",
  ": 13:*/OH,14:/*OH                   ")
  %--------------------------------------
  fsize:=(50mm,20mm);
  if check_mc(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Gibberellin}
\begin{verbatim}
beginfont("EN:Gibberellin A3","MW:346.37");
  %----------------------------------------
  ": <18,?5,3=?7,5=?6[12],@8,160`1.3,&3, ",
  ": 13=dl,6=wf,8=wb,                    ",
  ": @5,40~zf`1,O,50,//O^180,&14~zb,     ",
  ": 2:/COOH,7://_,13:*/OH,8:/*OH,       ",
  ": 14:*/_,{1,4}:*/H^60                 ")
  %----------------------------------------
  fsize:=(50mm,18mm);
  if check_mc(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
\MCFgraph
%-----------------------------------------------------------------------------
\subsection{Quinine}
\begin{verbatim}
beginfont("EN:Quinine","MW:324.42")
  %-------------------------------
  ": <30,Ph,3=Ph,7:N,6:/O!,     ",
  ": @10,\,*/OH,/H~zf^-60,!,    ",
  ": |,?6,2:N,1:*/H^60,4:*/!!,  ",
  ": @2,165~zf,60,&5~zb         ")
  %-------------------------------
  fsize:=(50mm,20mm);
  if check_mc(mc)=0: MC(scantokens(mc)) fi
endfont
\end{verbatim}
\MCFgraph
%------------------------------------------------------------------------
\onecolumn
\section{Example to use mcf2graph}
\subsection{Molecular definition file}
\index{mcf2graph.mf}%
\index{sw\_aux\_out}%
\index{tag}%
\index{var}%
\begin{verbatim}
%-------------------------------------------------------------------------
input mcf2graph.mf;                               % input macro
%-------------------------------------------------------------------------
sw_aux_out:=1;        % aux(information) file output on > Global setting
fsize:=(60mm,40mm);   %  (font width,font height)       >
tag1:="F";                                              > AUX file table
tag2:="C";                                              >
tag3:="mw";                                             >
tag4:="fm";                                             >
%%%% sw_rep_out:=1;                                     > Report output
%%%% sw_mol_out:=1;                                     > MOL file output
outputformat:="png"; hppp:=vppp:=0.1;                   > PNG output
outputtemplate:="%j-%3c.png";                           >
%-------------------------------------------------------------------------
beginfont("EN:Ampicillin","MW:349.405",                 > information
  %----------------------------------------             >
  ": <45,?4,-3=?5,2:N,7:S,                ",            > mc1
  ": 3^45:/*H,1://O^15,5:/*COOH^-18,6:??, ",            > mc2
  ": @4,*\^15,NH,!,//O,!,/*NH2,!,Ph       ")            > mc3
  %----------------------------------------             >
  if check_mc(mc)=0: MC(scantokens(mc)) fi              > mc=mc1&mc2&mc3
endfont                                                 > end font
%------------------------------------------------------------------------
beginfont("EN:Cholesterol","MW:386.65",                 >information
  %----------------------------------------             >
  ": <30,?6,{-4,-2}=?6,-4=?5,7=dl,      ",              > mc1
  ": 10:/*H^180,11:/*H^-60,17:/*H^-54,  ",              > mc2
  ": {4,12}:*/_^60,                     ",              > mc3
  ": @-1,18,/*_,-60,!3,?!               ")              > mc4
  %----------------------------------------             >
  if check_mc(mc)=0: MC(scantokens(mc)) fi              > mc=mc1&mc2&mc3
endfont                                                 > end font
%------------------------------------------------------------------------
beginfont("EN:Limonin",                                 > information
  %-----------------------------------------            >
  ": <30,?6,{-3,-4}=?6,                    ",           > mc1
  ":  -5=?3,-2=wf,-1=wb,6=?5,-4=?6,-5=wf,  ",           > mc2
  ":  {13,15,17,20}:O,{3,12,21}://O,       ",           > mc3
  ":  {4~wf^60,8~zf^60,18^35,18^-35}:/_,   ",           > mc4
  ":  {1^60,5^180,16^60}:/*H,              ",           > mc5
  ":  @14,\*,|,?5,{1,4}=dl,3:O)            ")           > mc6
  %-----------------------------------------            >
  if check_mc(mc)=0: MC(scantokens(mc)) fi              > mc=mc1 - mc6
endfont                                                 > end font
%------------------------------------------------------------------------
beginfont("EN:beta-carotene",                           > information
  %------------------------------------------           >
  ": <30,?6,3=dl,{3,5^35,5^-35}:/_,         ",          > mc1
  ": @4,\,|,!18,{1,3,5,7,9,11,13,15,17}=dr, ",          > mc2
  ": {3,7,12,16}:/_,                        ",          > mc3
  ": |,?6,6=dl,2:??,6:/_)                   ")          > mc4
  %------------------------------------------           >
  if check_mc(mc)=0: MC(scantokens(mc)) fi              > mc=mc1 - mc4
endfont                                                 > end font
%------------------------------------------------------------------------
bye
\end{verbatim}
%------------------------------------------------------------------------
\noindent%
\newpage
\subsection{Information auxfile output}
\paragraph{(Insert option parameter setting)}
\index{F}%
\index{C}%
\index{NO}%
\index{MW}%
\index{MI}%
\index{EN}%
\index{JN}%
\index{FM}%
\index{USE}%
\index{mw}%
\index{fm}%
\index{mi}%
\index{w}%
\index{h}%
\begin{verbatim}
  sw_aux_out=1 : tag1:var1;tag2:var2
  sw_aux_out=2 : tag1;tag2 var1;var2
  ** default : sw_aux_out=0
\end{verbatim}
\paragraph{(Command line)}
\begin{verbatim}
  >mpost -s ahlength=1 FILENAME  (sw_aux_out=1)
  >mpost -s ahlength=2 FILENAME  (sw_aux_out=2)
\end{verbatim}
\paragraph{(Sourse)}
\begin{verbatim}
beginfont("EN:Ampicillin")    .... endfont
beginfont("EN:Cholesterol")   .... endfont
beginfont("EN:Limonin")       .... endfont
beginfont("EN:beta-Carotene") .... endfont
\end{verbatim}
\paragraph{(Setting)}
\begin{verbatim}
tag1:="F"; tag2:="C"; tag3:="mw"; tag4:="fm"; tag5:="EN";
\end{verbatim}
\paragraph{(Output)}
\index{aux\_delimiter}%
\begin{verbatim}
(sw_aux_out=1)
F:mcf_man_soc;C:1;mw:349.40462;fm:C16H19N3O4S;EN:Ampicillin
F:mcf_man_soc;C:2;mw:386.6532;fm:C27H46O;EN:Cholesterol
F:mcf_exa_soc;C:3;mw:470.5113;fm:C26H30O8;EN:Limonin
F:mcf_exa_soc;C:4;mw:536.8722;fm:C40H56;EN:beta-Carotene

(sw_aux_out=2)
F;C;mw;fm
mcf_man_soc;1;349.40462;C16H19N3O4S;Ampicillin
mcf_man_soc;2;386.6532;C27H46O;Cholesterol
mcf_exa_soc;3;470.5113;C26H30O8;Limonin
mcf_exa_soc;4;536.8722;C40H56;beta-Carotene

(aux_delimiter="/")
F:mcf_man_soc/C:1/mw:349.40462/fm:C16H19N3O4S/EN:Ampicillin
F:mcf_man_soc/C:2/mw:386.6532/fm:C27H46O/EN:Cholesterol
F:mcf_exa_soc/C:3/mw:470.5113/fm:C26H30O8/EN:Limonin
F:mcf_exa_soc/C:4/mw:536.8722/fm:C40H56/EN:beta-Carotene
\end{verbatim}
\paragraph{(Tag)}
\begin{verbatim}
F   : filename                           
C   : char number
NO  : serial number
EN  : english name
JN  : japanese name
FM  : formula from literature data
MW  : molecular weight from literature data
MI  : monoisotopic mass from literature data
USE : the use
mw  : molecular weight calculated
mi  : monoisotopic mass calculated
fm  : molecular formula calculated
w   : font width
h   : font height
\end{verbatim}
%------------------------------------------------------------------------
\newpage
\noindent%
\subsection{Report output}
\paragraph{(Insert option parameter setting)}
\index{sw\_rep\_out}%
\begin{verbatim}
  sw_rep_out:=1;
  ** default : sw_rep_out=0
\end{verbatim}
\paragraph{(Command line)}
\begin{verbatim}
  >mpost -s ahlength=3 FILENAME
\end{verbatim}
\paragraph{(Output)}
\begin{verbatim}
------------------------------------------------------------------
 Molecular name = Nicotine
 Warnings =   0 / Command count= 44
 Width * Height =   49.57332 *   41.37605
 Shift width * height  =          0 *   -9.07253
 Bond length = 12.75589   Atom size   = 5.38914
 Atom count= 12 Bond count= 13 Ring count=  2 Hide H count= 14
------------------------------------------------------------------
< NO. ><atom(s) >(  x axis   ,   y axis   )<bond><hideH><chg>
 A1     C        (         0 ,          0 )    3     1
 A2     N        (     0.866 ,       -0.5 )    3        
 A3     C        (     1.732 ,          0 )    3     1
 A4     C        (     1.732 ,          1 )    4        
 A5     C        (     0.866 ,        1.5 )    3     1
 A6     C        (         0 ,          1 )    3     1
 A7     C        (     2.304 ,       1.33 )    3     1
 A8     N        (     3.217 ,      0.923 )    3        
 A9     C        (     3.886 ,      1.666 )    2     2
 A10    C        (     3.386 ,      2.532 )    2     2
 A11    C        (     2.408 ,      2.325 )    2     2
 A12    C        (     3.399 ,      0.067 )    1     3
------------------------------------------------------------------
< NO. ><  bond   (sdt)><angle +(  +-  )><length (   pt   )>
 B1     1 ->   2 (  2)     330 (   -30)       1 (   12.76)
 B2     2 ->   3 (  1)      30 (    30)       1 (   12.76)
 B3     3 ->   4 (  2)      90 (    90)       1 (   12.76)
 B4     4 ->   5 (  1)     150 (   150)       1 (   12.76)
 B5     5 ->   6 (  2)     210 (  -150)       1 (   12.76)
 B6     6 ->   1 (  1)     270 (   -90)       1 (   12.76)
 B7     4 ->   7 (  1)      30 (    30)    0.66 (    8.42)
 B8     7 ->   8 (  1)     336 (   -24)       1 (   12.76)
 B9     8 ->   9 (  1)      48 (    48)       1 (   12.76)
 B10    9 ->  10 (  1)     120 (   120)       1 (   12.76)
 B11   10 ->  11 (  1)     192 (  -168)       1 (   12.76)
 B12   11 ->   7 (  1)     264 (   -96)       1 (   12.76)
 B13    8 ->  12 (  1)     282 (   -78)    0.66 (    8.42)
------------------------------------------------------------------
<atom>( atom wt )[ mi wt   ]  < cnt > < sum wt   >[ sum mi wt  ]
 C    (  12.0107)[       12] *   10      120.10696[         120]
 H    (  1.00793)[  1.00783] *   14       14.11108[    14.10959]
 N    (  14.0067)[ 14.00307] *    2        28.0134[    28.00613]
 Molecular Weight [Mono Isotopic] =       162.2314[   162.11572]
------------------------------------------------------------------
 Weight  Calc: 162.2314 / Input: 162.23 / weight gap= 0.00145
 Fomula  Calc: C10H14N2 / Input: 
==================================================================
\end{verbatim}%
\newpage
%------------------------------------------------------------------------
\noindent%
\subsection{MOL file output}
\paragraph{(Insert option parameter setting)}
\index{sw\_mol\_out}%
\begin{verbatim}
  sw_mol_out:=1;     % MOL(V2000)
  sw_mol_out:=2;     % MOL(V3000)
  ** default : sw_mol_out=0
\end{verbatim}
\paragraph{(Command line)}
\begin{verbatim}
  >mpost -s ahlength=5  FILENAME     % MOL(V2000)
  >mpost -s ahlength=6  FILENAME     % MOL(V3000)
\end{verbatim}
\paragraph{(Output)}
\begin{verbatim}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -MCFtoMOL- EN:Caffeine         

 14 15  0  0  0  0  0  0  0  0999 V2000
         0         0         0 C   0  0  0  0
   0.86603      -0.5         0 N   0  0  0  0
   1.73206         0         0 C   0  0  0  0
   1.73206         1         0 C   0  0  0  0
   0.86603       1.5         0 C   0  0  0  0
         0         1         0 N   0  0  0  0
    2.6831  -0.30902         0 N   0  0  0  0
   3.27089       0.5         0 C   0  0  0  0
    2.6831   1.30902         0 N   0  0  0  0
   0.86603  -1.36383         0 C   0  0  0  0
  -0.76894   1.44394         0 C   0  0  0  0
  -0.76894  -0.44394         0 O   0  0  0  0
   0.86603   2.36383         0 O   0  0  0  0
   2.95299    2.1396         0 C   0  0  0  0
  1  2  1  0     0  0
  2  3  1  0     0  0
  3  4  2  0     0  0
  4  5  1  0     0  0
  5  6  1  0     0  0
  6  1  1  0     0  0
  3  7  1  0     0  0
  7  8  2  0     0  0
  8  9  1  0     0  0
  9  4  1  0     0  0
  2 10  1  0     0  0
  6 11  1  0     0  0
  1 12  2  0     0  0
  5 13  2  0     0  0
  9 14  1  0     0  0
M  END
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{verbatim}%
%----------------------------------------------------------------------------
\newpage
\subsection{LuaTeX file example}
%############################################################################
\begin{verbatim}
\documentclass{article}
\usepackage{luamplib}%
\usepackage[T1]{fontenc}%
\usepackage{textcomp}%
\mplibcodeinherit{enable}%
\mplibverbatim{enable}%
\mplibnumbersystem{double}%
\everymplib{%
  if unknown Ph1: input mcf2graph.mf; fi
  sw_calc:=1;  sw_fframe:=4;  max_blength:=4.5mm;
  defaultfont:="uhvr8r"; defaultsize:=8bp; defaultscale:=1;
}%
\begin{document}
\noindent%
%--------------------------------------------------------------------
\begin{mplibcode}
  fsize:=(50mm,50mm);
  beginfont("NO:1","EN:Limonin","MW:470.51",
    %----------------------------------------
    ": <30,?6,{-3,-4}=?6,                  ",
    ": -5=?3,-2=wf,-1=wb,6=?5,-4=?6,-5=wf, ",
    ": {13,15,17,20}:O,{3,12,21}://O,      ",
    ": {4~wf^60,8~zf^60,18^35,18^-35}:/_,  ",
    ": {1^60,5^180,16^60}:/*H,             ",
    ": @14,\*,|,?5,{1,4}=dl,3:O            ")
    %----------------------------------------
  if check_mc(mc)=0: MC(scantokens(mc)) fi 
  endfont
\end{mplibcode}\\
%--------------------------------------------------------------------
\begin{mplibcode}
  fsize:=(80mm,50mm);
  beginfont("NO:2","EN:beta-carotene","MW:536.87",
    %------------------------------------------
    ": <30,?6,3=dl,{3,5^35,5^-35}:/_,         ",
    ": @4,\,|,!18,{1,3,5,7,9,11,13,15,17}=dr, ",
    ": {3,7,12,16}:/_,                        ",
    ": |,?6,6=dl,{6,2^35,2^-35}:/_            ")
    %------------------------------------------
  if check_mc(mc)=0: MC(scantokens(mc)) fi 
  endfont
\end{mplibcode}\\
%--------------------------------------------------------------------
\begin{mplibcode}
  fsize:=(50mm,50mm);
  beginfont("NO:3","EN:Gibberellin A3","MW:346.37",
    %------------------------------------
    ": <18,?5,3=?7,5=?6[12],           ",
    ": @8,160`1.3,&3,13=dl,6=wf,8=wb,  ",
    ": @5,40~zf`1,O,60,//O^180,&14~zb, ",
    ": 2:/COOH,7://_,13:*/OH,8:/*OH,   ",
    ": 14:*/_,{1^60,4^60}:*/H          ")
    %------------------------------------
  if check_mc(mc)=0: MC(scantokens(mc)) fi 
endfont;
%--------------------------------------------------------------------
\end{mplibcode}\\
\end{document}
\end{verbatim}%
%############################################################################
%------------------------------------------------------------------------
\newpage
\subsection{LaTeX file example}
%############################################################################
\index{mcf\_setup.sty}%
\begin{verbatim}
%--------------------------------------------------------------------
\documentclass[a4paper]{article}
\usepackage{graphicx}
%---------------------
\usepackage{mcf_setup}
%---------------------
\pagestyle{empty}
\makeatletter%
%--------------------------------------------------------------------
\def\put@char{%
  \begin{picture}(84,42)%
     \put(0,38){\bf [\MOLnum]\EN{ }\small\tt/FM:\fm/MW:\mw}%
     \put(10,0){\font\@strufont=\File\relax%
               \hbox{\@strufont\char\Char}}%
  \end{picture}%
}%
\def\INFO#1{\@for\@temp:=#1\do{\tag@var\@temp}\put@char}%
\makeatother
%--------------------------------------------------------------------
\begin{document}
\unitlength=1mm%
\INFO{F:mcf_man_soc,C:141,NO:1,mw:349.40462,fm:C16H19N3O4S,EN:Ampicillin}%
\INFO{F:mcf_man_soc,C:142,NO:2,mw:386.6532,fm:C27H46O,EN:Cholesterol}%
\end{document}
%--------------------------------------------------------------------
\end{verbatim}%
%############################################################################
%------------------------------------------------------------------------
\INFO{F:mcf_man_soc,C:141,NO:1,mw:349.40462,fm:C16H19N3O4S,EN:Ampicillin}%
\INFO{F:mcf_man_soc,C:142,NO:2,mw:386.6532,fm:C27H46O,EN:Cholesterol}%
%------------------------------------------------------------------------
\texttt{\printindex}
%------------------------------------------------------------------------
\end{document}
