Bharathi Boyareddigari
Bharathi Boyareddigari

Reputation: 431

pandoc document conversion failed with error 43 : pdflatex: The memory dump file could not be found

RStudio : 0.98.994 OS: Microsoft Windows 7 Ultimate Edition, 64-bit Service Pack 1 MiKTeX: 2.9.4503

Hi,

I get the following error when I try to knit a PDF document.

pandoc.exe: Error producing PDF from TeX source. This is pdfTeX, Version 3.1415926-1.40.11 (MiKTeX 2.9) pdflatex: The memory dump file could not be found. pdflatex: Data: pdflatex.fmt

Upvotes: 43

Views: 80174

Answers (14)

Matthew
Matthew

Reputation: 17

I faced a similar issue. In my case, the error occurred because of putting a percentage inside the $ sign. Like this,

$95%$, I removed the % sign, and everything worked fine.

Upvotes: 0

Guannan Shen
Guannan Shen

Reputation: 687

I encountered this problem while I was trying to add an in-line r code r test1$p.value, which is a very small p-value from t test. The error information is as following:

> ! Missing $ inserted.  
>  <inserted text>  
>            $  
>l.147   9.0044314\times  
>
>pandoc: Error producing PDF
>Error: pandoc document conversion failed with error 43
>Execution halted

I think the problem is the pdflatex engine has a trouble in displaying the small p-value in exponential notation. I solved the problem by clicking on the gear symbol next to the knit button, then under output options, advanced tab I changed the LaTeX Engine to lualatex, or you can just report the p-value as p < 0.001.

Upvotes: 2

Ahdee
Ahdee

Reputation: 4949

for me it was because on my headers I was putting + signs. For example gene + treatment. This errors but when I removed it, it works.

Upvotes: 1

user1480478
user1480478

Reputation: 584

I did try to use the xelatex engine but still, I got the error that xetex.def is not found. This is another to work around.

output:
  pdf_document: 
    keep_tex: yes
    latex_engine: xelatex

Then open .tex file in your TEX editor and build pdf as usual.

Upvotes: 0

Samuel
Samuel

Reputation: 3053

I had a similar issue. My solution was to remove the "leading" period in the YAML title argument:

Does not work:

---  
title: “1. Title”  
output: pdf_document  
---  

output file: example.knit.md

! Argument of \reserved@a has an extra }. \par l.79 \end{enumerate}}

pandoc: Error producing PDF Error: pandoc document conversion failed with error 43 Execution halted

Works:

---
title: “1 Title”
output: pdf_document
---

Upvotes: 0

Naike Wang
Naike Wang

Reputation: 1

I just ran into this problem and already solved it. I didn't use any code as other people did in their posts. I will assume that you have installed all these basic stuff: R, RStudio, the rmarkdown package, the knitr package, and the MikTex basic installation (I know this is very basic, but I want those first timers know that you need these stuff to make this happen). If you run into this problem, go to R GUI, upgrade the rmarkdown package and it should work then. Note that if you change the LaTeX Engine to xelatex as the poster of the highest vote did, it may not work for you, at least it did not for me. I leave my latex engine as it is (pdflatex).

Upvotes: 0

user8193079
user8193079

Reputation: 81

happy to share with you my solution.

---
title: "Untitled"
author: "-----"
date: "21/6/2017"
output: 
  pdf_document: 
    latex_engine: xelatex
---

Upvotes: 8

David LeBauer
David LeBauer

Reputation: 31751

I found the answer here: http://rmarkdown.rstudio.com/tufte_handout_format.html#comment-1582377678

The problem is that you need to add \usepackage[utf8]{inputnc} to the preamble of the tufte-handout.tex file in the rmarkdown package.

This was fixed here: https://github.com/rstudio/rmarkdown/commit/484d5b8e903e0e0c75c82f707efa35f9fd9a52b0

To update your rmarkdown package, you can use directly in the RStudio command line

devtools::install_github("rstudio/rmarkdown")

Upvotes: 24

pyjimmy
pyjimmy

Reputation: 11

If you are using inline values from your R code which are in the scientific format (too small or too big), format them like:

replace r x

with r format(x, digits=n) where n is whatever.

Upvotes: 1

Francisco Lobo
Francisco Lobo

Reputation: 1

In my case it was solved simply by editing the author field in:

---
title: "Document Title"
author: '-----'
date: "21-03-2017"
output: pdf_document
---

the default '-----' would yield the error, but replacing it with anything (for example 'Juan') solved the issue.

Upvotes: 0

Ed Hagen
Ed Hagen

Reputation: 409

None of the above worked for me when knitting to PDF (and I wanted to keep the scientific notation). The problem was that latex code was generated that included "\times" without the necessary bracketing by $. In the markdown I simply bracketed the inline R code with $'s, like so:

$p = `r signif(cor.HF$p.value, 2)`$

Voila!

Upvotes: 11

Stas Prihod&#39;co
Stas Prihod&#39;co

Reputation: 874

I was able to fix it in my case. I experienced that error when generate PDF from Rmd if I added float values into a text that R tried to display as a scientific notation. For example, instead of "520274.72" it tried to add text "5.2027472 e10-5" which leads to latex code \textbf{5.2027472\times 10\^{}{5}} that was not compiling. I fixed it by wrapping it with format(....,scientific=FALSE).

replace r round(txn_pd,2)

with r format(round(txn_pd,2),scientific=FALSE)

Upvotes: 3

user1464473
user1464473

Reputation: 427

I also tried devtools::install_github('rstudio/rmarkdown') but was still getting an error when I added 'fig.align='center' to a ggplot2 plot in my document. It would work as HTML, but not as PDF.

After seeing isomorphismes's post I clicked on the gear symbol next to the knit PDF button, then under the advanced tab I changed the LaTeX Engine to xelatex. After that I no longer received the error message and my PDF document was created without problems.

Thank you.

Upvotes: 27

isomorphismes
isomorphismes

Reputation: 8403

I had the same problem and devtools::install_github('rstudio/rmarkdown') didn't work for me. I needed to

rmarkdown::render('in.md',

      output_format=pdf_document(latex_engine='xelatex')

      )

with the novel command (use xelatex) on its own line.

Upvotes: 2

Related Questions