0

Is there a way to generate roman numerals or letters, instead of numerical values, when using ^[footnote] in R Markdown?

Thanks!

My initial R Markdown setup:

---
title: |
    | title

author: | 
        | author
        
date: date

fontsize: 9pt
output:
  beamer_presentation:
    theme: default
    slide_level: 2
    includes:
      in_header: header.tex
    keep_tex: true

linkcolor: false
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
  • Does this answer your question? [How can I make a roman numeral list in Markdown?](https://stackoverflow.com/questions/48352733/how-can-i-make-a-roman-numeral-list-in-markdown) – blurfus Mar 23 '22 at 19:32
  • No, that question is about a list, I am asking about a footnote. I want to keep numerical values for lists. – Daniela Rodrigues Mar 23 '22 at 20:40

1 Answers1

0

I think the duplicate answer does not make it very clear but basically, you cannot achieve what you want natively.

If you are able, you need to add some changes to your CSS (or Markdown processor somewhere) to include the roman numerals at the output for you.

From the docs:

To include one or multiple custom stylesheets in an Rmd document, you can use the css option, e.g.,

output:
  html_document:
    css: "style.css"

Alternatively, you can use a css code chunk to embed the CSS rules directly in your Rmd document

```{css, echo=FALSE}
.footnotes-list {
  list-style-type: lower-roman;
}
```

So, let's say this is your markdown:

Here's a simple footnote,[^i] and here's a another one.[^ii]

asdfasdf
asfdasdf

[^i]: This is the first footnote.

[^ii]: Here's the second one.

You need to create a new file called 'styles.css' and add the following code to it:

.footnotes-list {
  list-style-type: lower-roman;
}

This would result in some HTML rendering like this (see demo below)

/* need to add this to your CSS */

.footnotes-list {
  list-style-type: lower-roman;
}
<p>
  Here’s a simple footnote,<sup class="footnote-ref">
  <a href="#fn1" id="fnref1">i</a></sup> and here’s a another one.
  <sup class="footnote-ref"><a href="#fn2" id="fnref2">ii</a></sup>
</p>

<div class="cl-preview-section">
  <p>asdfasdf<br> asfdasdf
  </p>
  <hr class="footnotes-sep">
  <section class="footnotes">
    <ol class="footnotes-list">
      <li id="fn1" class="footnote-item">
        <p>This is the first footnote. <a href="#fnref1" class="footnote-backref">↩︎</a></p>
      </li>
      <li id="fn2" class="footnote-item">
        <p>Here’s the second one. <a href="#fnref2" class="footnote-backref">↩︎</a></p>
      </li>
    </ol>
  </section>
</div>
blurfus
  • 13,485
  • 8
  • 55
  • 61