3

I installed mactex on yosemite via homebrew. I want to use this package. If I search for it in texlive it says that it is installed.

enter image description here

However, if I try to compile the example file by pressing the "Typeset" button I get get this error

Package tikz Error: I did not find the tikz library 'bayesnet'. 
I looked for files named tikzlibrarybayesnet.code.tex and pgflibrarybayesnet.co
de.tex, but neither could be found in the current texmf trees..

See the tikz package documentation for explanation.
Type  H <return>  for immediate help.

What should I do to fix this problem? How to I see what path TexShop is using to search for the package?

2

Important information As of September 7, 2015, the tikz-bayesnet package in TeX Live has been upddated, so the following answer is not relevant for whoever has revision 38295 in TeX Live.

If tlmgr tikz-bayesnet gives

package:     tikz-bayesnet
category:    Package
shortdesc:   Draw Bayesian networks, [...]
installed:   Yes
revision:    38295
[...]

or a larger revision number, the problem should not appear.


I suggest you to install MacTeX from the image you get at http://tug.org/mactex, rather than with Homebrew (which is what they recommend, too).

Your screen shot suggests you're using TeX Live Utility and indeed the response is good. Unfortunately, the packaging of tikz-bayesnet is wrong. If I do

tlmgr info tikz-bayesnet --list

from the terminal, the output is

package:     tikz-bayesnet
category:    Package
shortdesc:   Draw Bayesian networks, graphical models and directed factor graphs.
longdesc:    The package provides a library supporting the display of Bayesian networks, graphical models and (directed) factor graphs in LaTeX.
installed:   Yes
revision:    30094
sizes:       doc: 85k
relocatable: Yes
cat-version: 0.1
cat-date:    2014-02-26 23:03:13 +0100
cat-license: lppl1.3
collection:  collection-pictures
Included files, by type:
doc files:
  texmf-dist/doc/latex/tikz-bayesnet/LICENSE_GPL
  texmf-dist/doc/latex/tikz-bayesnet/LICENSE_LPPL
  texmf-dist/doc/latex/tikz-bayesnet/README.rst
  texmf-dist/doc/latex/tikz-bayesnet/example.tex
  texmf-dist/doc/latex/tikz-bayesnet/model_citation_influence.tex
  texmf-dist/doc/latex/tikz-bayesnet/model_lda.tex
  texmf-dist/doc/latex/tikz-bayesnet/model_pca.tex
  texmf-dist/doc/latex/tikz-bayesnet/model_pca2.tex
  texmf-dist/doc/latex/tikz-bayesnet/tikzlibrarybayesnet.code.tex

One can check this also with TeX Live Utility, by right clicking on the package name in the main window (“Packages” tab), to get

enter image description here

Alas! The file tikzlibrarybayesnet.code.tex ends up in the doc subtree, instead of the tex one. The correct response should be

  texmf-dist/tex/latex/tikz-bayesnet/tikzlibrarybayesnet.code.tex

It's a bug that should be made known in the TeX Live mailing list

http://tug.org/mailman/listinfo/tex-live

Meanwhile, you can do

mkdir -p ~/Library/texmf/tex/latex/tikz-bayesnet
cp /usr/local/texlive/2015/texmf-dist/doc/latex/tikz-bayesnet/tikzlibrarybayesnet.code.tex ~/Library/texmf/tex/latex/tikz-bayesnet

remembering to remove the file when the bug is solved.

Instead of using the terminal you can also copy the file manually in the Finder, creating the folders under ~/Library/texmf as shown.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.