Я нашел решение jupyter_notebook_config.py .По сути, приложение jupyter определяет применяемый шаблон, поэтому он прекрасно работал с:
jupyter nbconvert ...
, но не работал с:
File-> Download as->LaTeX (.tex)
Итак, используя этот ~ / .jupyter / jupyter_notebook_config.py:
import os
c = get_config()
c.TemplateExporter.template_path = [os.path.expanduser('~/.jupyter/templates'), \
'/usr/local/bin/miniconda3/envs/MyEnv/lib/python3.6/site-\
packages/jupyter_contrib_nbextensions/templates', '.']
c.LatexExporter.template_file = 'custom_latex.tplx'
и поместив файл custom_latex.tplx в каталог базовых шаблонов,Я могу установить шаблон по умолчанию (который ничего не делает), и тогда каждый пользователь может переопределить этот шаблон по умолчанию, как они выбирают (это для установки концентратора jupyter).Если вам не нужно это общее поведение (т. Е. Вы не находитесь в концентраторе jupyter), вы можете полностью игнорировать часть шаблона по умолчанию.
Для полноты ...
шаблон по умолчанию:
((= Nbconvert custom style for LaTeX export =))
((*- extends 'article.tplx' -*))
%==============================================================================\
=
% Custom definitions
%==============================================================================\
=
((* block definitions *))
((( super() )))
% Pygments definitions
((( resources.latex.pygments_definitions )))
% Exact colors from NB
\definecolor{incolor}{rgb}{0.0, 0.0, 0.5}
\definecolor{outcolor}{rgb}{0.545, 0.0, 0.0}
% Don't number sections
\renewcommand{\thesection}{\hspace*{-0.5em}}
\renewcommand{\thesubsection}{\hspace*{-0.5em}}
((* endblock definitions *))
% No title
((* block maketitle *))((* endblock maketitle *))
%==============================================================================\
=
% Latex Article
%==============================================================================\
=
% You can customize your LaTeX document here, e.g. you can
% - use a different documentclass like
% \documentclass{report}
% - add/remove packages (like ngerman)
((* block docclass *))
% !TeX spellcheck = de_DE
% !TeX encoding = UTF-8
\documentclass{article}
((* endblock docclass *))
личный шаблон:
((= Nbconvert custom style for LaTeX export =))
((*- extends 'nbextensions.tplx' -*))
%==============================================================================\
=
% Custom definitions
%==============================================================================\
=
((* block definitions *))
((( super() )))
% Pygments definitions
((( resources.latex.pygments_definitions )))
% Exact colors from NB
\definecolor{incolor}{rgb}{0.0, 0.0, 0.5}
\definecolor{outcolor}{rgb}{0.545, 0.0, 0.0}
% Don't number sections
\renewcommand{\thesection}{\hspace*{-0.5em}}
\renewcommand{\thesubsection}{\hspace*{-0.5em}}
((* endblock definitions *))
% No title
((* block maketitle *))((* endblock maketitle *))
%==============================================================================\
=
% Latex Article
%==============================================================================\
=
% You can customize your LaTeX document here, e.g. you can
% - use a different documentclass like
% \documentclass{report}
% - add/remove packages (like ngerman)
((* block docclass *))
% !TeX spellcheck = de_DE
% !TeX encoding = UTF-8
\documentclass{article}
% this is all unnecessary when extending nbextensions.tplx + hide_input_all
\usepackage{verbatim} %for {comment}
\usepackage{fancyvrb}
\renewenvironment{Verbatim}{\comment}{\endcomment}
((* endblock docclass *))
Надеюсь, это поможет кому-то еще - я не думаю, что документация ясна по этому вопросу вообще.