我正在使用pandoc并在markdown中写下我的文本。要创建自己的样式,我使用自定义乳胶模板。
我想用一种颜色来设置所有大胆的单词。因此,当我输入**a word**
时,这个词不仅应该是粗体,而且还应该是蓝色。
在我的乳胶模板文件中使用以下内容
\newcommand\boldblue[1]{\textcolor{blue}{\textbf{#1}}}
\renewcommand{\textbf}{\boldblue}
使用时转换为pdf时出错
pandoc myfile -f markdown -t latex --template==mytemplate -o myfile.pdf
这说
超出TeX容量,抱歉(分组级别= 255)
但是:当我只设置newcommand时
\newcommand\boldblue[1]{\textcolor{blue}{\textbf{#1}}}
我可以在我的markdown文件中写$\boldblue{some text}$
并且它可以工作。
问题:如何为**<word>**
设置新命令?
谢谢!
经过一些研究后,我发现以下解决方案使用\let
工作:
\let\oldtextbf\textbf
\renewcommand\textbf[1]{{\color{blue}\oldtextbf{#1}}}
在模板文件中使用此代码将markdown的**<some text>**
转换为latex / pdf中的粗体和蓝色。