【问题标题】:Converting Jupyter to PDF using Latax使用 Latex 将 Jupyter 转换为 PDF
【发布时间】:2020-02-11 21:41:03
【问题描述】:

我正在尝试使用乳胶将 Jupyter 笔记本转换为 PDF,但我面临以下问题。我相信这与我编译文档时生成的图表有关。该文件还包含参考。请问有没有办法解决这个问题?非常感谢大家的帮助!

Package hyperref Warning: Difference (2) between bookmark levels is greater 
(hyperref)                than one, level fixed on input line 691.


! LaTeX Error: Cannot determine size of graphic in Machine_Learning_Project_2_f
iles/Machine_Learning_Project_2_36_1.png (no BoundingBox).

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.719 ...iles/Machine_Learning_Project_2_36_1.png}

? Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something, E to edit your file,
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.
? Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something, E to edit your file,
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.
? Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something, E to edit your file,
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.
? Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something, E to edit your file,
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.
? 
! Emergency stop.
 ...                                              

l.719 ...iles/Machine_Learning_Project_2_36_1.png}

Output written on Machine_Learning_Project_2.dvi (8 pages, 69388 bytes).
Transcript written on Machine_Learning_Project_2.log.

【问题讨论】:

  • 我知道这不是一个真正的答案,但转换笔记本的一种非常常见的方法是使用 nbconvert。 nbconvert.readthedocs.io/en/latest/install.html
  • 通常在使用 includegraphics 时会添加宽度。 ``` \includegraphics[width=\linewidth]{boat.jpg} ``` 请提供乳胶失败的代码行,它可能是无效的乳胶代码。
  • @GrandFleet 我已更新问题以包含完整的错误代码。谢谢你的帮助。我需要在哪里添加\includegraphics[width=\linewidth]{boat.jpg}
  • 大概是第 719 行?
  • @GrandFleet 我在 Jupyter 笔记本中使用 python。上面的代码可以集成到 Python 中还是我需要使用单独的单元格并使用 r markdown。

标签: jupyter-notebook pdflatex bibtex


【解决方案1】:

您正在使用latex (tex->dvi) 进行编译,但您应该使用例如pdflatex,因为图形文件是PNG 格式。

【讨论】:

    猜你喜欢
    • 2018-04-25
    • 1970-01-01
    • 2019-11-23
    • 2015-12-10
    • 2016-08-23
    • 2021-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多