4.2 Indent text

As mentioned in Section 3.8, whitespaces are often meaningless in Markdown. Markdown will also ignore spaces used for indentation by default. However, we may want to keep the indentation in certain cases, e.g., in verses and addresses. In these situations, we can use line blocks by starting the line with a vertical bar (|). The linebreaks and any leading spaces will be preserved in the output. For example:1

| When dollars appear it's a sign
|   that your code does not quite align  
| Ensure that your math  
|   in xaringan hath  
|   been placed on a single long line

The output is:

When dollars appear it’s a sign
  that your code does not quite align
Ensure that your math
  in xaringan hath
  been placed on a single long line

The lines can be hard-wrapped in the Markdown source. If the continuation line begins with a space, the previous linebreak and the leading spaces on this line will be ignored as usual. For example:

| Hiring Manager
| School of Ninja,
  Hacker's University
| 404 Not Found Road,
  Undefined 0x1234, NA

The output is:

Hiring Manager
School of Ninja, Hacker’s University
404 Not Found Road, Undefined 0x1234, NA

You can see that the linebreak after “School of Ninja” was ignored.


  1. This is a limerick written by Claus Ekstrøm: https://yihui.org/en/2018/06/xaringan-math-limerick/.↩︎