pandoc stopped working: "! LaTeX Error: File `ifxetex.sty' not found." - pandoc

I woke up and pandoc stopped working.
I have this file test.md:
---
title: "Untitled"
author: "author"
---
# Header
Hello world
and when I run pandoc test.md -o test.pdf I get the error:
! LaTeX Error: File `ifxetex.sty' not found.
But it is installed. Nothing about my TeX distribution (MacTex) changed. And so far as I can tell nothing about pandoc changed.
Any ideas?
EDIT ifxetex is part of iftex (https://ctan.org/pkg/ifxetex?lang=en) and I confirmed I already have iftex by trying to install it and getting the message:
tlmgr install: package already present: iftex

Related

"ctags: Unknown option: --output-format" error

On macOS, getting the error while running this command:
ctags -R --output-format=json --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths) -f .tags
per advice here: https://www.boost.co.nz/blog/2018/01/improving-ruby-rails-debugging-ctags
It appears to be a valid command option: https://docs.ctags.io/en/latest/output-format.html
So I'm not sure why I'm getting an error.
UPDATE:
OK, that blog article has ctags installed from HEAD formula. So I installed that version but now I get a different error:
ctags: unknown output format name supplied for "output-format=json"
I followed the same article and got the same error. The problem is the suggested command:
brew install --HEAD universal-ctags/universal-ctags/universal-ctags
This doesn't build universal-ctags with libjansson and as Masatake YAMATO suggested, libjansson is needed to use --output-format=json.
Try installing universal-ctags with the --with-jansson flag:
brew install --HEAD --with-jansson universal-ctags/universal-ctags/universal-ctags
Also, to avoid the ctags: -f option may not follow a file name error, move -f .tags before . $(bundle list --paths):
ctags -R --output-format=json --languages=ruby --exclude=.git --exclude=log -f .tags . $(bundle list --paths)
You can use json output only when you built the ctags executable with libjansson library.
If you built the ctags executable with libjansson, you will see "json" in --list-features output like:
$ universal-ctags --list-features
#NAME DESCRIPTION
iconv can convert input/output encodings
interactive accepts source code from stdin
json supports json format output
...
If you don't find "json", you must rebuild the ctags executable with libjansson library.
If you find "json", but the option, --output-format=json, doesn't work, it will be a bug. I recommend you to report it to https://github.com/universal-ctags/ctags/issues though fixing it is not promised.

I am getting SHA256 checksum mismatch error with brew install "formula"

I am using MAC OS and for the first time I am trying to create my own package using brew package manager.
I have placed a simple helloworld shell script inside a tar file and pushed it to my github repository.
Please refer to the link https://github.com/shahritesh16/tutorial1.
I have written simple formula which is shown below:
class Script < Formula
desc "Shell script for hello world"
homepage "https://github.com/shahritesh16/tutorial1"
url "https://github.com/shahritesh16/tutorial1/blob/master/brewtest-0.1.tar.gz"
sha256 "30f1cc5cabe3b988d567e561713eae01840c4c0781daf7e2709c9c6b79dba4b1"
def install
echo Welcome
end
end
I have created the tar.gz file using these commands:
tar -cvf brewtest-0.1.tar.gz brewdir
I have calculated the sha256 value using shasum -a 256 /location/brewtest-0.1.tar.gz and added the value in ruby script script.rb.
Up on executing the command, brew install script.rb I am getting ChecksumMismactherror.
Below is the output:
==> Downloading https://github.com/shahritesh16/tutorial1/blob/master/brewtest-0.1.tar.gz
######################################################################## 100.0%
Error: An exception occurred within a child process:
ChecksumMismatchError: SHA256 mismatch
Expected: 30f1cc5cabe3b988d567e561713eae01840c4c0781daf7e2709c9c6b79dba4b1
Actual: 39524ab2e5177ddbb9d9cfac7c535ea5c6f290e8ecbbec6b67de189ba5435c6e
Archive: /Users/xyzUser/Library/Caches/Homebrew/downloads/e0b1da9a7a7fff80ece6531f3f5660d6a8bf4e1fba006910543da58e44330f5d--brewtest-0.1.tar.gz
To retry an incomplete download, remove the file above.
I am not sure why I am getting this error as I am using correct SHA256 value in script.rb as per shasum -a 256 filelocation command. Also Why it is comparing sha256 value from script.rb with the one that is downloaded in /Users/xyzUser/Library/Caches/Homebrew/downloads.
The checksum mismatches is due to an error in the URL. https://github.com/shahritesh16/tutorial1/blob/master/brewtest-0.1.tar.gz points to the HTML-rendered version of the file. What you should have used is the URL you get when clicking on the "Raw" button on this file:
https://github.com/shahritesh16/tutorial1/raw/master/brewtest-0.1.tar.gz
Note the "raw" part in that URL.
Also, the formula’s name should match its filename: use Brewtest instead of Script:
class Brewtest < Formula
desc "Shell script for hello world"
homepage "https://github.com/shahritesh16/tutorial1"
url "https://github.com/shahritesh16/tutorial1/raw/master/brewtest-0.1.tar.gz"
sha256 "30f1cc5cabe3b988d567e561713eae01840c4c0781daf7e2709c9c6b79dba4b1"
def install
puts "Hello"
end
end

UTF-8 encoding error using Pandoc filters

I have been having trouble when converting a Markdown file to PDF using pandoc-eqnos filter. I typed in command line:
pandoc --filter=pandoc-eqnos file.md -o file.pdf
And get the following error message:
File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\Scripts\pandoc-eqnos-script.py", line 1
SyntaxError: Non-UTF-8 code starting with '\xed' in file C:\Users\User\AppData\Local\Programs\Python\Python37-32\Scripts\pandoc-eqnos-script.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Error running filter pandoc-eqnos:
Filter returned error status 1
Installed pandoc-eqnos filter using pip. I sincerely don't know what is causing this error. Any suggestion will be appreciated. Thanks.

Messy code presented when knitting to word from R Markdown

When I code the matrices and functions into R Markdown, it presents successfully, like the following image:enter image description here
The matrices and functions can be knitted to html. However, when I knit to word document, it appears messy codes, like this: enter image description here
In addition, I also cannot knit to pdf document since it occurs the following errors:
! LaTeX Error: Illegal character in array arg.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.93 \left[\begin{array}\
pandoc.exe: Error producing PDF
Error: pandoc document conversion failed with error 43
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS 000.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output 000.pdf --template "C:\PROGRA~1\R\R-32~1.3\library\RMARKD~1\rmd\latex\DEFAUL~3.TEX" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 43
Execution halted
I am using Windows 7 (64-bit) and RStudio 3.2.3.
Does anyone help me deal with these problems?
Thank you!

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
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.
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")
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!
happy to share with you my solution.
---
title: "Untitled"
author: "-----"
date: "21/6/2017"
output:
pdf_document:
latex_engine: xelatex
---
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)
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.
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.
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.
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.
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.
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).
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
---
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.
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.

Resources