Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I was a bit surprised that this question hasn't been asked before. (If it has, apologies!) I am trying to find a good text editor with support for rmarkdown documents. Here are my criteria (in no particular order):
syntax highlighting (for both R code and markdown syntax)
ability to send code from document to console for evaluation
free & open source
autocompletion for bibtex entries
cross-platform
I can't seem to find anything that fits the bill. Sublime Text can do all of this, but it's neither free nor open source...
I know a lot of people use RStudio, but its support for actually writing is not very good at all (e.g. bad spellcheck, no support for navigating a file, etc)...
The answer to any question involving editors is of course ... Emacs. In all seriousness:
ESS for R
Polymode (by one of the ESS authors) for mixed mode
markdown mode by Jason Blevins (which is IIRC bundled with recent Emacs versions)
work well for me. I still go back to latex for 'real' papers with bibtex, but folks do this with markdown too so there will surely be a mode. And yes, it is cross-platform.
I use these on Ubuntu, and maintain the ESS package for Debian. So that one is always current. For polymode I just go to Github. It all works of course with MELPA and Emacs package archives.
Atom is free, extensible, and open source.
The only thing I can't get it to do is R code syntax inside a code chunk of an Rmd file (similar to Sublime).
If you have experience with Vim, you should check out Vim-R. I use it exclusively; it sends code to R, and has loads of other awesome features. In terms of syntax highlighting, I don't know if there is any specifically for rmarkdown, but there are vim plugins for markdown, and the syntax highlighting for R files is quite good with Vim-R.
I actually never use markdown in any form, but create .Rnw files and use knitr to create PDF's (via pdflatex). Vim-R will also send relevant knitr commands; e.g., if you want to knit pdf, you type (in vim) \kp. If you want to run it through biblatex, you type \kb.
EDIT: I'm not sure if there is autocompletion for bibtex entries, though. There probably is in vim-latex, but of course that isn't R related. However, you might be able to install both plugins and incorporate that command for your own uses.
Related
Apologies in advance because I do not know how to communicate this question via code.
I have an R Notebook document with some latex (maybe not formally latex, but it's mathematical notation). Previously, when the document was in visual mode, I could see my notation inside the notebook. Now, when I compile the document to a pdf the notion appears, however, the notation is no longer visible in visual mode. Does anyone know what is wrong? My first thought was it could be due to an update; however, I am fairly certain that I have not updated anything since.
I'm trying to improve my workflow when working with R and generating documentation. I've been going between TeXStudio, JupyterLab and RStudio for a while, and I'm trying to improve my workflow. TeXStudio has limited R support, and RStudio limited support for LaTeX.
VS Code has support for multiple languages, including R and LaTeX. The fact that it can run both Jupyter notebooks, R notebooks, and LaTeX, and has plugins for other languages as well, makes it seem desirable. However, I am unable to find documentation on how to configure it to work with R and LaTeX code in the same file. In addition, I am unable to configure R notebooks to allow inline code execution output.
However, I am unable to (a) set up code execution output under the code for .Rmd notebooks, and (b) I can't figure out how to weave .Rnw (R/LaTeX) documents with Sweave/knitr.
I'm trying to find an IDE that would include features like:
Markdown, code and code execution output in the same document
Auto R and LaTeX code completion
Automatic display of R function documentation
Spell check
Simple R console access
Compile .Rnw
Syntax highlighting for both R code and LaTeX code
I am, primarily, requesting ways to configure VS Code, or, secondly, way to configure another IDE that can meet my requirements. A tutorial on this would be much appreciated.
After a bit of digging around, I found that VS Code does nearly all the things I need.
Auto R and LaTeX code completion, Display of R function documentation in a tab in VS Code, Simple R console access, and Syntax highlighting for both R code and LaTeX code:
The R and LaTeX Workshop extensions, will provide highlighting and autocompletion of code in both languages. By installing R, you can easily open a session in a terminal window in VS Code, and from there open documentation inside VS Code.
Spell check
Code Spell Checker offers spell check for multiple languages. Install the extension and any desired dictionaries, and set the langauges you want to be included in the extension settings.
Compile .Rnw files
Turns out LaTeX Workshop can actually do this by default.
Markdown, code and code execution output in the same document
This is the only thing VS Code doesn't do as far as I can tell. It can compile .Rmd files, however, but the output can only be seen in the compiled PDF. I consider this less important, since I can use Jupyter notebooks instead.
R Sweave does not compile automatically the .bbl file necessary to detect citations in the text. I found a solution with compiling in another program (https://community.rstudio.com/t/impossible-to-cite-with-biblatex-in-r-sweave/35008/2) but it would much more convenient not to compile three times the same file (on two different softwares).
One of the comments here (RStudio will not write a .bbl file when compiling .Rnw file with citations in natbib) mentioned the fact that maybe R Sweave does not run bibtex. Is there something to do to fix this problem ?
(Question also asked here : https://community.rstudio.com/t/r-sweave-does-not-create-a-bbl-file-on-linux-ubuntu/35110)
I finally got the solution, here's what I did :
based on the comments of user1329307, I uninstalled MikTeX and the complete TeX distributions on my computer. Since I use Ubuntu, I used purge to remove MikTeX, TeXLive, tex-commons, etc.
then, I installed (or re-installed) TinyTeX (details here)
I installed manually the packages I needed with tlmgr_install(). Normally, it can be done automatically but that's what I did.
finally, I replaced biber by bibtex in \usepackage[backend = biber]{biblatex} (this person explains why it is important)
This last step made it work, but I don't know if the previous ones are important or not. Since user1329307 succeeded in compiling the bibliography too, I suppose it is necessary but there's no way for me to prove it.
Anyway, now, when I compile the Sweave document, the bibliography is directly created. Thanks a lot to user1329307 for his/her ideas.
Edit : I re-installed MikTeX after all of this and it works too.
This question has been asked several times in several different ways...
See:
R markdown citation identifiers
How to cite references in R Markdown from Endnote library (.enl)?
...but has yet to be answered satisfactorily.
So my question is: how do you locate the citation ID for EndNote libraries to use in R Markdown? As others have pointed out, all the examples are for .bib libraries, which work seamlessly (especially so with the citr package add-in).
Another Stack user found that you cannot use citation IDs that are entirely numeric, and worries that since EndNote indexes its documents using numbers, this may be prohibitive for using EndNote for R Markdown citations. See below.
R Markdown Not Rendering Citation
I am aware I could export my EndNote library as a .bib file and then simply use BibTeX citing methods (which I may do, since citr makes for a easy-to-use GUI-like experience). But I would still like to find out how to make EndNote libraries work properly.
Thanks for your help.
I'm looking for some LaTeX template for creating quality output. On R-bloggers I've bumped on Frank Harrel's Rreport package. Due to my quite modest LaTeX abilities, only a user-friendly (and noob-friendly) interface should suffice. Here's a link to an official website. I'm following the instructions, but I cannot manage to install an app. I use Ubuntu 9.10, R version is 2.10.1 (updated regularly from UCLA's CRAN server), and of course, cvs is installed on my system.
Now, I'd like to know if there is some user-friendly LaTeX template package (Sweave is still to advanced/spartan for me). I'm aware that my question is quite confounding, but a brief glance on examples on Rreport page should give you a hint. I'm aware that LaTeX skills are a must, but just for now I need something that will suit my needs (as a psychological researcher).
Is there any package similar with Rreport?
lyx? http://www.lyx.org/
On Ubuntu:
sudo apt-get install lyx
From the lyx page:
LyX combines the power and flexibility
of TeX/LaTeX with the ease of use of a
graphical interface. This results in
world-class support for creation of
mathematical content (via a fully
integrated equation editor) and
structured documents like academic
articles, theses, and books.
If you want to produce Latex with a simpler markup you could use the ASCII package that has a Sweave driver that can be used with reSTructured text, which can then be converted to Latex. Although I would only use it if you want to be able to convert the same doc also to html or odf. In any case it is a good idea to learn the basic Latex.
The online text processor zoho allows export to latex. Maybe this can be helpful to learn latex, but I do not know how to integrate Sweave/R in this. (I did not work with zoho, by the way).