Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating lists and sub items in R markdown not working any longer?

Tags:

markdown

r

I'm following the following cheat sheet:

https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf

And trying to make some lists using the following code (copy pasted from the cheat sheet)

---
title: "Test"
author: "Test"
date: "7 August 2017"
output: html_document # or pdf_document
---

* unordered list
* item 2
 + sub-item 1
 + sub-item 2

1. ordered list
2. item 2
 + sub-item 1
 + sub-item 2 

But the results are not the same as in the cheat sheet, the circles are not the same and the sub items do not get indented.

like image 795
MLEN Avatar asked Aug 07 '17 07:08

MLEN


People also ask

Why is my R Markdown not knitting?

No Knit HTML button This means that RStudio doesn't understand your document is supposed to be an RMarkdown document, often because your file extension is . txt . To fix this, go to the Files tab (lower right corner, same pane as Plots and Help) and select the checkbox next to your document's name.

How do I create a bulleted list in R Markdown?

To make a bulleted-list in R Markdown , a series of lines are prefaced with an asterisk in exactly the manner as in a plain-text email (See Figure 1). Thus, students can learn to use R Markdown without the burden of learning a wholly new technology, such as L A TEX or HTML.

What are the cons of using R Markdown?

There are a few disadvantages to R Markdown. No track changes - Even if you're lucky to have an advisor who will review a . Rmd file, you won't get nice track changes like in Word. There are alternative to this (version control helps) but not are quite as easy as track changes.


2 Answers

For everyone that has problems showing simple list, markdown need an Empty line before a list.
This will not work * Item 1 * Item 2 * Item 3

The output will look something like this.
This will not work * Item 1 * Item 2 * Item 3

To fix this;
INSERT EMPTY LINE HERE, BEFORE LIST.
* Item 1
* Item 2
* Item 3

should output like this

  • Item 1
  • Item 2
  • Item 3
like image 75
Jimmy Fagerholm Avatar answered Oct 22 '22 05:10

Jimmy Fagerholm


Try using tab or double tab separation instead of spacebar for sub items

---
title: "Test"
author: "Test"
date: "7 August 2017"
output: html_document # or pdf_document
---

* unordered list
* item 2
    + sub-item 1
    + sub-item 2

1. ordered list
2. item 2
    + sub-item 1
    + sub-item 2 

enter image description here

like image 33
Pork Chop Avatar answered Oct 22 '22 07:10

Pork Chop