5.2 Indent text
As mentioned in Section 4.12, 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 line breaks and any leading spaces will be preserved in the output. For example:8
| 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 line break 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 line break after “School of Ninja” was ignored.
- This is a limerick written by Claus Ekstrøm: https://yihui.org/en/2018/06/xaringan-math-limerick/.↩︎