I have as an operating system Ubuntu 22.04 LTS and Rstudio 2022.07.1 Build 554. When I knit a document I don't see the preview in the formats word and pdf but I see the preview in html. I don't know what is happening? Also my rmarkdown is version 2.16
Please do share more information about the file or project you are trying to render from, the log message you may have or any other information that would help know better what is running on your computer. It is hard to help without more information than a generic issue behavior.
Thank you for the answer. This is the warning I get
library(rmarkdown)
render(input = "test.Rmd",
output_format = "pdf_document")
#> Warning in normalizePath(path, winslash = winslash, mustWork = mustWork):
#> path[1]="test.Rmd": No such file or directory
#> Error in abs_path(input): The file 'test.Rmd' does not exist.
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:
summary(cars)
Including Plots
You can also embed plots, for example:
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.
I see test.Rmd in there. I reaally don't understand then
Did you update all the packages already to latest available version ?
Can you share the traceback() results after you have the error when calling rmarkdown::render() ?
This will show us exactly were it happens.
but to be clear:
Does the rendering to PDF works ?
Is the issue only that Preview does not open in the RStudio IDE ?
Yes I update all the packages to the lastest version.
This is the result of the traceback
library(rmarkdown)
render(input = "test.Rmd",
output_format = "pdf_document")
#> Warning in normalizePath(path, winslash = winslash, mustWork = mustWork):
#> path[1]="test.Rmd": No such file or directory
#> Error in abs_path(input): The file 'test.Rmd' does not exist.
traceback()
#> No traceback available
It seems R is having problems parsing the file path, does the path contain empty spaces or non-ASCII characters? If so, try moving your project files to a folder that doesn't have these kind of characters on its path.