3

Hello people in this site,

I am a newbie to this site, and this is my first question here. In the Preference->Engine->Latex of TeXshop, I wrote as ~/Library/TeXShop/bin/pdfplatex2 where platex2 is a shellscript with the description of

#!/bin/sh
platex -synctex=1 "$1" && \
dvips -z -f "`basename "$1" .tex`.dvi" | \
convbkmk -g > "`basename "$1" .tex`.ps" && \
ps2pdf "`basename "$1" .tex`.ps"

the contents of which have no erroneous parts.

Additionally, I appended the path of ps2pdf to the .bash_profile which I don't think is wrong either.

There is nothing wrong, it seems to me, because when I typeset a file with TeXshop, the shell script was certainly read in, but a LaTeX error appears saying:

/Users/hiro/Library/TeXShop/bin/pdfplatex2: line 5: ps2pdf: command not found

I can't understand why TeX can't find ps2pdf even though the path has been found.

I will be very glad if you give me a hint about this.

  • Is the executable bit set on your script? I.e. in the terminal, do chmod +x /Users/hiro/Library/TeXShop/bin/pdfplatex2 and then try your script again. – Alan Munn Mar 29 '18 at 15:09
  • Have you tried to execute the shell script directly from a command-line? – remco Mar 29 '18 at 15:11
  • Thank you, Alan. I did. And the properties of the pdfplatex2 is -rwxr-xr-x now. But, when I typeset it again, the error message which emerged is the same one: ps2pdf: command not found – hiroyuki Mar 29 '18 at 15:25
  • Thank you remco. I tried executing the script from a command-line, just now. As I have to consider on the result, I will write something tomorrow morning. It is 1:42 in the night. – hiroyuki Mar 29 '18 at 16:43
  • You added to .bash_profile but your script is using /bin/she rather than /bin/bash. Also, have you changed the PATH variable? What does echo $PATH give in Terminal? – Herb Schulz Mar 29 '18 at 17:12

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.