I have a rather large document, containing several tikz-figures. Those are separated in their own files, with file AxisImage.tex
as example:
\begin{tikzpicture}
\begin{axis}
[ylabel = y,
xlabel = x]
\addplot table [x=a, y=c, col sep=comma] {data.csv};
\end{axis}
\end{tikzpicture}
To reduce compilation time, I compile them as standalone
-figure using
\documentclass{standalone}
\input{common_header}
\begin{document}
\input{AxisImage}
\end{document}
into their respective pdf-files. To keep all includes and adjustments at a single place for both the main document and the figures in one place, I generated a common header, containing
\usepackage{pgfplots}
\usepackage[english]{babel}
\usepackage{blindtext}
Afterwards, everything is put together in the main document:
\documentclass{article}
\input{common_header}
\begin{document}
\blindtext[1]
\begin{figure}[htpb]
\centering
\includegraphics[width=0.4\linewidth]{image_generator}
\caption{This is a figure}
\end{figure}
\blindtext[2]
\end{document}
Now I got the request to make the axis labels the same font size as the caption of the figure, regardless of the scaling of the figure (i.e. if I increase the size of the figure, the font size has to be reduced).
I could do that by try and error for every figure size change, but it gets annoying quite fast. Are there other possibilities, such as macros which could do that for me (placed in the common header)?