From 4360fbd36203022fde68b12f90548ca3a39085ce Mon Sep 17 00:00:00 2001
From: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Date: Tue, 27 Feb 2018 10:42:20 +0100
Subject: Copyrights and TeX management made more clear

Until now, the copyright statement was left empty for the users of the
pipeline to fill. However, the files have already been created and have an
author (or contributing authors) before the user starts using the
pipeline. So the original authors of the files are added along with the
year. The user can add their own name to the existing files under the
"Contributing author" when they start and they will be the "Original
author" of the new files they create.

Several changes were also made to the TeX management:

 - LaTeX is run within a `reproduce/build/tex/build' directory now. Not in
   the top reproduction pipeline directory. This helps keep all the
   auxiliary TeX files and directories in that directory and keep the top
   reproduction pipeline directory clean. After the final PDF is built, a
   copy is put in the top reproduction pipeline directory for easy viewing.

 - The PGFPlots preamble was also made more useful, allowing the name of
   the `.tex' file to also be the name of the final plot that is
   produced. This is a GREAT feature, because without it, the TiKZ
   externalization would be based on order of the plots within the
   paper. But now, order is irrelevant and we can even delete the TiKZ
   files within the processing workhorse-Makefiles so the plots are
   definitly rebuilt on the next run.

 - The paper is now in a two-column format to be more similar to published
   papers.

A tip on debugging Make was added to `README.md'.
---
 tex/preamble-pgfplots.tex | 68 +++++++++++++++++++++++++++++++++++++----------
 1 file changed, 54 insertions(+), 14 deletions(-)

(limited to 'tex/preamble-pgfplots.tex')

diff --git a/tex/preamble-pgfplots.tex b/tex/preamble-pgfplots.tex
index 13570e9..c2a7f14 100644
--- a/tex/preamble-pgfplots.tex
+++ b/tex/preamble-pgfplots.tex
@@ -1,33 +1,73 @@
-%% PGFPlots settings.
-%%
-%% PGFPlots is a package in (La)TeX for making plots internally. It fits
+%% PGFPlots settings
+%% -----------------
+
+%% PGFPLOTS is a package in (La)TeX for making plots internally. It fits
 %% nicely with the purpose of a reproduction pipeline. But it isn't
 %% mandatory. Therefore if needed, you can just uncomment the line that
 %% includes this file in the top LaTeX source (`paper.tex').
 
+%% PGFPlots uses the (La)TeX TiKZ package to build plots. So we will first
+%% do the settings that are necessary in TiKZ, and then go onto the actual
+%% PGFPlots package.
+
 
 
 
 
-% For a tikz environment:
+%% Very general TiKZ settings. In particular, to allow faster processing
+%% (not having to re-build the plots on every run), we are using the
+%% externalization feature of TiKZ. With this option, TiKZ will build every
+%% figure independently in a special directory afterwards it will include
+%% the built figure in the final file. This has many advantages: 1) if the
+%% code for the plot hasn't changed, then the plot won't be re-made (can be
+%% slow with detailed plots). 2) You can use the PDFs of the individual
+%% plots for other purposes (for example to include in slides) cleanly.
 \usepackage{tikz}
 \usetikzlibrary{external}
 \tikzexternalize
+\tikzsetexternalprefix{tikz/}
+
+
+
+
+
+%% The following rule will cause the name of the files keeping a figure's
+%% external PDF to be set based on the file that the TiKZ commands are
+%% from. Without this, TiKZ will use numbers based on the order of
+%% figures. These numbers can be hard to manage and they will also depend
+%% on order in the final PDF, so it will be very buggy to manage them.
+\newcommand{\includetikz}[1]{%
+    \tikzsetnextfilename{#1}%
+    \input{tex/#1.tex}%
+}
 
-\tikzsetexternalprefix{\bdir/tex/tikz/}
 
-%% Uncomment the following lines for EPS and PS images. Note that you
-%% still have to use pdflatex and also add a `[dvips]' option to
+
+
+
+%% Uncomment the following lines for EPS and PS images. Note that you still
+%% have to use the `pdflatex' executable and also add a `[dvips]' option to
 %% graphicx.
 
-%\tikzset{external/system call={rm -f "\image".eps "\image".ps
-%"\image".dvi; latex \tikzexternalcheckshellescape -halt-on-error
-%-interaction=batchmode -jobname "\image" "\texsource";
-%dvips -o "\image".ps "\image".dvi;
-%ps2eps "\image.ps"}}
+%% \tikzset{external/system call={rm -f "\image".eps "\image".ps
+%% "\image".dvi; latex \tikzexternalcheckshellescape -halt-on-error
+%% -interaction=batchmode -jobname "\image" "\texsource";
+%% dvips -o "\image".ps "\image".dvi;
+%% ps2eps "\image.ps"}}
+
+
+
+
 
-%For drawing plots:
+%% Inport and configure PGFPlots.
 \usepackage{pgfplots}
 \pgfplotsset{compat=newest}
 \usepgfplotslibrary{groupplots}
-\pgfplotsset{axis line style={thick}, tick style={semithick}}
+\pgfplotsset{
+  axis line style={thick},
+  tick style={semithick},
+  tick label style = {font=\footnotesize},
+  every axis label = {font=\footnotesize},
+  legend style = {font=\footnotesize},
+  label style = {font=\footnotesize}
+  }
-- 
cgit v1.2.1

