aboutsummaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/src/delete-me-image-histogram.tex (renamed from tex/src/delete-me-demo.tex)4
-rw-r--r--tex/src/delete-me-squared.tex (renamed from tex/src/delete-me.tex)2
-rw-r--r--tex/src/preamble-pgfplots.tex25
3 files changed, 21 insertions, 10 deletions
diff --git a/tex/src/delete-me-demo.tex b/tex/src/delete-me-image-histogram.tex
index 1fde25d..8d62892 100644
--- a/tex/src/delete-me-demo.tex
+++ b/tex/src/delete-me-image-histogram.tex
@@ -20,7 +20,7 @@
%% The displayed WFPC2 image.
\node[anchor=south west] (img) at (0,0)
{\includegraphics[width=0.5\linewidth]
- {tex/build/delete-me-demo/wfpc2.pdf}};
+ {tex/build/image-histogram/wfpc2.pdf}};
%% Its label
\node[anchor=south west] at (0.45\linewidth,0.45\linewidth)
@@ -42,7 +42,7 @@
]
\addplot [const plot mark mid, fill=red]
table [x index=0, y index=1]
- {tex/build/delete-me-demo/wfpc2-hist.txt}
+ {tex/build/to-publish/wfpc2-histogram.txt}
\closedcycle;
\end{axis}
diff --git a/tex/src/delete-me.tex b/tex/src/delete-me-squared.tex
index e264854..c0cc609 100644
--- a/tex/src/delete-me.tex
+++ b/tex/src/delete-me-squared.tex
@@ -26,7 +26,7 @@
%% A particular plot.
\addplot+[scatter, only marks]
- table {tex/build/delete-me-num/data.txt};
+ table {tex/build/to-publish/squared.txt};
\end{axis}
\end{tikzpicture}
diff --git a/tex/src/preamble-pgfplots.tex b/tex/src/preamble-pgfplots.tex
index af6cb8d..1d57daf 100644
--- a/tex/src/preamble-pgfplots.tex
+++ b/tex/src/preamble-pgfplots.tex
@@ -77,17 +77,28 @@
-%% 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]{%
+%% The '\includetikz' can be used to either build the figures using
+%% PGFPlots (when '\makepdf' is defined), or use an existing file (when
+%% '\makepdf' isn't defined). When making the PDF, it will set the output
+%% figure name to be the same as the 'tex/src/XXXX.tex' file that contains
+%% the PGFPlots source of the figure. In this way, when using the PDF, it
+%% will also have the same name, thus allowing the figures to easily change
+%% their place relative to others: figure ordering won't be a problem. This
+%% is a problem by default because if an explicit name isn't set at the
+%% start, tikz will make images based on their order in the paper.
+%
+%% This function takes two arguments:
+%% 1) The base-name of the LaTeX file with the 'tikzpicture'
+%% environment. As mentioned above, this will also be the name of
+%% the produced figure.
+%% 2) The settings to use with 'includegraphics' when an already-built
+%% file should be used.
+\newcommand{\includetikz}[2]{%
\ifdefined\makepdf%
\tikzsetnextfilename{#1}%
\input{tex/src/#1.tex}%
\else
- \includegraphics[width=\linewidth]{tex/tikz/#1.pdf}
+ \includegraphics[#2]{tex/tikz/#1.pdf}
\fi
}