I usually use TeXmaker to edit and compile my .tex files. I am trying to figure out where I should put the file my-package.sty, so that I can use it by simple adding \usepackage{my-package} to the preamble of any .tex file.
I found several related answers suggesting using kpsewhich and related commands, such as
However, on my system it seems that TeXmaker can find packages that neither kpsewhich nor pdflatex can find. For example, TeXmaker can compile the following file example.tex without error, and produces the correct output.
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\end{document}
But pdflatex example.tex generates the error message
! LaTeX Error: File 'lipsum.sty' not found.,
and kpsewhich lipsum.sty returns nothing.
Does this mean that there are more than one version of pdflatex installed on my system? If so how do I check/configure which version TeXmaker uses?
(I'm using MacOS 10.11.6 and Texmaker 4.5 is installed using Macports)
Please share your thoughts. Thanks!
whichcommand. Is there a good way to locate the executable file used by TeXmaker? (I figured it out by looking into all the locations in my$PATHvariable in the terminal, but I doubt it is the right way to do it.)p.s. I used MacPorts because when I changed from Linux to Mac, I wanted a bunch of other Linux-native programs, then I got lazy and installed TeXmaker with them... – Linxiao Mar 01 '19 at 14:58