【发布时间】:2020-06-28 23:21:35
【问题描述】:
这个问题链接到Jupyter nbconvert LaTex Export Theme
我正在尝试通过终端(在 Mac 上)使用 nbconvert 将我的 Jupyter Notebook 导出为 .pdf。我已经创建了一个 .tplx 模板,它将隐藏代码并仅显示输出和降价。
# this is my jupyter notebook heading
pd.set_option('display.notebook_repr_html', True)
pd.set_option('display.expand_frame_repr', True)
pd.set_option("display.latex.repr", True)
pd.set_option("display.latex.longtable", True)
pd.set_option("display.latex.escape", True)
# this is the .tplx template for hiding the input and (preferably) setting the table width
# to fit the page width (including margins)
((*- extends 'article.tplx' -*))
((* block input_group *))
((*- if cell.metadata.get('nbconvert', {}).get('show_code', False) -*))
((( super() )))
((*- endif -*))
((* endblock input_group *))
((* block docclass *))
\documentclass[8pt]{article}
\AtBeginDocument{
\usepackage{graphicx}
\resizebox{\textwidth}
}
((* endblock docclass *))
我得到的是一个 pdf,其中的表格具有适当的样式并继续下一页上的行,但它不会将列分割到下一页。相反,它根本没有显示它们。这是屏幕截图。
我查看了之前关于 SO 的帖子,并尝试使用可用文档编辑 .tplx 文件,但找不到解决方案。
【问题讨论】:
标签: python pandas jupyter-notebook latex nbconvert