I'd like to use $\mathsf{C}$ rather than $\mathcal{C}$ for categories. However, when I use the former in the first displayed equation, the top arrowhead (the arrow labelled L) points northwest, rather than southwest, as you'd expect. In the second displayed equation, with the wrong font, this arrow points in the correct direction. If I unload all the packages except xy, the problem disappears.
Any idea what's going on?
\documentclass{amsbook}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{stmaryrd}
\usepackage{txfonts}
\usepackage{comment}
\usepackage{enumitem}
\usepackage{epigraph}
\usepackage{dialogue}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{amsmidx}%for the index
\makeindex{idx}
\makeindex{nidx}%index of notation
\makeindex{cidx}%index of categories
\newcommand{\idx}{\index{idx}}
\newcommand{\nidx}{\index{nidx}}
\newcommand{\cidx}{\index{cidx}}
\usepackage[pdfborder=0, hidelinks]{hyperref}
\usepackage[all,pdftex]{xy}
\newdir{ >}{{}*!/-10pt/@{>}}
\begin{document}
$$\xymatrix{ \mathsf{C} \ar[r]|U & \mathsf{D} \ar@{->}@/_3ex/[l]_L^\perp \ar@/^3ex/[l]^R_{\perp} }$$
$$\xymatrix{ \mathcal{C} \ar[r]|U & \mathsf{D} \ar@{->}@/_3ex/[l]_L^\perp \ar@/^3ex/[l]^R_{\perp} }$$
\end{document}



txfonts, but it doesn't show if you use\usepackage{newtxtext,newtxmath}instead of\usepackage{txfonts}. Note that the packages I recommend fix the numerous misfeatures oftxfontsand are actively maintained. – egreg Nov 19 '15 at 20:48txfontswithnewtxtextandnewtxmath, the problem switches: the arrow is in the wrong direction for\mathcal Cbut correct for\mathsf C. Do you know why that might happen? – Arun Debray Nov 19 '15 at 21:23\mathcal, e.g. by calling\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}, or by adding a small amount of space (about 0.5ex) after the\mathcal C. – Arun Debray Nov 19 '15 at 21:36