Combining data on locations with career and educational histories of mathematicians, we study how distance and ties affect citation patterns. The ties considered include coauthorship, past colocation, and relationships mediated by advisers and the alma mater. With fixed effects capturing subject similarity and article quality, we find linkages are strongly associated with citation. Controlling for ties generally halves the negative impact of geographic barriers on citations. Ties matter more for less prominent and more recent papers and have retained their quantitative importance in recent years. The impact of distance, controlling for ties, has fallen and is statistically insignificant after 2004.