Unable to knit pdf from Rmardown from Rstudio in Windows 10 PC - latex

I created a new Rmd file in the latest R and Rstudio version, and with the complete version of MiKTeX installed. In my windows 10 machine.
When I tried to knit it I got the following error
! LaTeX Error: File `fancyvrb.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.34 \newcommand
pandoc.exe: Error producing PDF
Error: pandoc document conversion failed with error 43
Además: Warning message:
comando ejecutado '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS pdfprueba.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output pdfprueba.pdf --template "C:\Users\karin\Documents\R\win-library\3.3\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' tiene estatus 43
Ejecución interrumpida
I suspected that it could have been that I didn't have the package fancyvrb in MiKTeX , so I followed these instructions but I still get the same error.

Try the same using
Miktex package manager (admin)
Under > repository check that your package repository is up to date.
In the name box type the name of your package
Then filter
then add your package
To test if your package is installed in dos CMD type
kpsewhich fancyvrb.sty. you should be able to see the path to your package.
Microsoft Windows [version 10.0.15063]
(c) 2017 Microsoft Corporation. Tous droits réservés.
C:\>kpsewhich fancyvrb.sty
C:/Users/me/AppData/Roaming/MiKTeX/2.9/tex/latex/fancyvrb/fancyvrb.sty

Related

How to execxute a Latex file?

everyone I'm trying to compile a latex file in Windows using MiKTeX and Texmaker. But the file is not compiling and there is showing an error as " Could not start the command.
pdflatex -synctex=1 -interaction=nonstopmode %.tex"
Can anyone help in this regard as to how this file will execute?.

biber wants to load libcrypt.so.1 but it is missing

I am Arch GNU/Linux user who usually manages almost every package with pacman; I manage TeX and LaTeX-related things with tlmgr. I installed tlmgr from source.
I am writing paper. I would like to use bibliography.
When I tried latexmk -pdflua main.ltx:
Rc files read:
latexmkrc
Latexmk: This is Latexmk, John Collins, 20 November 2021, version: 4.76.
Latexmk: applying rule 'biber main'...
Rule 'biber main': The following rules & subrules became out-of-date:
'biber main'
------------
Run number 1 of rule 'biber main'
------------
------------
Running 'biber "main.bcf"'
------------
biber: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
biber main: Could not open biber log file for 'main'
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs, or warnings treated as errors.
libcrypt.so* on my environment
$ pacman -Qo /usr/lib/libcrypt*
/usr/lib/libcrypto.so is owned by openssl 1.1.1.m-1
/usr/lib/libcrypto.so.1.1 is owned by openssl 1.1.1.m-1
/usr/lib/libcryptsetup.so is owned by cryptsetup 2.4.3-2
/usr/lib/libcryptsetup.so.12 is owned by cryptsetup 2.4.3-2
/usr/lib/libcryptsetup.so.12.7.0 is owned by cryptsetup 2.4.3-2
/usr/lib/libcrypt.so is owned by libxcrypt 4.4.28-1
/usr/lib/libcrypt.so.2 is owned by libxcrypt 4.4.28-1
/usr/lib/libcrypt.so.2.0.0 is owned by libxcrypt 4.4.28-1
What I tried else
I uninstalled and re-installed biber on tlmgr but did not work.
# ln -s /usr/lib/libcrypt.so /usr/lib/libcrypt.so.1
$ latexmkrc -pdflua main.ltx
Rc files read:
latexmkrc
Latexmk: This is Latexmk, John Collins, 20 November 2021, version: 4.76.
Latexmk: applying rule 'biber main'...
Rule 'biber main': The following rules & subrules became out-of-date:
'biber main'
------------
Run number 1 of rule 'biber main'
------------
------------
Running 'biber "main.bcf"'
------------
/tmp/par-716861/cache-0e6aa298f0c2e7a775de99938825b2d56bd2027f/biber: /usr/lib/libcrypt.so.1: version `GLIBC_2.2.5' not found (required by /tmp/par-716861/cache-0e6aa298f0c2e7a775de99938825b2d56bd2027f/biber)
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
biber main: Could not open biber log file for 'main'
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs, or warnings treated as errors.
File source
latexmkrc:
$latex='lualatex %O -synctex=1 -interaction=nonstopmode %S';
#$bibtex='upbibtex %O %B';
$bibtex='biber %O %B';
$makeindex='upmendex %O -o %D %S';
$pdf_mode=3;
Install libxcrypt-compat from the Core (1) repository, as suggest in this answer.
This made my biber from TeX Live 2020 work again. The interesting question is if newer TeX distributions will require this package, too.
(1) Thanks to #samueldy for the hint that the package was moved from the AUR to Core.
Adding on to #Christoph90's answer, as of 25 May 2022 the libxcrypt-compat package is still required in TeX Live 2022 in order for biber to function on Manjaro 21.2.6. However, the package has moved to core/libxcrypt-compat, so install by doing
sudo pacman -S libxcrypt-compat

