R Markdown double spacing - r-markdown

I'm writing a scientific paper (pdf) with R Markdown. The problem is that a want to apply double spacing with header-includes:
\usepackage{setspace}\doublespacing but it does not work.
Then there comes this error message:
tlmgr search --file --global "/setspace.sty"
tlmgr.pl: Remote repository is newer than local (2018 < 2019)
Cross release updates are only supported with
update-tlmgr-latest(.sh/.exe) --update
Please see https://tug.org/texlive/upgrade.html for details.
! LaTeX Error: File `setspace.sty' not found.
! Emergency stop.
<read *>
How can I solve this problem?

Related

Insert equation plugin of Zim does not find Latex

I have installed Zim on my MacBook. I already have Latex installed. When I try to add the "Insert Equation" plugin, the following errors are shown:
Dependencies
latex - Failed
dvipng - Failed
It is worth mentioning that when I type "latex" or "dvipng" in the terminal, I see that the corresponsing program is called. So, the installation of Latex seems fine.
How to solve this issue?

Shiny App ! LaTeX Error: File `unicode-math.sty' not found

I created a shiny app to generate a downloadable pdf report with knitr and rmarkdown.
I am able to generate the report in Rstudio, but when I attempt to do so from the app, I get this error:
2020-04-22T19:40:03.590795+00:00 shinyapps[2124372]: cannot setup TLPDB in /home/shiny/texmf at /usr/bin/tlmgr line 5604.
2020-04-22T19:40:03.593636+00:00 shinyapps[2124372]: Warning in system2("tlmgr", args, ...) :
2020-04-22T19:40:03.593638+00:00 shinyapps[2124372]: running command ''tlmgr' search --file --global '/unicode-math.sty'' had status 2
2020-04-22T19:40:03.594869+00:00 shinyapps[2124372]: ! LaTeX Error: File `unicode-math.sty' not found.
2020-04-22T19:40:03.594871+00:00 shinyapps[2124372]:
2020-04-22T19:40:03.594872+00:00 shinyapps[2124372]: ! Emergency stop.
2020-04-22T19:40:03.594873+00:00 shinyapps[2124372]: <read *>
2020-04-22T19:40:03.594873+00:00 shinyapps[2124372]:
2020-04-22T19:40:03.597624+00:00 shinyapps[2124372]: Warning: Error in : LaTeX failed to compile /tmp/RtmpDEOSFT/fileca7f657fa3.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See fileca7f657fa3.log for more info.
2020-04-22T19:40:03.602043+00:00 shinyapps[2124372]: [No stack trace available]
The debugging tips suggested reinstalling tinytex so I tried that. I also downloaded unicode-math.sty individually to my shiny app folder and redeploying, but neither helped. Any suggestions?
I also faced the same issue and couldn't found the solution. Please use the below solution to resolve this problem.
Go to the folder where your tex packages are installed that would most probably be in C:\Users\vksharma\AppData\Roaming\TinyTeX\texmf-dist\tex\latex\unicode-math. Copy all the four files i.e.,
into your working directory. Then write the following code wherein you have rendered the markdown pdf:
tempsty <- file.path(tempdir(), "unicode-math.sty")
file.copy("unicode-math.sty", tempsty, overwrite = TRUE)
tempxesty <- file.path(tempdir(), "unicode-math-xetex.sty")
file.copy("unicode-math-xetex.sty", tempxesty, overwrite = TRUE)
tempxesty1 <- file.path(tempdir(), "unicode-math-table.tex")
file.copy("unicode-math-table.tex", tempxesty, overwrite = TRUE)
tempxesty2 <- file.path(tempdir(), "unicode-math-luatex.sty")
file.copy("unicode-math-luatex.sty", tempxesty, overwrite = TRUE)
What it does basically is copy these files from your working directory to the temporary directory of the shinyapps server and then while rendering the markdown, it searched for these packages and install them.
Happy Coding!

shiny (Rstudio) package for R - no able to install on Mavericks

I am about to begin a project with Shiny (by RStudio). When I try to install the shiny package using the console install.packages("shiny"), I get the following error message:
trying URL 'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/shiny_0.10.1.tgz'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/shiny_0.10.1.tgz'
Warning in install.packages :
download of package ‘shiny’ failed
I have tried to install it from the drop down menu in RStudio but have encountered the same problem. Any thoughts as to what is going on?
I am working on Mac, with the latest version of Mavericks (R version is 3.1.1).
Thanks,
Brian
Try a different CRAN mirror. The error indicates that the file was not found on the CRAN server
chooseCRANmirror()
shiny has just been updated 2014-10-01 so the changes may not have propagated down to all mirrors yet.

RMarkdown html_output error

I am trying to create a RMarkdown document with RStudio using shiny server. It works fine if the ouptut is pdf but if I want it as html I get this following error at the end of the process (in the RMarkdown console I can see it reached 100%).
Error: unrecognized fields specified in html_dependency: attachment
I have no idea why this error is happening.
Can anyone help me with this?
Thank you
I had a similar problem and found that it was caused by RStudio attempting to use Knitr to build a Shiny page. You can fix this by running using rmarkdown::run() instead of rmarkdown::render(). In some older versions of RStudio, the "Knit html" button runs this:
rmarkdown::render('filename.Rmd', 'html_document')
whereas, you can get the the results you want by running this command instead:
rmarkdown::run('filename.Rmd')
You could use this command or just update to the latest version of RStudio.
There is more info about authoring Shiny document here: http://rmarkdown.rstudio.com/authoring_shiny.html.
This is caused by a recent update of the relevant rmarkdown package or related ones.
Update RStudio to the latest version and then the error should disappear. It worked in my case.
Updating RStudio didn't work for me. What did work was updating all R packages (Tools > Check for Package Updates...).

Jpegs in Django-wiki

I'm trying to get django-wiki running.
It works well so far, except I can't display .jpeg images.
At first I had trouble when only importing jpeg files in the webapp.
I fixed this modifying setup.py of PIL's setup.py as follows:
JPEG_ROOT = libinclude("/usr/lib")
# Line 214
add_directory(library_dirs, "/usr/lib")
add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu")
Jpeg libs I have currently installed:
libjpeg-progs
libjpeg62:amd64
libjpeg62-dev:amd64
libjpeg8:amd64
libopenjpeg2:amd64
After install PIL with pip install PIL, I get this output which doesn't look that bad, at least I thought so
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
No error messages (and no "decoder ntót available") and I can view the images properly on my server, which means upload works great. But in the wiki only the file names are shown and when I click on them I get
"This image failed to load."
Could someone please help me? I can't find any error output (debug mode is activated).
Thanks in advance
You are compiling software! You need to install development libraries for these things to compile, e.g. apt-get install libjpeg-dev.
Also, install Pillow, it has less chances of failure to compile - pip install pillow.