Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9231127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:59:38+00:00 2026-06-18T05:59:38+00:00

I’m creating some HTML slides using the following workflow: Code is written in R

  • 0

I’m creating some HTML slides using the following workflow:

  • Code is written in R Studio editor 0.97.248
  • .md document created with knitr 0.8
  • HTML5 slides created from .md file using pandoc 1.10.1

This is the workflow described by Yihui Xie here; it’s the most straightforward way I’m aware of to make slides for presentations using Markdown.

My problem is even a relatively short line of code (50 characters) runs off the right-hand side of the slide, because the default code font is large and widely-spaced.

For instance, the following slide

# Title of the slide
And some text.

````{r plotChunk, message=FALSE, fig.height=5, fig.width=5}
require(ggplot2)
ggplot(mpg, aes(x=displ, y=cty, colour=class)) + geom_point()
````

produces the following slide:

enter image description here

I could use code options tidy=FALSE to manually split lines of code, but I will never be able to fit much code on a line. Is there any way to make the default body font & code font smaller in the HTML document?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:59:39+00:00Added an answer on June 18, 2026 at 5:59 am

    Both @Yihui and @Ramnath offer effective solutions to my problem. Since each opted to respond in comments, I’ll just note that I found slidify to be a quicker solution to my underlying problem, which was that I needed to modify default pandoc formatting to make pretty slides. Compare the pandoc-created slide above with the same slide created with slidify below:

    enter image description here

    slidify picks a more appropriate code size by default.

    One reason for my trouble with pandoc may be system-specific (am running Mac OSX 10.7.5, R 2.15.1, R Studio 0.97.248, pandoc 1.10.1). Pandoc’s file conversion does not seem to be quite right on my system: on the figure in the question, see how the name of the chunk is printed over the plot, rather than below the plot. When I convert Yihui’s slides from his .Rmd source I get different (worse) output than he did. Note the ‘html’ text below, which apparently is carry-over from a previous slide in which one line of text ran off the right-hand side of the screen.

    enter image description here

    Finally, the fig.height and fig.width options work as expected in slidify, whereas pandoc seems to re-size figures to fill the slide. Note the crappy resolution of the plot in the question – it was a small plot, and pandoc has blown it up.

    I suspect pandoc will be useful for creating documents in multiple formats from RMarkdown, but for making quick slides on my system, slidify seems like a better solution out of the box.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have thousands of HTML files to process using Groovy/Java and I need to
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am using JSon response to parse title,date content and thumbnail images and place
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.