In past I was using
texi2dvi("ABC.tex", pdf = TRUE)
in R
to produce pdf
from tex
. However, after using
sudo apt-get update && sudo apt-get upgrade
Now using
texi2dvi("ABC.tex", pdf = TRUE)
throws the following error
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet, :
Running 'texi2dvi' on 'ABC.tex' failed.
Messages:
mkdir: cannot create directory ‘Yaseen/XYZ’: No such file or directory
/usr/bin/texi2dvi: cannot create directory: Yaseen/XYZ
My directory name contains spaces too (I can not change because many my directories have spaces in their names).
Through surfing I came across this link which says:
To build the PDF documentation, you will need a version of TeX Live or texinfo that includes texi2dvi (BEWARE: recent TeX Live, and some texinfo RPMs, do NOT include texi2dvi).
My tex --version
output is
TeX 3.14159265 (TeX Live 2015)
kpathsea version 6.2.1
Copyright 2015 D.E. Knuth.
There is NO warranty. Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.
Any help to figure out the problem will be highly appreciated. Thanks
Edited
My setwd()
in R
is
setwd(
file.path(
"/media"
, "yaseen"
, "D"
, "Muhammad Yaseen"
)
)
getwd()
[1] "/media/yaseen/D/Muhammad Yaseen"
and
texi2dvi("ABC.tex", pdf = TRUE)
The error message you posted suggests that the path you provided for the file doesn't exist. Does
Yaseen/XYZ
exist? if not, create it first and try again.If your directory names contain spaces, try escaping them using
\
in the command:Or use quotes (
"
/'
):If you're doing this from R, make sure you use
\\
to ensure the escape character gets passed on:Edit: note the documentation for this in R (
?texi2dvi
):This is obviously a dumb bug, so the best workaround is to avoid paths with spaces.