t-makaro / nb_pdf_template Goto Github PK
View Code? Open in Web Editor NEWA more accurate representation of jupyter notebooks when converting to pdfs.
License: MIT License
A more accurate representation of jupyter notebooks when converting to pdfs.
License: MIT License
Hi, I wanted to say thank you for your work. It's been useful to me so far.
I was trying to install it through pip but ran into an error when issuing the second command python -m nb_pdf_template.install.py
.
I saw it was only tested on Windows. I'm using MacOS High Sierra with a fresh Anaconda installation.
Here is the output, in case it is helpful.
$ pip install nb_pdf_template
Collecting nb_pdf_template
Downloading nb_pdf_template-0.9.2.tar.gz
Building wheels for collected packages: nb-pdf-template
Running setup.py bdist_wheel for nb-pdf-template ... done
Stored in directory: /Users/<user>/Library/Caches/pip/wheels/b6/56/2e/0542bcc86c3a42f83de0d54fffd7aa8ec64412a78810cde20e
Successfully built nb-pdf-template
Installing collected packages: nb-pdf-template
Successfully installed nb-pdf-template-0.9.2
$ python -m nb_pdf_template.install.py
Success
/Users/<user>/anaconda3/bin/python: Error while finding module specification for 'nb_pdf_template.install.py' (AttributeError: module 'nb_pdf_template.install' has no attribute '__path__')
However the notebook conversion works as expected:
$ jupyter nbconvert --to pdf ass8.ipynb --template jupyter.tplx
[NbConvertApp] Converting notebook ass8.ipynb to pdf
[NbConvertApp] Support files will be in ass8_files/
[NbConvertApp] Making directory ass8_files
[NbConvertApp] Making directory ass8_files
[NbConvertApp] Writing 31241 bytes to notebook.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running xelatex 3 times: ['xelatex', 'notebook.tex']
[NbConvertApp] Running bibtex 1 time: ['bibtex', 'notebook']
[NbConvertApp] WARNING | bibtex had problems, most likely because there were no citations
[NbConvertApp] PDF successfully created
[NbConvertApp] Writing 58244 bytes to ass8.pdf
Cheers!
Hi,
Is there a way to use your templates directly from the UI (menu "Download as")?
Cheers
Christophe-Marie
I don't know when, but jupyter notebook's highlighting seems to have changed. Assignment operators are now highlighted like every other operator, so the ugly hack to separate the two can be removed.
Long lines of text will simply flow off the right side of the page.
Classic.tplx spills over at 86+1
Classicm.tplx spills over at 94+1
On the bright side, latex uses monospace fonts so this will be consistent.
I've found 3 potential solutions:
This is the major limitation of this template. If a code cell is longer than 55ish lines, then it will not fit on one page, but it won't continue to be printed on the next page.
My solution is to replace the fancybox package with the tcolorbox package, since tcolorbox offers breakable boxes that allows for verbatim text.
The problem with this solution is that getting the cell and the prompt to align properly is very difficult. I tried using nested boxes, but then the cells page break at seriously awkward spots. I've looked at using vspaces, but due to the way LaTeX typesets things this won't provide a reliable alignment (it should only be off by a few millimeters, but knowing LaTeX it'll be a mile when you least expect it). The final option is to move the prompts from the left margin to above the cells. This would be reliable and has other benefits. I'll post pictures of the differences.
style_jupyter.tplx
. Might be hard since repygments are different between minted and non-minted versions.\ifleftmargins
. The prompt can be directly overwritten now. No need for silly LaTeX logic.As discussed in #13 a print statement output doesn't wrap. In my case some of these are purely introspection to help debug and see what is going on. So, sometimes I'm printing dictionaries or lists that can be too long. Anyways, you hinted at having a solution for this. Thanks for the work you've done here. You've somehow managed to fix the most annoying part about jupyter notebooks for me.
I'm trying to use this template, via jupyter nbconvert --to pdf filename.ipynb --template classicm
to convert to PDF, but it is failing with a strange error.
I am using RHEL 7.3 x64, Python 3.6.6, texlive2015-20150523 (only version of texlive available to me)
Steps to reproduce:
source activate py36_mycustomenv
pip install -r requirements.txt
# includes nb-pdf-templatepython -m nb_pdf_template.install --minted
# successfulcurl "http://path/to/internal/repo/texlive/texlive2015-20150523.iso" -o texlive2015-20150523.iso
mkdir /app/software_packages/tl/
sudo mount -o loop texlive2015-20150523.iso /app/software_packages/tl/
cd /app/software_packages/tl/
sudo ./install-tl
# install with default optionssudo echo 'export PATH=/usr/local/texlive/2015/bin/x86_64-linux:$PATH' > /etc/profile.d/texlive.sh
sudo /usr/local/texlive/2015/bin/x86_64-linux/tlmgr paper letter
sudo chmod o+rx /usr/local/texlive
sudo find /usr/local/texlive -perm 770 -exec chmod o+rx {} \;
sudo find /usr/local/texlive -perm 750 -exec chmod o+rx {} \;
sudo find /usr/local/texlive -perm 660 -exec chmod o+r {} \;
sudo find /usr/local/texlive -perm 640 -exec chmod o+r {} \;
xelatex
is in the PATH
(at /usr/local/texlive/2015/bin/x86_64-linux/xelatex
)source activate py36_mycustomenv
jupyter nbconvert --to pdf Insert_Prices_Run_EDA.ipynb --template classicm
Output, including error:
jupyter nbconvert --to pdf Insert_Prices_Run_EDA.ipynb --template classicm
[NbConvertApp] Converting notebook Insert_Prices_Run_EDA.ipynb to pdf
[NbConvertApp] Writing 19227 bytes to ./notebook.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running xelatex 3 times: ['xelatex', './notebook.tex']
[NbConvertApp] CRITICAL | xelatex failed: ['xelatex', './notebook.tex']
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./notebook.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2015/texmf-dist/tex/latex/parskip/parskip.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te
x
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-li
sts.tex))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
(/usr/local/texlive/2015/texmf-dist/tex/latex/ms/everyshi.sty))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex))
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2015/texmf-dist/tex/xelatex/xetex-def/xetex.def)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.c
ode.tex))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.de
f
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx
.def
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-p
df.def))))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.
code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.
code.tex)) (/usr/local/texlive/2015/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/color.cfg))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.
tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic
.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigo
nometric.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.rando
m.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.compa
rison.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.
code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round
.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.
code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integ
erarithmetics.code.tex)))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.co
de.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconst
ruct.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage
.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.co
de.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicst
ate.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransform
ations.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.cod
e.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.c
ode.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathproce
ssing.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.co
de.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.cod
e.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.cod
e.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.
code.tex))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.co
de.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretranspare
ncy.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.
code.tex)))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.cod
e.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.
tex)
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version
-0-65.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version
-1-18.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/verbatim.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/environ/environ.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/trimspaces/trimspaces.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex
Library (tcolorbox): 'tcbbreakable.code.tex' version '3.60'
)) (/usr/local/texlive/2015/texmf-dist/tex/latex/needspace/needspace.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/t1enc.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/psnfss/mathpazo.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/caption/caption.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/caption/caption3.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/adjustbox.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/adjcalc.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/trimclip.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/collectbox/collectbox.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/tc-xetex.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/varwidth/varwidth.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/tools/enumerate.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/textcomp.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ts1enc.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/upquote/upquote.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/eurosym/eurosym.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/ucs.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/data/uni-global.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/inputenc.sty
Package inputenc Warning: inputenc package ignored with utf8 based engines.
) (/usr/local/texlive/2015/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz))
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/grffile.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/auxhook.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(/usr/local/texlive/2015/texmf-dist/tex/latex/url/url.sty))
Package hyperref Message: Driver (autodetected): hxetex.
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hxetex.def
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/puenc.def)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/stringenc.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/tools/longtable.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/booktabs/booktabs.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/enumitem/enumitem.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/ulem/ulem.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/jknapltx/mathrsfs.sty)
! Bad register code (4095).
l.276 \XeTeXinterchartoks 4095
\mycharclassGrey = {\bgroup\ifcode\color{...
?
! Emergency stop.
l.276 \XeTeXinterchartoks 4095
\mycharclassGrey = {\bgroup\ifcode\color{...
No pages of output.
Transcript written on notebook.log.
Traceback (most recent call last):
File "/app/local/anaconda3/envs/py36_mycustomenv/bin/jupyter-nbconvert", line 11, in <module>
sys.exit(main())
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 337, in start
self.convert_notebooks()
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 507, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 478, in convert_single_notebook
output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 407, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 178, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 196, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "/app/local/anaconda3/envs/py36_mycustomenv/lib/python3.6/site-packages/nbconvert/exporters/pdf.py", line 179, in from_notebook_node
raise LatexFailed('\n'.join(self._captured_output))
nbconvert.exporters.pdf.LatexFailed: PDF creating failed, captured latex output:
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./notebook.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2015/texmf-dist/tex/latex/parskip/parskip.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te
x
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-li
sts.tex))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
(/usr/local/texlive/2015/texmf-dist/tex/latex/ms/everyshi.sty))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex))
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2015/texmf-dist/tex/xelatex/xetex-def/xetex.def)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.c
ode.tex))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.de
f
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx
.def
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-p
df.def))))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.
code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.
code.tex)) (/usr/local/texlive/2015/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/color.cfg))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.
tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic
.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigo
nometric.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.rando
m.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.compa
rison.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.
code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round
.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.
code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integ
erarithmetics.code.tex)))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.co
de.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconst
ruct.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage
.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.co
de.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicst
ate.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransform
ations.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.cod
e.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.c
ode.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathproce
ssing.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.co
de.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.cod
e.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.cod
e.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.
code.tex))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.co
de.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretranspare
ncy.code.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.
code.tex)))
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.cod
e.tex)
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.
tex)
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version
-0-65.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version
-1-18.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/verbatim.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/environ/environ.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/trimspaces/trimspaces.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex
Library (tcolorbox): 'tcbbreakable.code.tex' version '3.60'
)) (/usr/local/texlive/2015/texmf-dist/tex/latex/needspace/needspace.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/t1enc.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/psnfss/mathpazo.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/caption/caption.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/caption/caption3.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/adjustbox.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2015/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/adjcalc.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/trimclip.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/collectbox/collectbox.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/adjustbox/tc-xetex.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/varwidth/varwidth.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/tools/enumerate.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/textcomp.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ts1enc.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/upquote/upquote.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/eurosym/eurosym.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/ucs.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/ucs/data/uni-global.def))
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/inputenc.sty
Package inputenc Warning: inputenc package ignored with utf8 based engines.
) (/usr/local/texlive/2015/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz))
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/grffile.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifluatex.sty))))
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/auxhook.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(/usr/local/texlive/2015/texmf-dist/tex/latex/url/url.sty))
Package hyperref Message: Driver (autodetected): hxetex.
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hxetex.def
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/puenc.def)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/stringenc.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/tools/longtable.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/booktabs/booktabs.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/enumitem/enumitem.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/ulem/ulem.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/jknapltx/mathrsfs.sty)
! Bad register code (4095).
l.276 \XeTeXinterchartoks 4095
\mycharclassGrey = {\bgroup\ifcode\color{...
?
! Emergency stop.
l.276 \XeTeXinterchartoks 4095
\mycharclassGrey = {\bgroup\ifcode\color{...
No pages of output.
Transcript written on notebook.log.
I am new to latex, xelatex, and texlive, so I am not sure how to troubleshoot beyond here.
Currently, when doing
python -m nb_pdf_template --minted
The style_jupyter_minted.tplx
template is install as style_jupyter.tplx
instead of the original style_jupyter.tplx
template.
If this wasn't the case, style_jupyter_template.tplx
could inherit from style_jupyter.tplx
.
Downsides:
classic[m]_minted.tplx
templates, doubling the number of templates provided in this library. Which will be really annoying when I add lab[m][_minted].tplx
templates, for a total of 8 high level templates.This template has been deprecated and will be removed in version 2.0.
I was wondering what the status for nbconvert 6 support is. Unfortunately the current version 4.0.0 will not work :-(
This should be an easy fix. I'll fix this after the refactor.
Hi!
Installing the template according to instructions fails on the second command:
$ python3 -m nb_pdf_template.install
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/ville/.local/lib/python3.10/site-packages/nb_pdf_template/install.py", line 37, in <module>
install()
File "/home/ville/.local/lib/python3.10/site-packages/nb_pdf_template/install.py", line 21, in install
raise OSError("Directory: %s not found." % dst)
OSError: Directory: /usr/lib/python3/dist-packages/nbconvert/templates/latex not found.
Obviously /usr/lib/python3/dist-packages/nbconvert/templates/latex does not exist.
python3-nbconvert-6.4.0-1 installed system-wide.
Hi, I'm trying to output a pdf from my jupyter notebook that looks better than the default template. nb_pdf_template
looks more similar to the expected notebook view. Thanks for creating this nifty template!
This is the command I use: jupyter nbconvert --to latex --template classic --no-input [filename].ipynb
. However, the command won't finish running with the following errors.
! LaTeX Error: Command \@iflatexlater already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.340 ...mand*\@iflatexlater{\@ifl@t@r\fmtversion}
?
! LaTeX Error: Command \wordboundary already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.343 ^^I \newcommand{\wordboundary}{255}}
?
Any help/hints appreciated!
This looks like such a great template and I really want to use it! However I am running into an issue when I try to install it.
$ python -m nb_pdf_template.install
File "nb_pdf_template/__init__.py", line 1, in <module>
from .jupyter_python import Jupyter_PythonStyle
File "nb_pdf_template/jupyter_python.py", line 1, in <module>
from pygments.style import Style
File "pygments/style.py", line 171
class Style(metaclass=StyleMeta):
^
SyntaxError: invalid syntax
I manually installed as well, but am running into an error when trying to convert to PDF using the classic theme: (is this just a nbconvert issue?)
$ jupyter nbconvert HW2_VBRF.ipynb --to pdf --template classic
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/nbconvert/exporters/templateexporter.py", line 608, in get_template_names
raise ValueError('Unsupported mimetype %r for template %r, mimetypes supported are: \n\t%s' %\
ValueError: Unsupported mimetype 'application/pdf' for template 'classic', mimetypes supported are:
text/html
However nbconvert runs with classic theme if I convert to HTML instead of PDF. The styling does not look right in the HTML format of course
$ jupyter nbconvert HW2_VBRF.ipynb --to html --template classic
[NbConvertApp] Converting notebook HW2_VBRF.ipynb to html
[NbConvertApp] Writing 272518 bytes to HW2_VBRF.html
Since the test.ipynb file is how I test the templates, I'd be nice to automate this process a bit.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.