aboutsummaryrefslogtreecommitdiff
path: root/tex/src/figure-src-demoplot.tex
blob: 6d788f58ac1c21f6124af0bd848bfe613fbf8b5a (plain)
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
\begin{tcolorbox}[title=\inlinecode{\textcolor{white}{demo-plot.mk}}\hfill(Simplified contents)]
  \footnotesize
  \texttt{\mkcomment{1ST MAKE RULE: build the directory hosting the converted table.}}\\
  \texttt{\mkvar{a2dir} = \$(\mkvar{texdir})/tools-per-year}\\
  \texttt{\mktarget{\$(a2dir)}:; \mkprog{mkdir} \$@}

  \vspace{2em}
  \texttt{\mkcomment{2ND MAKE RULE: extract necessary info from raw table.}}\\
  \texttt{\mkvar{a2mk20f1c} = \$(\mkvar{a2dir})/tools-per-year.txt}\\
  \texttt{\mktarget{\$(a2mk20f1c)}: \$(\mkvar{mk20tab3}) | \$(\mkvar{a2dir})}\\
  \texttt{\mktab{}\mkprog{awk} '!/\^{}\#/ \{all[\$\$1]+=\$\$2; id[\$\$1]+=\$\$3;\}} \textbackslash\\
  \texttt{\mktab{}{ }{ }{ }{ }{ }END\{ for(year in all) print year, 100*id[year]/all[year], all[year] \}}' \textbackslash\\
  \texttt{\mktab{}{ }{ }{ }{ }> \$@}

  \vspace{2em}
  \texttt{\mkcomment{3RD MAKE RULE: Main LaTeX macro file for reported values in text.}}\\
  \texttt{\mkvar{pconfdir} = reproduce/analysis/config}\\
  \texttt{\mktarget{\$(mtexdir)/demo-plot.tex}: \$(\mkvar{a2mk20f1c}) \$(\mkvar{pconfdir})/menke-demo-year.conf}

  %% We need an empty line here for the extra space to work.
  \texttt{\recipecomment{First year data were taken (first column of first row).}}\\
  \texttt{\mktab{}v=\$\$(awk 'NR==1\{print \$\$1\}' \$(\mkvar{a2mk20f1c}))}\\
  \texttt{\mktab{}\mkprog{echo} "\textbackslash{}newcommand\{\textbackslash{}menkefirstyear\}\{\$\$v\}" > \$@}

  %% We need an empty line here for the extra space to work.
  \texttt{\recipecomment{Number of papers in the demonstration year. The year is defined in}}

  \texttt{\recipecomment{`\$(pconfdir)/menke-demo-year.conf' as `menke-demo-year' and also passed onto LaTeX.}}\\
  \texttt{\mktab{}v=\$\$(awk '\$\$1==\$(\mkvar{menke-demo-year})\{print \$\$3\}' \$(\mkvar{a2mk20f1c}))}\\
  \texttt{\mktab{}\mkprog{echo} "\textbackslash{}newcommand\{\textbackslash{}menkenumpapersdemocount\}\{\$\$v\}"{ }>> \$@} \\
  \texttt{\mktab{}\mkprog{echo} "\textbackslash{}newcommand\{\textbackslash{}menkenumpapersdemoyear\}\{\$(\mkvar{menke-demo-year})\}"{ }>> \$@}
\end{tcolorbox}