This is not a perfect answer but is a slightly better workaround than putting the whole picture in a TeX environment. Add the following to your preamble (in Document->Settings):
\makeatother
\newcommand{\arup}[1]{\ar@/^/[#1]}
\newcommand{\ardn}[1]{\ar@/_/[#1]}
\makeatletter
(Yes, this combination of \makeatother
and \makeatletter
is the opposite way round than you may be used to seeing in a preamble. This is because LyX already surrounds the preamble with a \makeatletter
/ \makeatother
pair, but we actually do not want it for these macro definitions, so we have to temporarily turn it back off.)
Now where you would have used something like \ar@/_/[r]
, instead use \ardn{r}
. I suspect you're already aware, but note that the key sequence to produce the braces is a little unintuitive, because LyX usually escapes them for you:
- {r} gives
\{r\}
in TeX (which actually gives {r} in the PDF output).
- \{rspace gives
{r}
in TeX.
Finally, a half-related tip. If you use xymatrix in LyX documents a lot, it may be worth defining your own macros for the arrows in LyX using insert->math->macro. (You cannot put /_/
in these either, so you still need the premable macros too.) You can then put what you really want in the "TeX" box, but put something visually suggestive in the "LyX" box e.g. \overset{#1}{\curvearrowright}
. This can make editing a big matrix a bit less confusing.
xymatrix
so it will be easier to start with this. For now just put/_{/}
and I'll know that's the place where you want/_/
. For more information, see wiki.lyx.org/FAQ/MinimalExample/_/
is formatted as/_{/}
.$/_/$
in an ERT box. Of course that is not nice but I can't think of a better way. Note for the future that a .lyx file is just text so you can actually just paste it into your question instead of linking to an external file.