aboutsummaryrefslogtreecommitdiff
path: root/tex/src/figure-mk20tab3.tex
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2020-03-02 02:55:00 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-03-02 02:55:00 +0000
commite9c81f9f40187bc4701ac539d110003e92b9ca69 (patch)
treee3929f2a116cf1bc790eaf88883e0315ef0ffa6c /tex/src/figure-mk20tab3.tex
parentf51082b27e47e552658000689161c150d9c9a70e (diff)
Described the first analysis phase with a demo subMakefile
Until now, there was no explanation on an actual analysis phase, therefore with this commit an example scenario with a readable Makefile is included. The Data lineage graph was also simplified to both be more readable, and also to correspond to this new explanation and subMakefile. Some random edits/typos were also corrected and some references added for discussion.
Diffstat (limited to 'tex/src/figure-mk20tab3.tex')
-rw-r--r--tex/src/figure-mk20tab3.tex50
1 files changed, 50 insertions, 0 deletions
diff --git a/tex/src/figure-mk20tab3.tex b/tex/src/figure-mk20tab3.tex
new file mode 100644
index 0000000..ebeac0e
--- /dev/null
+++ b/tex/src/figure-mk20tab3.tex
@@ -0,0 +1,50 @@
+\begin{tcolorbox}
+ \footnotesize
+ \texttt{\mkcomment{Define and build the directory hosting the final table.}}
+
+ \texttt{\mkvar{a1dir} = \$(\mkvar{BDIR})/analysis-1}
+
+ \texttt{\mktarget{\$(a1dir)}:}
+
+ \texttt{\mktab{}\mkprog{mkdir} \$@}
+
+ \vspace{1.5em}
+ \texttt{\mkcomment{Define and build the main target.}}
+
+ \texttt{\mkvar{mk20tab3} = \$(\mkvar{a1dir})/menke20-table-3.txt}
+
+ \texttt{\mktarget{\$(mk20tab3)}: \$(\mkvar{indir})/menke20.xlsx | \$(\mkvar{a1dir})}
+
+ \texttt{\recipecomment{Call XLSX I/O to convert all the spreadsheets into different CSV files.}}
+
+ \texttt{\recipecomment{We only want the `table-3' spreadsheet, but XLSX I/O doesn't allow setting its}}
+
+ \texttt{\recipecomment{output filename. For simplicity, let's assume its written in `table-3.csv'.}}
+
+ \texttt{\mktab{}\mkprog{xlsxio\_xlsx2csv} \$<}
+
+ \vspace{0.5em}
+ \texttt{\recipecomment{Use GNU AWK to keep the desired columns in space-separated, fixed-width format.}}
+
+ \texttt{\recipecomment{With `FPAT' commas within double quotes are not counted as columns.}}
+
+ \texttt{\mktab{}\mkprog{awk} 'NR>1\{printf("\%-10d\%-10d\%-10d \%s\textbackslash{}n", \$\$2, \$\$3, \$\$(NF-1)*\$\$NF, \$\$1)\}' \textbackslash}
+
+ \texttt{\mktab{}{ }{ }{ }{ }FPAT='([\^{},]+)|("[\^{}"]+")' table-3.csv > \$@}
+
+ \vspace{0.5em}
+ \texttt{\recipecomment{Delete the temporary CSV file.}}
+
+ \texttt{\mktab{}\mkprog{rm} table-3.csv}
+
+ \vspace{1.5em}
+ \texttt{\mkcomment{Main LaTeX macro file}}
+
+ \texttt{\mktarget{\$(mtexdir)/analysis1.tex}: \$(\mkvar{mk20tab3)}}
+
+ \texttt{\recipecomment{Count the total number of papers in their study to report in this paper.}}
+
+ \texttt{\mktab{}v=\$\$(\mkprog{awk} '\!/\^{}\#/\{c+=\$\$2\} END\{print c\}' \$(\mkvar{mk20tab3)})}
+
+ \texttt{\mktab{}\mkprog{echo} "\textbackslash{}newcommand\{\textbackslash{}menkenumpapers\}\{\$\$v\}" > \$@}
+\end{tcolorbox}