1

I have referenced this link and this link to try and convert the r script and output to a PDF document. I followed the directions in first link word by word (accommodating for file names/directory) but i get an error message.

    > # Create Pdf files
> knit("TextMining.Rmd")


processing file: TextMining.Rmd
  |.........                                                        |  14%
  ordinary text without R code

  |...................                                              |  29%
label: setup (with options) 
List of 1
 $ include: logi FALSE

  |............................                                     |  43%
  ordinary text without R code

  |.....................................                            |  57%
label: cars
  |..............................................                   |  71%
  ordinary text without R code

  |........................................................         |  86%
label: pressure (with options) 
List of 1
 $ echo: logi FALSE

  |.................................................................| 100%
  ordinary text without R code


output file: TextMining.md

[1] "TextMining.md"
> markdownToHTML('TextMining.md', 'TextMining.html', options=c("use_xhml"))
> system("pandoc -s TextMining.html -o TextMining.pdf")
pandoc.exe: Error producing PDF from TeX source.
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9)
pdflatex: The memory dump file could not be found.
pdflatex: Data: pdflatex.fmt

Warning message:
running command 'pandoc -s TextMining.html -o TextMining.pdf' had status 43 

I can't seem to be able to resolve this issue. In the past, a few years ago I had found a code that made me input my code in an RMD file instead of including such referencing in the R script itself. I would then click on knit PDF or something to that effect to produce the output. I feel that is a better way to handle the output generating. Could you also suggest how I could make that happen?

EDIT: result:

    library(knitr); (f = system.file("examples", "knitr-minimal.Rnw", package = "knitr")); knit(f)
Warning message:
package ‘knitr’ was built under R version 3.2.5 
[1] "C:/Users/XYZ/Documents/R/win-library/3.2/knitr/examples/knitr-minimal.Rnw"


processing file: C:/Users/XYZ/Documents/R/win-library/3.2/knitr/examples/knitr-minimal.Rnw
  |.........                                                        |  14%
  ordinary text without R code

  |...................                                              |  29%
label: setup (with options) 
List of 2
 $ include: logi FALSE
 $ cache  : logi FALSE

  |............................                                     |  43%
  ordinary text without R code

  |.....................................                            |  57%
label: boring-random
  |..............................................                   |  71%
   inline R code fragments

  |........................................................         |  86%
label: boring-plots (with options) 
List of 3
 $ fig.width : num 4
 $ fig.height: num 4
 $ out.width : chr ".4\\linewidth"

  |.................................................................| 100%
  ordinary text without R code


output file: knitr-minimal.tex

[1] "knitr-minimal.tex"

Edit 2

library(tools);texi2pdf("knitr-minimal.tex")
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9 64-bit)
entering extended mode
(knitr-minimal.tex
LaTeX2e <2016/03/31> patch level 1
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg")
("C:\Program Files\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))))
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\color.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\color.cfg"))
("C:\Program Files\MiKTeX 2.9\tex\latex\framed\framed.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\base\alltt.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\mathpazo.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"))
("C:\Program Files\MiKTeX 2.9\tex\latex\geometry\geometry.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifvtex.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\geometry\geometry.cfg"))
("C:\Program Files\MiKTeX 2.9\tex\latex\url\url.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hyperref.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-hyperref.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-generic.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\auxhook.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\pd1enc.def")
("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\hyperref.cfg")
("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\puenc.def"))

Package hyperref Message: Driver (autodetected): hpdftex.

("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hpdftex.def"
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\rerunfilecheck.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\upquote\upquote.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\base\textcomp.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1enc.def")))
No file knitr-minimal.aux.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ts1cmr.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\t1pplx.fd")
("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
) ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf-base.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\grfext.sty"))
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex

Package geometry Warning: The marginal notes overrun the paper.
     Add 4.86812pt and more to the right margin.

*geometry* verbose mode - [ preamble ] result:
* driver: pdftex
* paper: <default>
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes: 
* h-part:(L,W,R)=(71.13188pt, 472.03123pt, 71.13188pt)
* v-part:(T,H,B)=(71.13188pt, 652.70622pt, 71.13188pt)
* \paperwidth=614.295pt
* \paperheight=794.96999pt
* \textwidth=472.03123pt
* \textheight=652.70622pt
* \oddsidemargin=-1.1381pt
* \evensidemargin=-1.1381pt
* \topmargin=-38.1381pt
* \headheight=12.0pt
* \headsep=25.0pt
* \topskip=10.0pt
* \footskip=30.0pt
* \marginparwidth=65.0pt
* \marginparsep=11.0pt
* \columnsep=10.0pt
* \skip\footins=9.0pt plus 4.0pt minus 2.0pt
* \hoffset=0.0pt
* \voffset=0.0pt
* \mag=1000
* \@twocolumnfalse
* \@twosidefalse
* \@mparswitchfalse
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)

("C:\Program Files\MiKTeX 2.9\tex\latex\hyperref\nameref.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\gettitlestring.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\ot1pplx.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\psnfss\omlzplm.fd")
Sorry, but C:\PROGRA~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:/Users/XYZ/AppData/Local/MiKTeX/2.9/miktex/log/pdflatex.log

You may want to visit the MiKTeX project page, if you need help.
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
  unable to run 'pdflatex' on 'knitr-minimal.tex'
In addition: Warning message:
running command '"pdflatex" -interaction=nonstopmode "knitr-minimal.tex"' had status 1 
Community
  • 1
  • 1
Freewill
  • 413
  • 2
  • 6
  • 18
  • Could you post the output of `library(knitr); (f = system.file("examples", "knitr-minimal.Rnw", package = "knitr")); knit(f)`. This will test whether `pdflatex` is correctly installed in PATH. I faced similar issuer recently, finally MikTex portable solved the issue for me – Silence Dogood Aug 08 '16 at 08:39
  • please see updated description – Freewill Aug 08 '16 at 12:53
  • Sorry I forgot to add this earlier, `library(tools);texi2pdf("knitr-minimal.tex")`, this tries the tex to pdf conversion – Silence Dogood Aug 08 '16 at 13:29
  • updated edit 2, please review – Freewill Aug 08 '16 at 13:38
  • 1
    You correctly have `pdflatex` in the PATH but it fails to even complete the `knitr` minimal demo. I suspect that some required packages are missing from your MikTex installation and it is unable to download from internet. I suggest trying the portable version from [MikTex Portable](http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable-2.9.5987.exe) and adding the path `~/Miktex/miktex/bin ` to your environment variable – Silence Dogood Aug 08 '16 at 13:47
  • Thanks - I tried re-installing MikTex and now it seems to work.As you correctly indicated, some of the components it was asking to install on the fly which didn't pop up before for some reason. – Freewill Aug 12 '16 at 23:04

1 Answers1

0

I do not know which operating system you are using but maybe the link below could solve your problem. Maybe you just have to check the permission to Miktex. Another opportunity is to run MikTex as an administrator. More hints on that are also described on the attached link.

https://tex.stackexchange.com/questions/81739/the-memory-dump-file-could-not-be-found

Community
  • 1
  • 1
Tim-TU
  • 408
  • 1
  • 4
  • 13
  • Have you already installed MiKTex and pandoc as stated in the first link you are referring to ? So as far as I know you have to install a tex editor and pandoc to convert a pdf document out of an .Rmd file. This is also described in your first link. – Tim-TU Aug 08 '16 at 08:19
  • yes, as i stated earlier I've followed all instructions including installation of various packages. – Freewill Aug 08 '16 at 08:24