如何使用 R markdown 和 pandoc 防止 LaTeX 文档中的 ~(波浪号)字符转义?
How to prevent escape of a ~ (tilde) character in LaTeX document using R markdown and pandoc?
我正在使用 R Markdown 准备科学文章手稿。我的 R Markdown 文件首先由 knitr 转换为 Markdown,然后由 pandoc 转换为 LaTeX 代码。
在 LaTeX 中,~
字符用于表示不间断的 space。 It is considered good style 一些期刊在 \ref
或 \cite
前面使用 ~
字符。例如,像 Section~\ref{...}
和 Figure~\ref{...}
或者 Sect.~\ref{...}
和 Fig.~\ref{...}
这样的 LaTeX 代码是我的期刊所期望的。
尝试使用 R Markdown 生成尽可能接近期刊指南的 LaTeX 代码,我尝试使用 Sect.~\ref{...}
,但这被 pandoc 转换为 Sect.\textasciitilde{}\ref{...}
。
如何防止 pandoc 将 ~
字符转义为 \textasciitilde{}
以获得有效的 LaTeX?
我正在使用 R Markdown 准备科学文章手稿。我的 R Markdown 文件首先由 knitr 转换为 Markdown,然后由 pandoc 转换为 LaTeX 代码。
在 LaTeX 中,~
字符用于表示不间断的 space。 It is considered good style 一些期刊在 \ref
或 \cite
前面使用 ~
字符。例如,像 Section~\ref{...}
和 Figure~\ref{...}
或者 Sect.~\ref{...}
和 Fig.~\ref{...}
这样的 LaTeX 代码是我的期刊所期望的。
尝试使用 R Markdown 生成尽可能接近期刊指南的 LaTeX 代码,我尝试使用 Sect.~\ref{...}
,但这被 pandoc 转换为 Sect.\textasciitilde{}\ref{...}
。
如何防止 pandoc 将 ~
字符转义为 \textasciitilde{}
以获得有效的 LaTeX?