pdf - 从 Markdown 文件创建 PDF 时使用 makeindex 和 pandoc
问题描述
我有一个markdown file
并且喜欢将其转换为pdf
. 我需要一个索引。为此我找到了makeindx
我正在使用此命令从降价文件创建 pdf:
pandoc "test.md" \
--from markdown --to latex \
--toc \
--toc-depth=1 \
--include-in-header index.tex \
--include-in-header chapter_break.tex \
--include-in-header inline_code.tex \
--include-in-header bullet_style.tex \
--include-in-header pdf_properties.tex \
--highlight-style pygments.theme \
-V toc-title='Inhaltsverzeichnis' \
-V title='Mein Titel' \
-V author='Ich' \
-V book=true \
-V date="24. Mai 2021" \
-V classoption='oneside' \
--template ./eisvogel.latex \
--listings \
-o "test.pdf"
我在github上找到的 Eisvogel 模板。我也在这里的一个问题中问了这个问题。
该文件index.tex
具有以下内容:
\usepackage{makeidx}
\makeindex
在我的文档中,我使用
Installation\index{Installation}
最后
\printindex
不幸的是,没有打印索引。
难道我做错了什么?
编辑我找到了一个临时解决方案:
首先我创建一个 *.latex。
pandoc JoomlaEnPDF.en.md \
-o 1.en.tex \
--from markdown \
--template ./eisvogel.latex \
--listings \
--toc \
--toc-depth=1 \
-V toc-title="Content" \
--top-level-division="part" \
--number-sections \
然后我手动运行命令。
pdflatex 1.en.tex
pdflatex 1.en.tex
makeindex 1.en.idx
cat ./1.en.ind >> JoomlaEnPDF.en.md
然后我创建pdf
pandoc JoomlaEnPDF.en.md \
-o 1.en.pdf \
--from markdown \
--template ./eisvogel.latex \
--listings \
--toc \
--toc-depth=1 \
-V toc-title="Table of Contents" \
--top-level-division="part" \
--number-sections \
解决方案
推荐阅读
- python - 最小最大图像直方图拉伸
- forms - 使用 symfony3 的不同类型重复相同的字段
- python - 使用 pandas 将一行写入 csv 文件
- javascript - 按键对数组进行排序
- java - 如何在 ANTLR 中多次引用相同的规则?
- php - Laravel 5.6:Eloquent + DB::Builder 查询数组索引
- python - Python中连续变量的Renyi散度
- ios - 应用程序设置 FirebaseMessaging 委托时应用程序崩溃
- ios - 选择和取消选择按钮集合
- mysql - 如何从视图中的 *sql.Rows 类型的变量中获取值?