I found the solution jupyter_notebook_config.py. Basically, the jupyter application determines the applied template, which is why it was working fine with:
jupyter nbconvert ...
but was not working with:
File->Download as->LaTeX (.tex)
So, by using this ~/.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'
and placing a 'custom_latex.tplx' in the base template directory. I can set a default template (that does nothing) and then each user can override that default template as they choose (this is for a jupyter hub installation). If you don't need this generic behavior (ie you aren't on a jupyter hub), you can ignore the default template portion entirely.
For completeness...
default template:
((= 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 *))
personal template:
((= 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 *))
Hope this helps someone else - I don't think the documentation is clear on this point at all.