Keep some text in Markdown file but not showing up in exported pdf file? (a function similar to "%" in latex)

149 Views Asked by At

As the title shows--I thought this should be simple but I just could not figure it out. I am using quarto but I guess it is a question about markdown files.

I want to write some notes for myself in the markdown file (in this case, .qmd). But I do not want those notes to be included in the exported .pdf file. This can be done in latex by adding "%" in front of some text. What should I do in the markdown file for this function?

Thank you.

I tried adding "%" like in a latex file but it does not work.

3

There are 3 best solutions below

0
stefan On

One option would be to use HTML comments, e.g. <!-- Write your comments here -->.

---
title: "Untitled"
format: pdf
---

<!-- SOME NOTES -->

BLABLABLA

enter image description here

0
shafee On

You can use % to create comments in quarto (when intended output format is pdf). But you have to let quarto know about that using latex code block.

---
title: "Untitled"
format: pdf
---

```{=latex}
% Some notes to myself
```

Lorem Ipsum Sit Dolor..
0
Martin Packer On

HTML comments are your friend here. Indeed my (minimal) Markdown processor hides processing metadata in them. Any good Markdown processor would handle them, too.