daqana / tikzDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.

Home Page:https://daqana.github.io/tikzDevice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors (and broken pdf) when using engine=luatex

vasselai opened this issue · comments

First of all, thanks for this great package!

I usually use tikzDevice with the default engine. However, in order to avoid memory problems when generating a figure that requires high-memory usage, I now need to compile it with luatex. However, when I try to use "engine=luatex" with any plotting, I get some errors and a pdf file that contains code instead of an image.

Here is a minimum reproducible example:

x <- rnorm(10)
y <- rnorm(10)
file_name <- "test.tex"
tikz(file_name, standAlone = TRUE, width=3, height=3, engine="luatex")
plot(y ~ x)
dev.off()
shell("luatex test.tex")

The error message is the following:

This is LuaTeX, Version 1.07.0 (MiKTeX 2.9.6730 64-bit)
restricted system commands enabled.
(./test.tex
! Undefined control sequence.
l.3 \documentclass
[10pt]{article}
! Undefined control sequence.
l.4 \usepackage
{tikz}
! Undefined control sequence.
l.6 \IfFileExists
{luatex85.sty}{\usepackage{luatex85}}{}
! Undefined control sequence.
l.6 \IfFileExists{luatex85.sty}{\usepackage
{luatex85}}{}
! Undefined control sequence.
l.8 \usepackage
[active,tightpage,psfixbb]{preview}
! Undefined control sequence.
l.10 \usepackage
{fontspec}
! Undefined control sequence.
l.12 \PreviewEnvironment
{pgfpicture}
! Undefined control sequence.
l.14 \setlength
\PreviewBorder{0pt}
! Undefined control sequence.
l.14 \setlength\PreviewBorder
{0pt}
! Undefined control sequence.
l.15 \begin
{document}
! Undefined control sequence.
l.17 \begin
{tikzpicture}[x=1pt,y=1pt]
! Undefined control sequence.
l.18 \definecolor
{fillColor}{RGB}{255,255,255}
! Undefined control sequence.
l.19 \path
[use as bounding box,fill=fillColor,fill opacity=0.00] (0,0) rectang...

! Undefined control sequence.
l.20 \begin
{scope}
! Undefined control sequence.
l.21 \path
[clip] ( 49.20, 61.20) rectangle (191.61,167.61);
! Undefined control sequence.
l.22 \definecolor
{drawColor}{RGB}{0,0,0}
! Undefined control sequence.
l.24 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

! Undefined control sequence.
l.26 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

! Undefined control sequence.
l.28 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

! Undefined control sequence.
l.30 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

! Undefined control sequence.
l.32 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] ( ...

! Undefined control sequence.
l.34 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

! Undefined control sequence.
l.36 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

! Undefined control sequence.
l.38 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

! Undefined control sequence.
l.40 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

! Undefined control sequence.
l.42 \path
[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (1...

[1{C:/Users/fabricio/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}])
(see the transcript file for additional information)<E:/Programs/MiKTeX 2.9/fon
ts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on test.pdf (1 page, 20691 bytes).
Transcript written on test.log.
Warning messages:
1: running command 'C:\WINDOWS\system32\cmd.exe /c luatex test.tex' had status 1
2: In shell("luatex test.tex") :
'luatex test.tex' execution failed with error code 1

The generated ".tex", ".log" and ".pdf" files can be download here: https://expirebox.com/download/3f30d54d03ac03624c8122505453dfb1.html

Thanks in advance for your time!