0

Following Code compiles successfully, but the plot doesn't work (Error in getMetricsFromLatex(TeXMetrics, verbose =verbose): TeX was unable to calculate metrics ...)

\documentclass{beamer}
\usepackage{tikz}

\usefoottemplate{{\includegraphics[scale=0.045]{Rlogo.png}}}%

\begin{document}
<<setup, include=FALSE>>=
library(knitr)
library(tikzDevice)
options(tikzDefaultEngine='xetex')
opts_chunk$set(dev="tikz")
@

\begin{frame}[fragile]
<<fig.width=2, fig.height=2>>=
data <- c(1, 2, 3)
barplot(table(data))
@
\end{frame}
\end{document}

When I delete \includegraphics... in the Code above everything works fine.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
lna
  • 1
  • 1
  • Your example works fine for me (although I would rather use `\setbeamertemplate{footline}{...}` to format the footline). `\usefoottemplate` is obsolete and only still around for compatibility reasons. Can you add which version of packages, r etc. you use? – samcarter_is_at_topanswers.xyz Mar 29 '22 at 21:28
  • Thanks for your help! I corrected `\usefoottemplate` to `\setbeamertemplate{footline}` (although this does not affect the error message). Just yesterday I deleted and reinstalled everything. So all packages etc. should be up to date: R-4.1.3; RStudio 2022.02.1; knitr 1.38; tinytex 0.38; tikzDevice 0.12.3.1 – lna Mar 30 '22 at 06:31

0 Answers0