New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when setting using tikz and setting OutDec option #1081

Closed
vitorbaptista opened this Issue Jul 26, 2015 · 4 comments

Comments

2 participants
@vitorbaptista
Copy link

vitorbaptista commented Jul 26, 2015

Hi,

The following LaTeX file doesn't work:

\documentclass{article}
\usepackage{tikz}

\begin{document}

<<dev='tikz'>>=
options(OutDec = ",")
plot(1:10)
@

\end{document}

But if I either remove dev='tikz', making it:

<<>>=
options(OutDec = ",")
plot(1:10)
@

Or remove the OutDec option, making it:

<<dev='tikz'>>=
plot(1:10)
@

It works fine. The culprint seems to be the getMetricsFromLatex function, as shown on this snippet of the log:

!  ==> Fatal error occurred, no output PDF file produced!
Quitting from lines 7-9 (teste.Rnw) 
Error in getMetricsFromLatex(TeXMetrics) : 
TeX was unable to calculate metrics for the following string
or character:

        1:10

Common reasons for failure include:
  * The string contains a character which is special to LaTeX unless
    escaped properly, such as % or $.
  * The string makes use of LaTeX commands provided by a package and
    the tikzDevice was not told to load the package.

The contents of the LaTeX log of the aborted run have been printed above,
it may contain additional details as to why the metric calculation failed.
Calls: knit ... print.recordedplot -> replayPlot -> <Anonymous> -> getMetricsFromLatex
@vitorbaptista

This comment has been minimized.

Copy link

vitorbaptista commented Jul 26, 2015

I've published the full error log at https://gist.github.com/vitorbaptista/5b97f54edee8ad54a93b

Not all OutDec values trigger this bug. In my tests, ",", "_" and ";" triggered the bug, while " ", "-" and "+" didn't.

@yihui

This comment has been minimized.

Copy link
Owner

yihui commented Aug 11, 2015

Thanks! I think this is the same issue as daqana/tikzDevice#57 I'll see if I can fix it.

@yihui yihui added the Bug label Aug 11, 2015

@yihui yihui added this to the v1.11 milestone Aug 11, 2015

@yihui

This comment has been minimized.

Copy link
Owner

yihui commented Aug 12, 2015

Fixed in the development version of tikzDevice: https://github.com/yihui/tikzDevice

@vitorbaptista

This comment has been minimized.

Copy link

vitorbaptista commented Aug 12, 2015

Thanks for the fix, it's working now 🍻 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment