I have a collection of old lectures, written as .Rnw files using LaTeX beamer for presentations.
They no longer compile, and I am mystified why.
Here is a minimal example, test-beamer.Rnw just trying to produce a title slide
\documentclass[10pt,table,handout]{beamer}
%\input{inputs/beamer-setup}
%\input{inputs/defs}
\begin{document}
\SweaveOpts{concordance=TRUE}
\title[6136: Overview]{Categorical Data Analysis: Course Overview}
\author{Michael Friendly}
\institute{Psych 6136}
% insert titlegraphic
\titlegraphic{
\rule[-4pt]{0.5pt}{4pt}\hrulefill\rule[-4pt]{0.5pt}{4pt} \\
\includegraphics[width=.9\linewidth,clip]{fig/bertifier} \\
\rule{0.5pt}{4pt}\hrulefill\rule{0.5pt}{4pt} \\
}
\begin{frame}[plain]
\titlepage
\end{frame}
\end{document}
Using the "Compile PDF" button, I get an uninformative message:
Writing to file test-beamer.tex
Processing code chunks with options ...
You can now run (pdf)latex on 'test-beamer.tex'
Running pdflatex.exe on test-beamer.tex...failed
Error running C:/Program Files/MiKTeX/miktex/bin/x64/pdflatex.exe (exit code 3)
I opened the test-beamer.tex fil in TeXstudio and tried to compile. The .log file ends with something about geometry.sty and an error from ifvtex.sty,
but I cannot tell how or where ifvtex.sty is invoked. Can anyone help?
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.8.28) (preloaded format=pdflatex 2022.10.13) 13 OCT 2022 16:06
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**./test-beamer.tex
(test-beamer.tex
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-09-28>
(C:\Program Files\MiKTeX\tex/latex/beamer\beamer.cls
Document Class: beamer 2022/09/13 v3.68 A class for typesetting presentations
(C:\Program Files\MiKTeX\tex/latex/beamer\beamerbasemodes.sty
(C:\Program Files\MiKTeX\tex/latex/etoolbox\etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
....
(C:\Program Files\MiKTeX\tex/latex/beamer\beamerbaseoptions.sty
(C:\Program Files\MiKTeX\tex/latex/graphics\keyval.sty
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
))
\beamer@paperwidth=\skip48
\beamer@paperheight=\skip49
(C:\Program Files\MiKTeX\tex/latex/geometry\geometry.sty
Package: geometry 2020/01/02 v5.9 Page Geometry
(C:\Program Files\MiKTeX\tex/generic/iftex\ifvtex.sty
Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
! Undefined control sequence.
l.20 \IFTEX@let
{vtexdvi}{false}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
Follow-up:
I downloaded the iftex package from the CTAN archive, installed this in my localtexmf/ directory and refreshed the database.
kpsewhich now finds both iftex.sty and ifvtex.sty
$ kpsewhich iftex.sty
C:/Dropbox/localtexmf/tex/generic/iftex/iftex.sty
friendly@UIT-HHP-9L7JNK3 MINGW64 /c/R/projects/heplots (master)
$ kpsewhich ifvtex.sty
C:/Dropbox/localtexmf/tex/generic/iftex/ifvtex.sty
Yet, when I try to compile the .tex file generated, I still get an error:
(C:\Program Files\MiKTeX\tex/latex/geometry\geometry.sty
(C:/Dropbox/localtexmf\tex/generic/iftex\ifvtex.sty
! Undefined control sequence.
l.20 \IFTEX@let
{vtexdvi}{false}
?
RStudio inserts the line below in the .tex file. Could this be the source of my grief?
\usepackage{Sweave}
No one answered, so here is what I've done that works now.
Copied
iftex.styandifvtex.styto the local directory of my source.Rnwfiles. No idea why this was necessary, but perhaps this item about MikTeX paths is relevant: Set path to miktex for pdflatex in RStill had problems with MikTeX, so I switched to
tinytexvia R StidioTools -> Global options -> Sweave -> Use tinytex when compiling .tex