11

IPython ノートブックからレポートを作成しようとしています。toc 拡張機能を使用して、nb の toc を作成しています。既にノートブックを html に変換しましたが、目次が表示されておらず、ドキュメントの残りの部分にリンクしていません。指定された fromat の 1 つに変換し、リンク可能な (またはリンク不可能な) TOC を保持する方法はありますか?

4

2 に答える 2

2

Assuming you use IPython 1.x you have the following options to include the toc in the pdf

  • use the latex_book template
    (ipython nbconvert --to=latex --template=latex_book --post=pdf file.ipynb)

  • extend the latex_article (default) template
    Create a file with the following content (e.g. toc_latex.tplx) in the working dir:

    ((*- extends 'latex_article.tplx' -*))
    ((* block toc *))\tableofcontents((* endblock toc *))
    

    Use it as a template like
    ipython nbconvert --to=latex --template=toc_latex --post=pdf file.ipynb

If you use IPython 2.x

  • use the latex_report template
    (ipython nbconvert --to=latex --template=latex_report --post=pdf file.ipynb)

  • the custom template could be something like

    ((*- extends 'latex_article.tplx' -*))
    ((* block abstract *))\tableofcontents((* endblock abstract *))
    
于 2013-10-15T21:02:03.750 に答える