英文:
Keep some text in Markdown file but not showing up in exported pdf file? (a function similar to "%" in latex)
问题
正如标题所示——我以为这应该很简单,但我就是想不明白。我正在使用quarto,但我猜这与markdown文件有关。
我想在markdown文件(在这种情况下是.qmd
)中写一些备忘录给自己。但我不想让这些备忘录出现在导出的.pdf
文件中。在latex中可以通过在某些文本前添加“%”来实现。在markdown文件中,我应该怎么做?
谢谢。
我尝试像在latex文件中那样添加“%”,但没有效果。
英文:
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.
答案1
得分: 3
一种选择是使用HTML注释,例如<!-- 在这里写下您的评论 -->
。
标题:未命名
格式:pdf
<!-- 一些注释 -->
BLABLABLA
英文:
One option would be to use HTML comments, e.g. <!-- Write your comments here -->
.
---
title: "Untitled"
format: pdf
---
<!-- SOME NOTES -->
BLABLABLA
答案2
得分: 2
你可以在 quarto 中使用 %
来创建注释(当输出格式为 pdf 时)。但是你必须使用 LaTeX 代码块来告诉 quarto。
% 这是一些给自己的注释
Lorem Ipsum Sit Dolor...
英文:
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..
答案3
得分: 1
HTML注释在这里非常有用。确实,我的(最简化的)Markdown处理器将处理元数据隐藏在其中。任何良好的Markdown处理器也会处理它们。
英文:
HTML comments are your friend here. Indeed my (minimal) Markdown processor hides processing metadata in them. Any good Markdown processor would handle them, too.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论