RStudio Slidy presentation shows as a web page in browser - r

If from the RStudio menu, I select File > New File > R Markdown ...
and then select Presentation, HTML (Slidy).
Leaving the sample code and pressing Knit HTML, opens the presentation in presentation mode in an RStudio browser (after saving). However, if I then select Open in Browser the presentation shows as one page and pressing "a" to change to slide show mode does not work (tested with Chrome and IE)
This same behaviour does not occur if I choose HTML (ioslides), i.e. ioslides works as expected.
Is anyone else able to replicate this problem? Any ideas? Apparently javascript is enabled...

Related

Change RStudio default browser for markdown on Mac

I changed the default app that opens HTML files to Atom.
Now the button 'Open in browser' of the RStudio knitted HTML markdown brings me to Atom.
How can I set it to bring me back to Safari forever without switching back the HTML editor?
P.S. do you have any suggestion for the workflow?

Use browseURL function within RMarkdown

I am trying to add a link to my RMarkdown document (using a flexdashboard), and am aware of the [Website Name](URL) method, however in my particular case, the webpage can only be opened in Internet Explorer, and so I want to override my default browser, Chrome.
I have been playing in the console, and have had success with the browseURL function, which allows me to specify a file path for the browser to use: browseURL("http://URL", browser = "c:/Program Files/Internet Explorer/iexplore.exe")
My question is, how do I use this function within RMarkdown. I'd like a hyperlink to show up in my rmarkdown HTML page, where the link says "Website Name" and when you click the link, it executes the browseURL function and automatically opens Internet Explorer.
I haven't been able to figure out how to get a link to show up in my rmarkdown output that executes browseURL. Thanks for your help!

Preview markdown in VS code in browser

I am writing some github markdown with VS Code and while it has a preview, I would like to view it in my default Chrome browser so I can debug my css settings with inspect - however without checking it into github and browsing there (which slows things down a lot).
As far as I can tell from the docs VS Code Markdown Doc, the markdown preview window has no such debugging capabilities.
Is there anyway to get the markdown preview to display in the default browser instead of its own preview window.
According to VS Code's documentation Extending the Markdown preview, defining the CSS under VS Code's Workspace Settings should show the correct output in VS Code's preview.
// Place your settings in this file to overwrite default and user settings.
{
"markdown.styles": [
"Style.css"
]
}

Is there a way to print a jupyter/ipython notebook slide presentation?

Is there a way to print out a slide deck of a jupyter/ipython notebook slides? Is it possible to do from the nbviewer site (http://nbviewer.ipython.org) ?
I know that I can print a pdf of my notebook, but when I do, it doesn't have the same page breaks and doesn't skip all the code that I would like skipped (for example, the libraries I've imported aren't necessary). I'd like to have it as a backup or a printable handout.
You can try this:
jupyter nbconvert --to slides --post serve /path/to/your/notebook.ipynb
This should fire up your browser and serve the presentation (e.g at http://127.0.0.1:8000/<some-title>.slides.html#/)
change the url to
http://127.0.0.1:8000/<some-title>.slides.html?print-pdf
If you now open the print dialog from your browser, the slides should have the right formatting.
Instead of sending to a printer you should be able to choose to write to a pdf file from the printer menu.
I tested this in chrome on OSX. I assume it works on all systems, but I did not test.

MathJax script issue after customizing rstudio.markdownToHTML()

With knit2html() from the knitr package, I can generate html pages that contain latex equations and R code. But on my system equations are not rendered when using RStudio's "knit html" button.
It is because I have modified the way the "knit html" button works. To include a table of content on my html pages, I followed the Rstudio advice on Customize Markdown Rendering. And created an .Rprofile file at the root of the project directory that overrides default markdown rendering options. My .Rprofile only contains a function that replaces the rstudio.markdownToHTML() function as such:
options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
require(markdown)
htmlOptions <- markdownHTMLOptions(defaults=TRUE)
htmlOptions <- c(htmlOptions, "toc")
markdownToHTML(inputFile, outputFile, options = htmlOptions)
}
)
With this .Rprofile, I'm happy to have an automatic table of content generated on all my .RmD documents. But equations are not rendered any more! Equations appear as plain text.
If I delete .Rprofile, reload R and click the "knit HTML" button in R Studio. Equations are rendered correctly but I don't have a table of content.
If I run :
knit2html("file.Rmd", "file.html",
options = c(markdownHTMLOptions(defaults=TRUE), "toc")))
Equations are rendered correctly and I have a table of content too.
Can you help me fix rstudio.markdownToHTML() so that it renders equations?
Edit 03 April 2014: Equations are visible if I open the html page in a web browser. They are not rendered in RStudio preview HTML pane. This might be an issue with the mathjax script not taken into account anymore by the Rstudio viewer?
Dason suggested me to post this as an answer.
Equations are visible if I open the html page in a web browser.
Equations are not rendered in RStudio preview HTML pane. This might be an issue with the Rstudio viewer?

Resources