rstudio / rstudio/tinytex

Knit RMarkdown to PDF not working

Open
#82 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.2k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

Hi yihui,

i have an issue with knit rmarkdown to pdf in RStudio. I am using TinyTex and try to knit following rmarkdown example:

---
title: "Untitled"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r cars}
summary(cars)
```

## Including Plots

You can also embed plots, for example:

```{r pressure, echo=FALSE}
plot(pressure)
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

Selection of "Knit to PDF" provides :

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

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



processing file: Test.Rmd
  |............................                                     |  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


"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS Test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output Test.tex --template "C:\Users\v005194\Documents\R\win-library\3.5\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --variable "compact-title:yes" 
output file: Test.knit.md

tlmgr search --file --global "/xcolor.sty"
Trying to automatically install missing LaTeX packages...
tlmgr install xcolor
No connection to the internet.
Unable to download the checksum of the remote TeX Live database,
but found a local copy so using that.

You may want to try specifying an explicit or different CTAN mirror;
see the information and examples for the -repository option at
http://tug.org/texlive/doc/install-tl.html
(or in the output of install-tl --help).

tlmgr.pl: package repository http://ctan.math.washington.edu/tex-archive/systems/texlive/tlnet (not verified: unknown)
[1/1, ??:??/??:??] install: xcolor [17k]
TLPDB::_install_package: downloading did not succeed
tlmgr.pl: package log updated: C:/Users/v005194/AppData/Roaming/TinyTeX/texmf-var/web2c/tlmgr.log
tlmgr search --file --global "/xcolor.sty"
! LaTeX Error: File `xcolor.sty' not found.

! Emergency stop.
<read *> 

Fehler: Failed to compile Test.tex. See Test.log for more info.
Ausführung angehalten

I am not using the xcolor-package anywhere... What can i do to fix that problem? I am an simple user on my work-computer (not an admin).
I see a possible solution at ur website https://yihui.name/en/2018/08/tinytex-flash-drive/. But I am not able to use Dropbox on my computer.

By the way: I started this thread at https://tex.stackexchange.com/questions/459113/problem-with-knit-r-markdown-to-pdf too.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the reported TinyTeX and RStudio knitting command, including the failed xcolor.sty lookup and the Test.log reference. Determine whether the report identifies a reproducible TinyTeX problem or only an environment-specific package-download failure; a useful outcome would require a confirmed fix or a clearly documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, r
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.