summaryrefslogtreecommitdiff
path: root/graphics/mcf2graph/mcf_example.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-01-30 03:04:17 +0000
committerNorbert Preining <norbert@preining.info>2023-01-30 03:04:17 +0000
commit326add29024271cbd541ac55448e616e833ae5fa (patch)
tree3a7301e802591c20575b65b94b21291641e7641f /graphics/mcf2graph/mcf_example.tex
parentdab4e7c261c34234f9d9f1ac92923d6f903046ef (diff)
CTAN sync 202301300304
Diffstat (limited to 'graphics/mcf2graph/mcf_example.tex')
-rw-r--r--graphics/mcf2graph/mcf_example.tex114
1 files changed, 101 insertions, 13 deletions
diff --git a/graphics/mcf2graph/mcf_example.tex b/graphics/mcf2graph/mcf_example.tex
index aedff395a3..76eae436e4 100644
--- a/graphics/mcf2graph/mcf_example.tex
+++ b/graphics/mcf2graph/mcf_example.tex
@@ -1,25 +1,22 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Example of MCF Typeset with LuaLaTeX(luamplib) by A.Yamaji 2023.01.09
+% Example of MCF Typeset with LuaLaTeX(luamplib) by A.Yamaji 2023.01.29
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% ** mcf2graph.mf must be version 4.91
+% ** mcf2graph.mf must be version 4.92
% ** 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,24mm);
- max_blength:=4mm;
- fi
-}%
+\begin{mplibcode}
+ input mcf2graph;
+ sw_output:=Fig+Calc;
+ fsize:=(35mm,24mm);
+ max_blength:=4mm;
+\end{mplibcode}
%-------------------------------------------------------------------------
\pagestyle{empty}
\topmargin=-24mm
@@ -88,7 +85,98 @@
\CONT@false%
\fi%
%------------------------------------------------------------------------
-%%%%%%%%\ifnum\fig@num=10 \CONT@false \fi%
+\message{[\the\fig@num:\EN]}%
+\ifCONT@ \repeat%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% MCF example with Mcode
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{mplibcode}
+ 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;
+\end{mplibcode}
+%-------------------------------------------------------------------------
+\newcount \fig@num%
+\edef\one{1}%
+\fig@num=0%
+%-------------------------------------------------------------------------
+\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%
%------------------------------------------------------------------------------