We demonstrate programmable generation of temporally shaped terahertz waveforms in LiNbO3 by spatially shaping the beam profile of femtosecond excitation laser pulses with a spatial light modulator. The generated terahertz waveforms have amplitudes that are approximately proportional to the first spatial derivative of the excitation beam profile.