I ran

\input tikz.tex

and the Tikz package is not found

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_2) (preloaded format=pdftex)
 restricted \write18 enabled.
entering extended mode
! I can't find file `tikz.tex'.
l.1 \input tikz.tex

Actually I am not able to input any TeX package in /usr/local/texlive/2021/texmf-dist/tex/plain

$ ls /usr/local/texlive/2021/texmf-dist/tex/plain
amsfonts                fixpdfmag               kotex-plain             plstmary
antt                    font-change             kurier                  present
armenian                fontch                  lambda-lists            pwebmac
asapsym                 fp                      lh                      resumemac
base                    getoptk                 ly1                     rsfs
commutative-diagrams    gfnotation              makeindex               semaphor
config                  graphics-pln            metatex                 standalone
cweb                    gustlib                 mkpattern               timetable
cweb-old                hanoi                   newsletr                treetex
cyrplain                harvmac                 omega                   tugboat-plain
encxvlna                hyplain                 pgf                     varisize
enigma                  iwona                   pgfplots                velthuis
epsf-dvipdfmx           js-misc                 pitex                   vntex
esint-type1             knitting                placeins-plain          wasy
etex                    knuth-lib               plipsum                 zztex
figflow                 knuth-local             plnfss

How can I fix this?

Just out of curiosity: which paths does TeX search for when I \input a package through plain TeX?

  • tikz.tex is in $TEXMFDIST/tex/plain/pgf/frontendlayer/tikz.tex. The pgf tree is there, so I assume tikz.tex should be too... Commented Mar 2, 2022 at 16:50
  • 1
    @zmkm No, not the absolute path, kpse should do that for you. You should be able to see the value of $TEXMFDIST with kpsewhich --var-value TEXMFDIST. But You show your TeX tree at /usr/local/texlive, but in your comment TeX seems to be looking at /opt/local/share/texmf-texlive... Something looks off Commented Mar 2, 2022 at 18:06
  • 1
    @zmkm I don't think there is an amsfonts.tex, only an amsfonts.sty... Commented Mar 2, 2022 at 19:06
  • 1
    as I suspected, you have two tex installations one under /opt (that you ar using) and one under /usr/local (that you are looking at th file list for) Commented Mar 2, 2022 at 19:25
  • 1
    there is no amsfonts.tex file in texlive Commented Mar 2, 2022 at 19:26

1 Answer 1


You have two tex installations one rooted at /opt/local/share/texmf-texlive and another at /usr/local/texlive/2021 you presumably have your PATH set so the tex from the first tree is being used, and the file listings that you show are from the second tree.

The second question asked in comments about \input amsfonts.tex not finding a file is expected, that directory is called amsfonts but does not have a file amsfonts.tex:

$ ls /usr/local/texlive/2021/texmf-dist/tex/plain/amsfonts/
amssym.def  amssym.tex  cyracc.def

You must log in to answer this question.

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