daqana / tikzDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
https://daqana.github.io/tikzDevice
132 stars 26 forks source link

How to not include the default packages? (issue metrics calculation) #221

Open stla opened 1 year ago

stla commented 1 year ago

Hello,

I don't want to use the getOption("tikzLatexPackages") packages, because it is enough to use:

documentDeclaration = "\\documentclass[tikz]{standalone}\n"

without any package.

But when I try packages = "" or packages = "\n" or packages = NULL, the tikz device does not work: there's some error messages claiming that

TeX was unable to calculate metrics for: m

However if I generate the LaTeX file with the default packages, and I remove the package declarations from this file, I can compile it without any issue.

And there's no m in my plot, it just plot(0, 0, pch = 19).

stla commented 1 year ago

I see now. I have to add at least packages = "\\usepackage{tikz}\n", even though it is not necessary with the class option [tikz] of the document class standalone.