1

I'm trying to install TeX Live on Ubuntu in order to use it with Pandoc. However, executing the Pandoc command gives me the error:

pdflatex not found. Please select a different --pdf-engine or install pdflatex

I followed the Quick install guide here: https://www.tug.org/texlive/quickinstall.html, and ended up with the following script:

cd /tmp
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
zcat install-tl-unx.tar.gz | tar xf -
cd install-tl-20*
sudo perl ./install-tl --no-interaction --scheme=minimal
PATH=/usr/local/texlive/2022/bin/x86_64-linux:$PATH
sudo /usr/local/texlive/2022/bin/x86_64-linux/tlmgr init-usertree
sudo /usr/local/texlive/2022/bin/x86_64-linux/tlmgr update --all
sudo /usr/local/texlive/2022/bin/x86_64-linux/tlmgr install plex etoolbox footmisc ragged2e lastpage appendix float ulem listings geometry sidenotes mathpazo fancyhdr titlesec xcolor biblatex booktabs caption enumitem hyperref listings

Providing the direct path to tlmgr is a workaround to tlmgr not being available for sudo access after installation.

There is an existing question about pdflatex not being found. The accepted answer suggests running sudo apt install texlive-latex-base (Link to answer). That does fix the issue, but gives me two separate TeX Live installations. Running my Pandoc command afterwards fails with 'footnote.sty' not found, which I installed previously, so it clearly uses the other distribution.

I read somewhere that one should install TeX Live via the Quick install guide from above instead of through e.g. Ubunut's package manager, because they often are outdated. When I try to just install the texlive package via sudo apt install texlive, and then try to install packages via tlmgr, I indeed get the Local TeX Live is older than remote repository error that many questions on here also address.

So, it seems that the Quick install doesn't install pdflatex properly, even though everything I find says that it is supposed to be included. Does anybody know how to solve this, i.e. install TeX live properly? Perhaps I made a mistake when adjusting the commands from the install guide, but I can't figure out what.

6
  • 2
    you need to do PATH=/usr/local/texlive/2022/bin/x86_64-linux:$PATH in your setup files so it is in your environment, not just the shell used for install Commented Dec 15, 2022 at 10:36
  • Hi David, good point. I was running the commands one by one in a regular shell instead of in a script, so the variable was set correctly. Setting it with export PATH= didn't have an effect either. In both cases, I can see it is added when typing $PATH. I have tried to run this on multiple fresh Ubuntu installations now and always get the same error. Commented Dec 15, 2022 at 11:37
  • you need to put it in .profile or .bash_profile or whatever (if just for you) or the default system profile if for everyone. If pdflatex is not being found your PATH is not set. (well at least you can list ls -l /usr/local/texlive/2022/bin/x86_64-linux/pdflatex to check it is there. So your question is just a linux question how to set the path, not really tex related Commented Dec 15, 2022 at 11:43
  • sudo apt install texlive, and then try to install packages via tlmgr, for the apt tex, install packages via apt not tlmgr (but as you have texlive 2020 you could update via tlmgr once you fix the path so the right copy of tlmgr is found) Commented Dec 15, 2022 at 11:52
  • 1
    pdflatex wasn't even part of the x86_x64-linux directory, so I don't think it is a PATH issue. I now ended up installing Tex Live using regular Ubuntu packages, even if they may be somewhat outdated. This way I could get all the packages I needed by installing several additional packages listed here: tex.stackexchange.com/a/504566/146161 Commented Dec 15, 2022 at 12:45

1 Answer 1

3

You had installed the minimal scheme.

texdoc texlive documents the installer scheme option as:

enter image description here

So you had opted to only install plain tex, not latex

pandoc will be assuming a rather full set of packages, it is much simpler to always install the full scheme unless you are really short of space.

1
  • Oh wow, that was well spotted. I think I had it on basic before, but then saw a warning in the output that it doesn't exist and will fall back to minimal, so I just changed it to that. But thank you for pointing that out, it is most likely the solution even though I have now changed to using the Ubuntu packages directly. The reason why I didn't chose the full package straight always is because I want it to build it in an automated pipeline, and it shouldn't spend too much time installing everything every time it runs. Commented Dec 15, 2022 at 15:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .