# How to install ochem for texlive

I found this package for latex that gives me the ability to typeset organic structural formulae and reaction schemes for chemistry. I'm having trouble with installing it though.

I read through the installation steps in the manual and it tells me that I need to edit the `install.cfg.UNIX` file which contains:

``````[PATH]
BINDIR=/usr/local/ochem
M4BINDIR=/usr/bin
INCDIR=/usr/local/ochem
DVIPSDIR=/usr/local/tetex/dvips/ochem
STYLEDIR=/usr/local/tetex/tex/latex/ochem
MODULDIR=/usr/local/ochem
DOCDIR=/usr/local/ochem/doc

[SYSTEM]
SYSTEM=UNIX
``````

So I edited the file to this:

``````[PATH]
BINDIR=/usr/share/ochem
M4BINDIR=/usr/bin
INCDIR=/usr/share/ochem
DVIPSDIR=/usr/share/texmf-texlive/dvips/ochem
STYLEDIR=/usr/share/texmf-texlive/tex/latex/ochem
MODULDIR=/usr/share/ochem
DOCDIR=/usr/share/ochem/doc

[SYSTEM]
SYSTEM=UNIX
``````

When I try to install the package, it says that it works, but when I try to typeset one of the examples, it tells me that it can't find `ochem.sty`. I then tried navigating to the directories that the install was supposed to make and they didn't exist. So I made the directories manually and tried the install again. I still get the missing `ochem.sty` error.

Did I edit `install.cfg.UNIX` correctly? My latex distribution is texlive 2009 on Ubuntu 10.10.

NOTE: I did try running `sudo texhash` and it still doesn't work.

EDIT: I did try running the install script as root, but it didn't work. Then I made the directories manually, and that didn't work either.

-
Probably a silly question: did you run the install script as root (or via `sudo`)? That it didn't create the directories makes me wonder about that. –  Loop Space Dec 13 '10 at 21:55
Welcome to TeX.stackexchange! Please add a link to the package (the `ochem` package on ctan doesn't contain a file named `install.cfg.UNIX`) –  Caramdir Dec 13 '10 at 21:55
Maybe `install.cfg.UNIX` should be renamed to `install.cfg`? –  Caramdir Dec 13 '10 at 21:56
Would you be willing to try another package? chemfig uses Tikz, and is part of TeX Live. –  Torbjørn T. Dec 13 '10 at 23:08
@Mica: this is not relevant here, since `ochem` is not included in TeX Live. –  mpg Dec 14 '10 at 1:35

The following shell script install `ochem` from CTAN and the one you linked successfully into my TeXLive 2010 installation under Ubuntu Linux 10.10.

You most likely need to adjust the `TEXLIVE` and the `BIN` variables.

``````#!/bin/bash -x

TEXLIVE=/usr/local/texlive/2010/texmf-dist
SCRIPTS=\$TEXLIVE/scripts/ochem
DOCS=\$TEXLIVE/doc/latex/ochem
SOURCES=\$TEXLIVE/source/latex/ochem
PACKAGE=\$TEXLIVE/tex/latex/ochem
BIN=/usr/bin

mkdir -p \$SCRIPTS
mkdir -p \$DOCS
mkdir -p \$SOURCES
mkdir -p \$PACKAGE
chmod +x *.pl
cp *.pl *.pm \$SCRIPTS
cp *.tex *.inc \$SOURCES
cp *.sty \$PACKAGE

# Install scripts
cd \$BIN
ln -s \$SCRIPTS/makePics.pl makePics

# Generate wrapper for 'chemie.pl'
# Needs to get started with the '\$SCRIPTS' folder as include folder
echo '#!/bin/sh' > ./chemie
echo "/usr/bin/env perl -I\$SCRIPTS \$SCRIPTS/chemie.pl" >> ./chemie
chmod +x ./chemie

# Ensure proper owner and permissions:
chown -R --reference=\$TEXLIVE \$SCRIPTS \$DOCS \$SOURCES \$PACKAGES
chmod -R --reference=\$TEXLIVE \$SCRIPTS \$DOCS \$SOURCES \$PACKAGES
chmod +x \$SCRIPTS/*.pl

texhash
``````
-