Fre*_*ter 5 markdown latex renewcommand pandoc
我正在使用 pandoc 并用 markdown 编写我的文本。为了创建我自己的风格,我使用自定义乳胶模板。
我想用颜色来设置所有粗体单词的样式。所以当我输入**a word**这个词时不仅应该是粗体,而且还应该是蓝色的。
在我的乳胶模板文件中使用以下内容
\newcommand\boldblue[1]{\textcolor{blue}{\textbf{#1}}}
\renewcommand{\textbf}{\boldblue}
Run Code Online (Sandbox Code Playgroud)
使用转换为 pdf 时出现错误
pandoc myfile -f markdown -t latex --template==mytemplate -o myfile.pdf
其中说
超出 TeX 容量,抱歉(分组级别 = 255)
但是:当我只设置 newcommand 时
\newcommand\boldblue[1]{\textcolor{blue}{\textbf{#1}}}
Run Code Online (Sandbox Code Playgroud)
$\boldblue{some text}$我可以在我的 Markdown 文件中写入并且它可以工作。
问题:如何设置新命令**<word>**?
谢谢!
经过更多研究后,我发现以下解决方案有效\let:
\let\oldtextbf\textbf
\renewcommand\textbf[1]{{\color{blue}\oldtextbf{#1}}}
Run Code Online (Sandbox Code Playgroud)
在模板文件中使用此代码可将 markdown 转换**<some text>**为 Latex/pdf 中的粗体和蓝色。
| 归档时间: |
|
| 查看次数: |
3742 次 |
| 最近记录: |