Chemistry - Why is pyridine used when making tosyl esters from alcohols?
Solution 1:
The function of pyridine is actually not so simple and not so easy to notice at first glance. There is a fundamental reason why pyridine is used to promote the acylation reaction, which is that it can act as a catalyst.
Despite its basicity and the subsequent formation of its chlorhydrate salt after the tosylation reaction, pyridine is also an excellent nucleophile. Pyridine is, in fact, more nucleophilic than the alcohol, and it attacks the acyl chloride rapidly, forming a highly electrophilic (because of the positive charge) intermediate: N-tosylpyridinium chloride. It is indeed this intermediate the actual tosylating agent which reacts with the alcohol to give the ester. Because pyridine is acting as a nucleophile to speed up the reaction, yet is unchanged by the reaction, it is a "nucleophilic" catalyst.
Solution 2:
The byproduct of the reaction is hydrochloric acid, and with pyridine forms the water soluble pyridinium chloride, which is readily removed in work-up. Other preparations might use triethylamine instead of pyridine.
Solution 3:
A base is needed to remove $\ce{HCl}$ produced in the reaction. A weak base is needed because strong bases are usually strong nucleophiles as well and would react with tosil chloride themselves. A tertiary amine and not primary/secondary is used, because amines are in general stronger nucleophiles than alcohols, but tertiary amines would give quite electrophilic products themselves. Pyridine is used, because nitrogen in it is in $\mathrm{sp^2}$ state, resulting in significantly lowered nucleophilicity.