Changing code font size in template.pptx

Hello everyone--I apologize if this question has been asked and answered. I'm trying to adjust the code font size (chunks and output) for a pptx template. I have the following file for a minimal example:

The body font is set to Ubuntu (size 28), and on the master I can see the same setting:

However, I also inserted a code text box in the pptx with the font style I'd like the code to formatted in when it's rendered from R Markdown:

When I run the following R Markdown file (using my template):

---
title: "pptx from Rmd"
subtitle: "subtitle: pptx from Rmd"
output: 
  powerpoint_presentation:
    reference_doc: "reference_test.pptx"
---

```{r setup, include=FALSE}
library(knitr)
knitr::opts_chunk$set(echo = FALSE)
```

## Code font sizes in PPTX

The text body is Ubuntu (like the `reference_text.pptx`) size 28

<br>

`This inline code is Courier size 28`

<br>

```{r , echo=TRUE, eval=FALSE}
print("All the code block code is also Courier size 28")
```

<br>

```{r , echo=FALSE, eval=TRUE}
print("All the code output is also Courier size 28")
```

I get the following:

Where does this Courier font style come from, and can I change it for only code chunks?

I've tried dropping this in the .Rmd (with no avail):

<style type="text/css">

body, td {
   font-size: 14px;
}
code.r{
  font-size: 20px;
}
pre {
  font-size: 20px
}
</style>

Any help would be greatly appreciated!

You need to look inside your generated document to see which is the style used. Office docs have Paragraph Style and Character styles. Be sure to check both and update those from the style which will be used for the output you need.

Use Style inspector to help you.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.