If the changes are sent via push to the remote computer, then on the remote server you want to use the post-receive hook (although if you use pre-receive , then you can reject push if, say, latex does not work).
If you use a local repository, you must use post-commit (or pre-commit if you want to reject the commit).
Hooks are documented on the git hooks page.
Pat notz
source share