pandoc - 从 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 的文档,但在任何地方都没有看到它。
解决方案
我有同样的需求,我正在使用-auto_identifiers
开关,
pandoc -r markdown-auto_identifiers -w latex test.md -o test.tex
这将同时删除
\hypertarget{header-text}{%
和
\label{header-text}}
只离开
\section{Header Text}
就像你要求的那样。
推荐阅读
- gulp - 如何在服务工作者中缓存 webp 图像?
- css - 如何文本对齐跨度/标签文本端点应该垂直相同?
- python - 每当我创建一个 venv 然后 pip freeze 仍然显示所有全局包
- node.js - 需要一些关于 Promise 中的 Promise 的建议以及如何更好地编写它
- javascript - 为什么 React Fibre 会多次调用 componentWillMount?
- ruby-on-rails - Rails 文件仍然缓存在生产环境中 - 有时
- xaml - 为什么无法识别此标签页子项?
- node.js - NodeJS lambda dynamoDB putItem 仅当主排序键不同时
- python - pytz 时区 DST 问题
- c++ - 何时调用移动构造函数?