Is there a way to force knitr to create tikz code which includes font size information? The output would be something like this:
Here is some more background information:
I am currently writing my PhD thesis which is depending on multiple tools (e.g., R, Matlab). In order to document my work as dynamically as possible, I am using knitr for the parts which depend on R. However, I prefer to write most parts of my thesis using TeXstudio. Thus, in order to include the knited R-code in LaTeX I follow this suggestion: I set up a main Rnw-file in which I include child documents. After compiling and kniting the children I put the generated tex-files in the LaTeX files (via
In principal this approach works fine. However, I can not figure an elegant way of how to set the font size of the nodes and labels to a specific value which is defined through font size modifier-commands.
So far, I fiddled around with the chunk options
dev.args=list(pointsize=). While the first apparently only applies to "real" text and not to text within plots, the second does not set something like
font=\footnotesize}. Thus, changes to the
pointsize argument do not affect the final appearance of text in figures as the tikz files are eventually compiled with LaTeX (or LuaLaTeX to be precise).
Here is an answer to a similar question which would be neither easily applicable in my case nor did I get it to work for me so far.
One solution I could think of would be to define global tikz styles using
\tikzstyle. However, this at least discussed for being bad practice (as described here). Further more, how could I define it for a section in which it would apply also for tex-files that have been included via