首页 > 解决方案 > 从 pandoc LaTex 输出中删除 \hypertarget

问题描述

我正在使用 pypandoc 将降价文件转换为 LaTex。我的降价文件有一个标题,例如:

# Header Text # 

当 pypandoc 将文件呈现为 .tex 文件时,它显示为:

\hypertarget{header-text}{%
\section{Header Text}\label{header-text}}

虽然这是一个很好的功能,可以轻松链接回节标题,但我不一定想要这样,并且在这种情况下更希望 pypandoc 只生成:

\section{Header Text}

是否有可用于关闭 \hypertarget{} 功能的 pandoc 设置或 pypandoc 设置?我已经查看了 pandoc 的文档,但在任何地方都没有看到它。

标签: pandocpypandoc

解决方案


我有同样的需求,我正在使用-auto_identifiers开关,

pandoc -r markdown-auto_identifiers -w latex test.md -o test.tex

这将同时删除

\hypertarget{header-text}{%

\label{header-text}}

只离开

\section{Header Text}

就像你要求的那样。

资源


推荐阅读