代码之家  ›  专栏  ›  技术社区  ›  Anton

不包括pandoc中TOC中的部分

  •  4
  • Anton  · 技术社区  · 6 年前

    我正在使用 this 论文模板。它包括摘要、致谢、图表列表。。。在 table of contents 。根据大学指南,我的TOC应该从第一章引言开始,而不是列出摘要、致谢。

    在乳胶中,你可以直接使用 \section* 但是使用 .unnumbered 在pandoc中,该部分仍然包括在内。

    将简介章节之前的章节从TOC中排除的最干净的方法是什么?

    3 回复  |  直到 6 年前
        1
  •  2
  •   sky_y    6 年前

    我正在使用 -H header.tex 作为Pandoc选项。

    我的解决方法是附加:

    \let\oldaddcontentsline\addcontentsline

    header.tex 直接地

    我在GitHub上写了同样的问题: https://github.com/chdemko/pandoc-latex-unlisted/issues/1

        2
  •  2
  •   mb21    6 年前

    有一个 open issue 关于潘多克的这件事。

    删除 {.unnumbered} 同时,您可以使用 pandoc-latex-unlisted filter

    $ pip install pandoc-latex-unlisted
    $ pandoc --filter pandoc-latex-unlisted input.md -o output.pdf
    
        3
  •  2
  •   Clément    3 年前

    您可以使用 {.unlisted}

    典型的

    # Intro{.unlisted}
    
    # Chapter 1
    

    编译时使用

    pandoc test.md --toc -s -o test.html 会给你

    enter image description here

    与相关 html 钻头:

    <body>
    <nav id="TOC" role="doc-toc">
    <ul>
    <li><a href="#chapter-1">Chapter 1</a></li>
    </ul>
    </nav>
    <h1 class="unlisted" id="intro">Intro</h1>
    <h1 id="chapter-1">Chapter 1</h1>
    </body>
    

    Source ,则, Doc