Search code examples
rlatexr-exams

In which folder in R should the 3dplot.sty file be saved?


I am creating a question in r-exams that contains a graph made in TikZ, more specifically https://texample.net/tikz/examples/the-3dplot-package/. For its correct operation it is required that the 3dplot.sty file be in a certain R folder. In which folder should I include this file?

Error message in RStudio: "!LaTeX Error: File`3dplot.sty'not found".


Solution

  • I would strongly recommend to install this in the texmf tree of your LaTeX installation. Then it is always found, no matter where you compile a LaTeX file.

    Alternatively, you can also specify it using the header argument in include_tikz() with the full absolute file path:

    include_tikz(..., header = "\\usepackage{/full/path/to/3dplot}")
    

    Note that the .sty suffix is not to be included, even when using the full file path.