To create an unordered list, add dashes ( - ), asterisks ( * ), or plus signs ( + ) in front of line items. Indent one or more items to create a nested list.
There are three types of lists that can be created with MarkDown. The first type of list is the ordered list where every item in the list is numbered. The second type of list is the unordered list where each item in the list is marked with a bullet.
Bullet point lists can be created by starting each line with an asterisk followed by a space before the content of the bullet point. Note that the space is important and should not be forgotten.
The basic Markdown syntax allows you to create code blocks by indenting lines by four spaces or one tab. If you find that inconvenient, try using fenced code blocks. Depending on your Markdown processor or editor, you'll use three backticks ( ``` ) or three tildes ( ~~~ ) on the lines before and after the code block.
It doesn't appear that standard Markdown has this capability. You can:
<style type="text/css">
ol { list-style-type: upper-alpha; }
</style>
fancy_lists
extension that will allow you to mark lists with letters and roman numerals.Note: if using capital letters, two spaces are required before the text. See https://pandoc.org/MANUAL.html#fn1
A. the letter A
A. the letter B
A. etc
Markdown itself cannot do that, but since you can put HTML in it, this provides a pretty simple way to do it:
<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Some derivations on some platforms might interpret only a very strict subset of HTML. For example, StackOverflow doesn't support the type
attribute. But Wikipedia's MediaWiki Markdown does, and the GitHub Wiki Markdown does too.
At least for recent versions of Pandoc (I'm using version 1.13.1), it looks like you can use some of the fancy_list
syntax without having to enable the extension, e.g.:
I. One
A. two
1. three
2. four
i. five
ii. six
- seven
* eight
II. Nine
To compile this into a PDF you can then run:
pandoc input.md -o output.pdf
NOTE: For this to work, you have to make sure you add an extra space after any letters or roman numerals: instead of the usual one space between a bullet and the text, use two instead. (see pandoc docs under "Extension: fancy_lists
")
Late to the party, but this might help other people looking for an R Markdown solution.
In R Markdown it's straight forward. The following minimal example lists.rmd
shows different types:
---
title: "Lists"
output: pdf_document
---
A list with bullet points:
- Something
- Something else
A numeric list:
1. Something
1. Something else
A list using small letters:
a) Something
a) Something else
A list using capital letters:
A) Something
A) Something else
This knits to:
To do indent formatting this is what I use:
<style type="text/css">
/* Indent Formatting */
/* Format: a-1-i-A-1-I */
ol {list-style-type: lower-alpha;}
ol ol { list-style-type: decimal;}
ol ol ol { list-style-type: lower-roman;}
ol ol ol ol { list-style-type: upper-alpha;}
ol ol ol ol ol { list-style-type: decimal;}
ol ol ol ol ol ol { list-style-type: upper-roman;}
/* https://www.w3schools.com/cssref/pr_list-style-type.asp */
/* https://stackoverflow.com/questions/11445453/css-set-li-indent */
/* https://stackoverflow.com/questions/13366820/how-do-you-make-lettered-lists-using-markdown */
</style>
Links at bottom to where I sourced the information. And Format is explained on the second line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With