We are using custom kernels, and setting up environments from them (following the doc ). For LaTeX purpose, we installed the full TeX live suite in a dedicated location, i.e. not the standard one, and update the environment with the required new path.
While PDF export from the command line within a notebook will work  (which means that everything required is found), trying to do it from the menu, i.e.
File ->Export Notebook As ->Export Notebook to PDF, will not!
: issuing, from a cell, or in a terminal, here from a cell of the notebook
! jupyter nbconvert --to pdf notebook.ipynb
Thus it seems that from the menu, the environment is not the user’s environment (not the same as the one in the notebook), but the system’s one (thus, in our case, xelatex is not found, as it was not installed in the default location system wide). That would at least explain why conversion works from the notebook (using a custom environment, which includes LaTeX), using the
nbconvert command line, though it won’t from the menu.
Is there a way to make sure the environment from the notebook is fully “transferred” to the menu, especially when trying to export notebook to PDF? How can I achieve this when creating custom kernel?