pandoc.exe: Error producing PDF

I have tried running the following simple code;
```{r sample}
library(knitr)
library(kableExtra)
dt <- mtcars[1:5, 1:4]
# LaTeX Table
knitr::kable(dt,format = 'latex')%>%
column_spec(column = 1,width = '10cm',bold = T)
```
This runs fines with the Knit button. but get the following error when using rmarkdown::render();
! Undefined control sequence.
l.173 \centering\rowcolors
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 tst.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output tst.pdf --template "C:\PROGRA~1\R\R-34~1.1\library\RMARKD~1\rmd\latex\DEFAUL~3.TEX" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 43
Also note that without the format = 'latex' option it works fine with rmarkdown::render()
I tried the suggestions for similar errors but non of them worked (update Rmarkdown, install MikTex and the pdflatex.exe to path variable). Can someone please help me with this.Thanks
Calling the array package in the YAML worked for me.
header-includes:
- \usepackage{array}

Undefined control sequence error while converting from markdown to PDF with pandoc and xelatex

I'm making some documentation for our project, but I can't enable xelatex in pandoc to setup custom fonts. If I set --latex-engine xelatex pandoc will show that error:
pandoc: Error producing PDF from TeX source.
! Undefined control sequence.
l.17 \sys_if_engine_luatex:T
Here is a command that I run:
pandoc -s --latex-engine xelatex -f markdown build.md -o docs.pdf
I use Ubuntu 14.04 LTS, pandoc 1.12.2.1 and XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian).
Oops... after removing texlive 2013 with apt-get and installing manualy texlive 2015 pandoc will use old texlive (!!!). After that steps and setting PATH to /usr/local/texlive/2015/bin/x86_64-linux/ pandoc will finaly compile my file with xelatex.

How do I install missing dependencies (adjustbox.sty) to convert an Ipython notebook into pdf format?

I have an IPython notebook which I am trying to convert to PDF format. But when I go to file and do download as PDF, it gives me following error:
nbconvert failed: PDF creating failed
Any ideas? I think some dependencies seem to be missing. Could you advise how to install them in anaconda?
Edit:
Adding the log printed to console when I run download as pdf.
[I 16:00:48.396 NotebookApp] Loaded template article.tplx
[I 16:00:49.414 NotebookApp] Writing 51786 bytes to notebook.tex
[I 16:00:49.415 NotebookApp] Building PDF
[I 16:00:49.435 NotebookApp] Running pdflatex 3 times: [u'pdflatex', u'notebook.tex']
[C 16:00:49.853 NotebookApp] pdflatex failed: [u'pdflatex', u'notebook.tex']
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./notebook.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 21 languages loaded.
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/local/texlive/2014basic/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2014basic/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
! LaTeX Error: File `adjustbox.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.19 \usepackage
{color} % Allow colors to be defined^^M
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on notebook.log.
[I 16:00:49.860 NotebookApp] Running bibtex 1 time: [u'bibtex', u'notebook']
[W 16:00:49.887 NotebookApp] bibtex had problems, most likely because there were no citations
[I 16:00:49.893 NotebookApp] Running pdflatex 3 times: [u'pdflatex', u'notebook.tex']
[C 16:00:49.923 NotebookApp] pdflatex failed: [u'pdflatex', u'notebook.tex']
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./notebook.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 21 languages loaded.
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2014basic/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/local/texlive/2014basic/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2014basic/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
! LaTeX Error: File `adjustbox.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.19 \usepackage
{color} % Allow colors to be defined^^M
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on notebook.log.
[W 16:00:49.925 NotebookApp] 500 GET /nbconvert/pdf/A2_SpectralClustering.ipynb?download=true (::1): nbconvert failed: PDF creating failed
[E 16:00:49.950 NotebookApp] {
"Accept-Language": "en-us",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/6.2.3 Safari/537.85.12",
"Dnt": "1",
"Host": "localhost:8888",
"Referer": "http://localhost:8888/notebooks/A2_SpectralClustering.ipynb"
}
[E 16:00:49.950 NotebookApp] 500 GET /nbconvert/pdf/A2_SpectralClustering.ipynb?download=true (::1) 2096.70ms referer=http://localhost:8888/notebooks/A2_SpectralClustering.ipynb
On Ubuntu 14.04 it worked to install this package:
sudo apt-get install texlive-latex-extra
for mac,
$ sudo tlmgr install adjustbox
additionally you would also need to install:
$ sudo tlmgr install texlive-fonts-recommended
On Fedora 22, I ran into this same issue. I had to install the "texlive-adjustbox" package and then everything worked as expected.
sudo dnf install texlive-adjustbox
You shouldn't need to use anaconda to resolve this issue, but rather it's a lower level dependency that is missing.
I'd like to point out that for this problem and many similar ones, a quick solution is to use apt-file, e.g.
$apt-file search adjustbox.sty
The output indicates packages that contain this file, and then you can install them using apt-get.

Resources