GeneralInstall Packages on Mac

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Ian222
Posts: 18
Joined: Fri Oct 19, 2007 4:31 pm

Install Packages on Mac

Post by Ian222 »

I am using MacTex on Mac OS X and I would like to install a .sty file so I can use it without keeping it in the working folder. Everything I have found indicates I should place them in /usr/local/gwTeX/texmf which is a hidden folder, so it's a nuisance to access and modify. It didn't work when I saved a .sty in this folder and tried accessing it . Is there a better way to install packages? Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Install Packages on Mac

Post by balfonsi »

No. Every file used by latex must be in directory searched by tex at compiling time and there is a strict organisation called TDS (TeX Directory Structure). So your file should be, not only in ...\texmf, but in ...\texmf\latex\packagename\, or or, if it consists of a single file, grouped with other single files in ...\texmf\latex\misc.

It did not work probably because your forgot to refresh the filename database used by tex after installing your file, or it was not in a directory searched by tex.

Regards,
B.A.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Install Packages on Mac

Post by Juanjo »

In the FAQ of MacTeX one reads the following:
Q4: Where do I put my personal additions to the texmf tree?

A4: They go in
~/Library/texmf
and various subdirectories structured according to the standard TeX conventions. Here ~/Library is the Library folder in your home directory. You may have to create the texmf folder, and any subfolders of it mentioned below. For instance, TeX will find any file in
~/Library/texmf/tex
or a subfolder of this folder, and LaTeX will find any file in
~/Library/texmf/tex/latex
or a subfolder of this folder. It is not necessary to run texhash when adding files to this local tree.


This is exactly what I have done in my Mac. It works fine.

By the way, folders like /usr/local/gwTeX/texmf seems to belong to the file structure in Gerber Wierda's teTeX, which is not longer supported. However, MacTeX is based on the TeX Live distribution and so it uses a different texmf tree. Assuming that MacTeX is really your TeX system, it is not surprising that TeX can't find things located in the gwTeX folder.
Ian222
Posts: 18
Joined: Fri Oct 19, 2007 4:31 pm

Re: Install Packages on Mac

Post by Ian222 »

Thanks Juanjo, that works fine and I don't have to deal with hidden files.
Post Reply