The package subfloat.sty should be added to the LaTeX search path, i.e., if you have an openSUSE Linux machine, generally it is found to be in:
/usr/share/texmf/tex/latex/subfloat/
and/or
$HOME/texmf/tex/latex/subfloat/.
If you have never added manually to your LaTeX distribution a package for the only user max, the directory ~/texmf shouldn't exist. Furthermore, if you haven't added any other path to your TEXMFHOME, all the folders containing your LaTeX packages should be grouped in /usr/share/texmf/tex/latex.
The variables TEXMFHOME and your TEXMFDIST are defined in:
max@hostname ~: $ echo `kpsewhich texmf.cnf`
which should give as a result /etc/texmf/web2c/texmf.cnf.
Now, if the result of the following bash script is a message showing the word Yes or the word Nes (to execute a bash script: save it to a file named compare.sh, give it the proper permissions via chmod +x compare.sh and execute it via ./compare.sh):
if grep -q "TEXMFDIST = /usr/share/texmf" `kpsewhich texmf.cnf`; then
if grep -q "TEXMFHOME = {~/texmf" `kpsewhich texmf.cnf`; then
echo "Yes"
else
echo "Nes"
fi
else
echo "No"
fi
then you could try to follow this procedure:
- Download the package subfloat from CTAN: Directory macros/latex/contrib/subfloat (wget is needed)
- unpack the package
subfloat.zip;
- Run the script
subfloat.ins;
- Copy
subfloat.sty to your LaTeX search path;
- Optionally, copy the documentation in the documentation directory;
- Update your LaTeX distribution.
max@hostname ~: $ wget mirrors.ctan.org/macros/latex/contrib/subfloat.zip # download link for subfloat, if you don't trust this, you can download it manually
max@hostname ~: $ unzip subfloat.zip
max@hostname ~: $ cd subfloat
max@hostname ~/subfloat: $ latex subfloat.ins
max@hostname ~/subfloat: $ sudo mkdir /usr/share/texmf/tex/latex/subfloat
max@hostname ~/subfloat: $ sudo mkdir -p /usr/share/texmf/doc/subfloat
max@hostname ~/subfloat: $ sudo cp subfloat.sty /usr/share/texmf/tex/latex/subfloat/
max@hostname ~/subfloat: $ sudo cp subfloat.pdf /usr/share/texmf/doc/subfloat
max@hostname ~/subfloat: $ sudo texhash # update your LaTeX distribution
subfloat.styshould be located (if inTEXMFHOME) in/home/max/texmf/tex/latexunless you have already fiddled withTEXINPUTS,texmf.cnf, etc. That is,TEXMFHOMEshould follow the pattern ofTEXMFMAIN. I'm guessing if you 'cannot even cd to~/texmf', then that means you have not created the folder yet..? – jon Jan 02 '17 at 20:28subfloat.styinstalled? (Check withkpsewhich subfloat.sty.) – jon Jan 02 '17 at 20:29TEXMFMAIN(global),TEXMFLOCAL(local), andTEXMFHOME(user-level), which are respectively listed in the reverse order in which they are searched (by default) by KPATHSEA (trytexdoc kpathseato learn more). Your distribution will install inTEXMFMAINby default, and a 'full' installation of TeX Live will include the file at$TEXMFMAIN/tex/latex/subfloat. Packages you develop (e.g.,mypkg.sty) should go in$TEXMFHOME/tex/latex/mypkg. Note: this assumes that you have installed TeX Live; if you are using your OS-based version, details may differ. – jon Jan 03 '17 at 00:24subfloat.sty, to figure out wheregraphicx.styis, you can dokpsewhich graphicx.sty(or more general tools, likelocate graphicx.sty--- but this will only find the file, not give you any information about how TeX finds the file). – jon Jan 03 '17 at 00:26