I have fulfilled all the requirements for exporting a jupyter notebook (ipynb) to pdf in VScode but still, it gives me the same error of installing TeX, Although
I have MiKTex installed in my system
I have Installed TeX package
I have Pandoc installed in my system.
When I installed MiKTeX and TeX it was not working but when I installed Pandoc it just worked once but now it giving me the same error.
This is how I have installed the dependencies:
-
I have installed
nbconvert
through this commandpip install nbconvert
. -
For TeX
pip install tex
-
For
pandoc
i downloaded an.exe
file from their website and installed it in my system, besides this I also installed pandoc package through this command in terminalpip install pandoc
However I still have an error:
error 13:11:2.772: If you have not installed xelatex (TeX) you will
need to do so before you can export to PDF, for further instructions
please look
nbconvert.readthedocs.io/en/latest/install.html#installing-tex. To
avoid installing xelatex (TeX) you might want to try exporting to HTML
and using your browsers "Print to PDF" feature.
Kindly Help me in this regard TIA.
2
Answers
Open the jupyter file with Chrome and convert it to PDF by printing. This way is simpler and more effective.
UPDATE:
First make sure that the
path
environment variable of Tex already exists in your machineThen run vscode with admin
Use the following command in the terminal (or the terminal where the virtual environment is activated if using a virtual environment) to export the PDF
During the execution of the command, many such pop-up windows may pop up prompting you to install files, please select "Install"
Sorry for the Chinese interface
After the command is executed, a PDF file will be generated in the same directory as your jupyter file.
After that you can run vscode without administrator and export PDF. Also, the interfaced export can also be used.
The installation of MiKTeX and TeX depends on the operating system.
If you are using Linux try executing the following code inside the terminal of your environment:
If you are using Windows you should get the MiKTeX exe here and install it following the wizard. The installation is really simple (just follow the wizard), but if you need to, you can check out the official instructions.
Also refer to this link for full instructions to install the additional packages that may be needed by
nbconvert
.