在 bookdown 中使用特定字符 (") 的 Latex 宏

问题描述

我在以前的项目中使用了以下 Latex 宏来向文档的边距添加新术语:

\newcommand{\margintext}[1]{\setstretch{0.4}    \raggedright{\tiny{\textsf{\uppercase{#1}}}}}

\catcode`\"=13  % make the double quote character " active
\gdef"#1"{\textit{#1}\marginpar{\margintext{#1}}\index{#1}}

\newcommand{\new}[2]
{\textit{#2}\marginpar{\margintext{#1}}\index{#1}}

这个想法是,无论我在哪里使用引号,都会调用函数。 我现在正在 bookdown 中写我的论文,并想使用这个宏。我通过以下方式导入它:

output:
  thesisdown::thesis_pdf: 
    includes:
      in_header: define_terms.tex

但这行不通。从文档中调用函数 new 有效,但完全忽略引号。

有什么建议吗?

谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)