When executing pdflatex I get "File mymath.sty" not found.

I did

sudo apt update
sudo apt install opencv-doc


sudo mktexlsr

but the problem remains. How can I get my TeX 3.14159265 (TeX Live 2017/Debian) in ubuntu 18.04 to use this package? Looking at similar cases #43108 and #102817 in tex.stackexchange did not help me.

The file mymath.sty is existing in the following folder. Do I have to do something "by hand"?

  • 1
    The simplest would be to install it in \texmflocal\tex\latex.
    – Bernard
    Mar 20, 2021 at 14:49
  • @Bernard: How? Can I copy the file manually there and then execute sudo mktexlsr? (Sorry from a beginner.)
    – ubuntuuser
    Mar 20, 2021 at 14:50
  • 1
    Normally, TeX Live installs a \texmflocal (or localtexmf, I'm not sure) in which one has to install all additions to the distribution that can be available to all users of your computer. The contents of this directory has to respect the t.d.s. structure.
    – Bernard
    Mar 20, 2021 at 14:55
  • @Bernard E. g. amsmath.sty is located here /usr/share/texlive/texmf-dist/tex/latex/amsmath
    – ubuntuuser
    Mar 20, 2021 at 14:56
  • 1
    You should never install your own files in the main TeX directory tree, say, /usr/local/texlive/2017/. Does your system feature a directory called /usr/local/texlive/texmf-local?
    – Mico
    Mar 20, 2021 at 14:59

1 Answer 1


Problem solved by moving file mymath.sty from /usr/share/doc/opencv-doc/html/mymath.sty to /usr/share/texlive/texmf-dist/tex/latex/mymath (after creating the subfolder mymath) and running sudo mktexlsr.

  • 3
    The directory you have chosen is the main distribution directory. Your file will disappear when you update with a new distribution. Mar 20, 2021 at 17:03
  • @barbara beeton What can I do then to use package mymath? The point is that I've installed opencv-doc since this is mentioned on https://packages.ubuntu.com/ when searching for mymath. But after this the package is not being recognized.
    – ubuntuuser
    Mar 21, 2021 at 8:40
  • 4
    It's recommended to use a "local" tree parallel to tex-dist. This question Local texmf tree vs. TEXINPUTS gives some useful information, but is directed to Windows. This answer is specific to *nix. Mar 21, 2021 at 13:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .