I´m relatively new to Linux, using Ubuntu 17.04, and are starting to use the commandline. For a few cases I would like to compile my .TeX-documents from the commandline, as to enable certain options (such as --shell-escape) without having to tinker with my editor.

I have installed TeXLive 2017 with the instructions on the TeXLive-page, and not from the Ubuntu repositories, so that I received the newest version.

When using the command

    pdflatex DOCUMENT.tex 

I get the error message that I must first install pdflatex by installing some sort of package of TeXLive from the Ubuntu-repositories via sudo apt-get install. I don´t want to do that, as this is currently only TeXLive 2016.

My question is thus:

How can I make the commandline-interpreter understand it should always use the pdflatex which has been installed via TeXLive 2017 (which is in the file usr/local/texlive/2017/bin/x86_64-linux on my computer)?

  • If that is where the executable is located, use usr/local/texlive/2017/bin/x86_64-linux/pdflatex DOCUMENT.txt or else create a shell alias shortcut for this command or else add that path to your PATH. – John1024 Aug 26 '17 at 0:19
  • I just created a shell alias shortcut for bash. alias pshellescape='/usr/local/texlive/2017/bin/x86_64-linux/pdflatex --shell-escape' but where do I place it? A file ~/.bash_profile doesn`t exist. (I also enabled seeing hidden files). Do I just create it? – Kubo Aug 26 '17 at 0:53
  • Since aliases are for interactive work, the typical place to put them ~/.bashrc. Under Ubuntu, it is usual for ~/.bashrc to source ~/.bashrc_aliases so, if you prefer, you can put your new alias definitions in that file instead. (Before you do that, it is good practice to run the alias command in any shell and then, from that same shell, verify that the alias works to your satisfaction.) – John1024 Aug 26 '17 at 2:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.