0

I am using following in gedit external tools

#!/bin/sh
file=${GEDIT_CURRENT_DOCUMENT_NAME%}
filename="${file%.*}"
ext=${file##*.}
latexmk $filename; xdg-open $filename.pdf

Wheni run the command, i got the following output

/home/quanta/.config/gedit/tools/new-tool-2: 27: /home/quanta/.config/gedit/tools/new-tool-2: latexmk: not found

I have latexmk installed and the file gets compiled easily in terminal using latexmk. Kindly guide me on why gedit is unable to locate latexmk.

1 Answers1

1

That has to be a problem with $PATH. Put the directory where you find latexmk (result of which latexmk) in front of the latexmk in your script.

Rinzwind
  • 299,756
  • Thanks, it worked. Is there a robust method as gedit handles latex(which is in the same directory) very well. Here are the contents of my bashrc file export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH; export MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH; export INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH; – neutrino Jan 22 '19 at 17:15
  • 1
    If latexmk was installed from latexmk package, then it should be located in /usr/bin/latexmk. AFAIK the /usr/bin is a standard path. @neutrino for me it seems that you chose non-optimal method of installing LaTeX tools... – N0rbert Jan 22 '19 at 19:57
  • I understood my problem from https://askubuntu.com/questions/694021/how-to-make-ubuntu-identify-your-latest-texlive-version-2015. It appears in addition to bashrc, one has to edit path in /etc/environment as well. – neutrino Jan 22 '19 at 21:15