nb_pdf_template

授权协议 MIT License
开发语言
所属分类 企业应用、 LaTeX排版系统
软件类型 开源软件
地区 不详
投 递 者 居京
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

classic.tplx

A more accurate representation of jupyter notebooks when converting to pdfs.This template was designed to make converted jupyter notebooks look (almost) identical to the actual notebook. If something doesn't exist in the original notebook then it doesn't belong in the conversion.

Note for nbconvert 5.5.0

As of nbconvert 5.5.0, the majority of these improvements have been merged into nbconvert's default template. Version 3.x of this package will continue to support nbconvert 5.5.0 and lower, whereas in the future version 4.x will only support nbconvert 5.5.0 and newer. Versions 3.x, and 4.x will overlap support for nbconvert version 5.5.0.

Note for nbconvert 6.0.0

nbconvert 6.0.0 is not yet released, but it will be changing the conversion template in a backward incompatible manner. A version 5.x of this repository will be made to support nbconvert >=6.0.0

Improvements

  1. \maketitle is removed (If you want a title then add a markdown cell to the top of your notebook).
  2. Sections are no longer numbered automatically (notebooks don't number sections so the pdf shouldn't).
  3. Markdown paragraphs are no longer auto-indented in the pdf.
  4. Syntax highlighting improvements. (Bonus if using XeLaTeX)
  5. BOXES! are drawn around code cells. (This change was merged into nbconvert 5.5.0)
  6. In/Out counts will move to the left as the execution count increases instead of pushing code to the right (only numbers are displayed by default to save page width). (This change was merged into nbconvert 5.5.0)
  7. $\LaTeX$ and $\Tex$ in markdown cells will no longer cause conversion to fail. (This change was merged into nbconvert 5.4.0)
  8. "\LaTeX" and "\TeX" are no longer converted into a logo on conversion to pdf unless they are in math mode. (This and the above point replicate the functionality of these commands in notebook markdown).
  9. In/Out prompt colours updated to match Jupyter. (This change was merged into nbconvert 5.5.0)
  10. Output text wrapping improvements. (This change was merged into nbconvert 5.5.0)
  11. Code cell text wrapping. (This change was merged into nbconvert 5.5.0)

Quick Comparison:for a closer look see the example directory.

Installation

pip install nb_pdf_template
python -m nb_pdf_template.install

Updating

pip install -U nb_pdf_template
python -m nb_pdf_template.install

Manual Install:

Drop all of the "*.tplx" files into the folder containing the other LaTeX nbconvert templates. If using anaconda, it should be something like:

*/Anaconda3/Lib/site-packages/nbconvert/templates/latex

Use

From the command line:

jupyter nbconvert --to pdf filename.ipynb --template classic

Adding:

c.LatexExporter.template_file = 'classic'

to the jupyter_nbconvert_config.py file will let you drop the "--template classic", and to the jupyter_notebook_config.py file will let you use "download as pdf" from within the Jupyter notebook.

Replace classic with your template of choice.

Templates

This package offers the following templates:

Template Use
classic.tplx (Recommended) For most accurate recreation of the default Jupyter Notebook style.
classicm.tplx m for modified. Similar to classic.tplx, but in/out prompts are above cells instead of in the margin. Bonus left margins are smaller so code cells are wider.

Tips (Good for any template)

Moved to the wiki

  • 使用文档:https://www.npmjs.com/package/vue-print-nb 一. vue-print-nb 的使用 1.1 安装 vue-print-nb npm install vue-print-nb --save 1.2. 引入vue-print-nb main.js 中全局引入 import Print from 'vue-print-nb' Vue.use(Print

  • 电子书内容介绍了关于PHP、核心技术、实践方面的内容,目前豆瓣、亚马逊、当当、京东等电子书综合评分为:7.1 PHP中使用mpdf 导出PDF文件的实现方法 mPDF是一个很强大的PDF生成库,能基本兼容HTML标签和CSS3样式,这篇文章通过实例代码给大家介绍PHP中使用mpdf 导出PDF文件的实现方法。 具体代码如下所示: /** PHP 使用 mpdf 导出PDF文件 @param $co

  • 前言 纯前端导出pdf (完全不需要后端) 一、vue-print-nb插件 npm install vue-print-nb --save //在main.js中 import Print from 'vue-print-nb' Vue.use(Print); 直接在vue中使用即可 <template> <div class="home"> <button v-print

  • Python生成HTML文档 1. webbrowser webbrowser可以读html文件,一般html文件生成可以直接用python读写文件方式写入 import webbrowser #命名生成的html GEN_HTML = "test.html" #打开文件,准备写入 f = open(GEN_HTML,'w') #准备相关变量 str1 = 'my name is :

  • /** * HTML2PDF Librairy - example * * HTML => PDF convertor * distributed under the LGPL License * * @author Laurent MINGUET * * isset($_GET['vuehtml']) is not mandatory * it allow to display the resu

  • 本篇文章主要介绍PHP生成PDF文件的方法,感兴趣的朋友参考下,希望对大家有所帮助。 代码如下:<?php /* *功能:生成用户诊断报告PDF文件 *创建时间:-- */ //phpinfo();exit; //引入MPDF类文件 set_time_limit(); include '/include/MPDF/mpdf.php'; //实例化mpdf $mpdf=new mPDF('utf-'

  • 一、vue-print-nb 实现打印功能 1、安装 cnpm i vue-print-nb -S 2、在main.js 中引入 import Print from 'vue-print-nb' Vue.use(Print) 3、在vue页面中的使用 <template> <div class="print"> <div id="printPage">

  • 最近项目中需求为在浏览器上阅览PDF格式的文件,之前没有写过,随即上网查阅,发现大家常使用的为两个插件。 其一是火狐出品的pdf.js,github地址:https://github.com/mozilla/pd...; 其二是PDFObject,额,不太清楚作者,github地址:https://github.com/pipwerks/P...。 前者功能强大,社区活跃,后者是基于jquery封

  • 由于公司业务的需要,最近需要把html静态文件生成pdf,在网上找了很多类文件来实现,效果都不是很好.最先用的是tcpdf这个类特别的慢,而且当前版本有一个很让人头疼的问题—css中的背景图片无法获取到,找了很多资料都无法解决.最后发现mpdf可能实现该功能,大喜过望,而且效率也比tcpdf快. /* *功能:生成用户诊断报告PDF文件 *创建时间:-- */ //phpinfo();exit;

  • jsp <script type="text/javascript" src="<%=componentPath%>/scripts/report_<%=localeStr%>.js" ></script> report_zh_CN.js var reportPrint_I18N = { reportName : '报表名称' } report_en_US.js var reportPri

相关阅读

相关文章

相关问答

相关文档