我正在编写一个自定义宏,使用乳胶将文本显示为 R markdown 代码中一些自定义图形和图片的脚注。我需要有脚本大小的字体大小,比文档其余部分减少的行距(文档其余部分是默认的 - 我没有为其设置任何间距命令),灰色文本颜色和部分注释的斜体。.Rmd 文件代码在下面:
---
output:
pdf_document:
latex_engine: pdflatex
fig_caption: yes
keep_tex: yes
documentclass: article
header-includes: \usepackage{setspace}
\usepackage{array}
---
\newcommand{\greynote}[1]{
{\scriptsize
\color{darkgray}{\setstretch{0.9}{\textit{Notes:} #1}
}
}
}
**Blah blah**
**Blah blah**
**Blah blah**
**Blah blah**
**Blah blah**
\greynote{Values indicate percentage of respondents who agree or strongly agree with the prompt. Acceptability of absence means percentage of employees who believe that absence is acceptable if there is no more work, or if they are doing something good for their communities. The data has been collected in the Jan-June 2020 period.}
当我编织 pdf 时出现以下错误:
! Undefined control sequence.
l.84 \color
{darkgray}{\setstretch{0.9}{\textit{Notes:} Values indicate p..
我该如何正确定义宏?我已重新安排了颜色和 setstretch,但它不起作用。