如何在 Jupyter 中拥有 LaTeX 笔记本?

如何在 Jupyter 中拥有 LaTeX 笔记本?

我想要使​​用 Jupyter(= IPython-notebook)作为文件管理器来控制我的 LaTeX 项目。 派莱特不是我想要的。例如,你可以有一个 Matlab 桥,这样就可以在 IPython-notebook 中使用 LaTeX 桥。伪代码

sudo -H pip install [pylatexbridge]
sudo -H pip install [latex_kernel]
python -m [latex_kernel.install]

伪代码$HOME/.bash_profile

export LATEX_EXECUTABLE=/usr/local/bin/latex % TODO which one here?

目标

  1. 从 Jupyter 开始获取 .tex 文件中带有颜色的 .tex 语法。
  2. 从 Jupyter 开始编译 .tex 文档
  3. 从 Jupyter 开始预览 pdf 格式的输出

打开

  • 哪个包提供了带有颜色的 .tex 语法?

系统:Ubuntu 16.04
Texlive-full:2015

答案1

这在 ubuntu 14.04 中对我有用。我从以下网址下载了 pandoc 包这里

下载适用于 Ubuntu 的 .deb 文件

sudo su
dpkg -i pandoc-1.19.2.1-1-amd64.deb 
# These packages are too big. That's why install only things that are needed.
# So, included --no-install-recommends. Installs only dependencies
apt-get install --no-install-recommends texlive
apt-get install xzdec
apt-get install --no-install-recommends texlive-latex-extra
apt-get install --no-install-recommends texlive-xetex
apt-get install latex-xcolor
apt-get install --no-install-recommends texlive-generic-recommended

# For full texlive
# apt-get install --no-install-recommends texlive-full
  1. 完成此运行后

    jupyter 笔记本

  2. 打开你的 .ipynb 文件

  3. 在菜单栏中,点击File-> Download As->pdf via latex

您可以安装的其他软件包是

笔记:每个包之间用空格隔开)

aglfn chktex clisp cm-super cm-super-minimal context dvidvi dvipng feynmf fonts-cabin fonts-comfortaa fonts-dejavu-extra fonts-font-awesome fonts-freefont-otf fonts-gfs-artemisia
fonts-gfs-baskerville fonts-gfs-complutum fonts-gfs-didot fonts-gfs-neohellenic fonts-gfs-olga fonts-gfs-porson fonts-gfs-solomos fonts-hosny-amiri fonts-inconsolata fonts-ipaexfont-gothic
fonts-ipaexfont-mincho fonts-ipafont-gothic fonts-ipafont-mincho fonts-junicode fonts-lato fonts-linuxlibertine fonts-lmodern fonts-lobster fonts-lobstertwo fonts-oflb-asana-math
fonts-sil-gentium fonts-sil-gentium-basic fonts-stix fonts-texgyre fragmaster lacheck latex-beamer latex-cjk-all latex-cjk-chinese latex-cjk-chinese-arphic-bkai00mp
latex-cjk-chinese-arphic-bsmi00lp latex-cjk-chinese-arphic-gbsn00lp latex-cjk-chinese-arphic-gkai00mp latex-cjk-common latex-cjk-japanese latex-cjk-japanese-wadalab latex-cjk-korean
latex-cjk-thai latex-sanskrit latex-xcolor latexdiff latexmk lcdf-typetools libffcall1 libfile-which-perl libintl-perl libmagick++5 libplot2c2 libpstoedit0c2a libruby1.9.1
libtext-unidecode-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-perl libyaml-0-2 lmodern m-tx musixtex pfb2t1c2pfb pgf pmx prosper pstoedit psutils
purifyeps ruby ruby1.9.1 tex-gyre tex4ht tex4ht-common texinfo texlive-bibtex-extra texlive-extra-utils texlive-font-utils texlive-fonts-extra texlive-fonts-extra-doc
texlive-fonts-recommended-doc texlive-formats-extra texlive-games texlive-generic-extra texlive-generic-recommended texlive-humanities texlive-humanities-doc texlive-lang-african
texlive-lang-arabic texlive-lang-cjk texlive-lang-cyrillic texlive-lang-czechslovak texlive-lang-english texlive-lang-european texlive-lang-french texlive-lang-german texlive-lang-greek
texlive-lang-indic texlive-lang-italian texlive-lang-other texlive-lang-polish texlive-lang-portuguese texlive-lang-spanish texlive-latex-base-doc texlive-latex-extra-doc
texlive-latex-recommended-doc texlive-luatex texlive-math-extra texlive-metapost texlive-metapost-doc texlive-music texlive-omega texlive-pictures-doc texlive-plain-extra texlive-pstricks
texlive-pstricks-doc texlive-publishers texlive-publishers-doc texlive-science texlive-science-doc texlive-xetex tipa ttf-adf-accanthis ttf-adf-gillius xindy xindy-rules

屏幕截图如下

在此处输入图片描述

相关内容