%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Print out mcf data list                           by A.Yamaji   2023.01.09
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ** mcf2graph.mf must be version 4.91
% ** use mcf_library.mcf
% ** typeset by LuaLaTeX(luamplib)
\documentclass{article}
\usepackage{luamplib}%
\usepackage[T1]{fontenc}%
\mplibcodeinherit{enable}%
\mplibnumbersystem{double}%
\mpliblegacybehavior{disabled}%
%-------------------------------------------------------------------------
\everymplib{%
  if unknown Ph1:
    input mcf2graph;
    outputformat:="eps";
    sw_output:=Fig+Calc;
    fsize:=(35mm,34mm);
    fmargin:=(1mm,1mm);
    max_blength:=4mm;
    row_h:=3.8mm;
    header_h:=3.8mm;
    def make_frame=
      draw (0,0)--(185mm,0)--(185mm,h)--(0,h)--cycle wpcs thickness_frame;
      draw (w,h-header_h)--(185mm,h-header_h) wpcs thickness_frame;
      draw (w,h)--(w,0) wpcs thickness_frame;
      for col_w=75mm,105mm,130mm,155mm:
        draw (col_w,h)--(col_w,h-header_h) wpcs thickness_frame;
      endfor
    enddef;
  fi
}%
%-------------------------------------------------------------------------
\pagestyle{empty}
\topmargin=-25mm
\oddsidemargin=-12mm
\textwidth=192mm
\textheight=280mm
\parindent=0mm
\makeatletter
%-------------------------------------------------------------------------
\newcount \fig@num%
\newif\ifCONT@%
\edef\one{1}%
\fig@num=0%
%-------------------------------------------------------------------------
\begin{document}
\noindent%
\begin{mplibcode}
  beginfigm(":<0,0~nb")
    if mc_check(mc)=0:
      MC(scantokens(mc))
      ext(
        defaultfont:="cmtt9";
        label.lrt("[(No)]",(0,h));
        label.llft("(EXA)",(w,h));
        label.lrt("(Structure)",(8mm,18mm));
        label.lrt("(Name)",(w,h));
        label.lrt("(Category)",(75mm,h));
        label.lrt("(MW)*1",(105mm,h));
        label.lrt("(mw)*2",(130mm,h));
        label.lrt("(fm)*3",(155mm,h));
        label.lrt("(Molecular_Coding_Format)",(46mm,18mm));
        label.lrt("*1_(MW):Molecular_weight(data)",(105mm,26mm));
        label.lrt("*2_(mw):Molecular_weight(calculated)",(105mm,21mm));
        label.lrt("*3_(fm):Molecular_formula(calculated)",(105mm,16mm));
        make_frame;
      )
  fi
  endfigm
  fig_num:=0;
\end{mplibcode}\vspace{-1.2pt}\\
%------------------------------------------------------------------------
\CONT@true%
\loop%
\advance\fig@num\@ne\relax%
\begin{mplibcode}%
%%%%%%  beginfigm("t:EXA","v+:*")
%%%%%%  beginfigm("t:EXA","v+:1")
%%%%%%  beginfigm("t:EXA","v+:9")
  beginfigm("t:EXA","v+:2")
    if mc_check(mc)=0:
      MC(scantokens(mc))
      ext(
        defaultfont:="cmtt9";
        label.lrt("["&decimal(fig_num)&"]",(0,h));
        label.llft(inf_EXA,(w,h));
        if length(inf_EN)>23:
          nA:=defaultscale;
          defaultscale:=23/length(inf_EN); label.lrt(inf_EN, (w,h));
          defaultscale:=nA;
        else:
          label.lrt(inf_EN, (w,h));
        fi
        label.lrt(inf_Cat,(75mm,h));
        label.lrt(inf_MW,(105mm,h));
        label.lrt(cal_MW,(130mm,h));
        label.lrt(cal_FM,(155mm,h));
        make_frame;
        if mc_row>12: defaultscale:=0.6; row_h:=5.25;
        ef mc_row>8:  defaultscale:=0.8; row_h:=6.5;
        else: row_h:=10;
        fi
        for i=1 upto mc_row:
          label.lrt(mc[i],(w+mc_indent[i]*4.25,h-(i-1)*row_h-11.5));
        endfor
      )
      VerbatimTeX("\gdef\EN{"&inf_EN&"}");
   fi
  endfigm
  VerbatimTeX("\gdef\EOF{"&decimal(f_EOF)&"}");
\end{mplibcode}\vspace{-1.2pt}\\
%------------------------------------------------------------------------
\ifx\EOF\one \CONT@false \fi%
\message{[\the\fig@num:\EN]}%
\ifCONT@ \repeat%
%------------------------------------------------------------------------------
\end{document}
