4

Consider the following code:

\documentclass[a4paper,12pt]{article}
\usepackage[all,2cell]{xy} 
\UseAllTwocells 

\newcommand{\partinto}[3][]{%
\xymatrix@C=.85em@1{%
    *+{#2\,} \ar@{|-}[r]_-*-{\scriptstyle #1} & *+{\,#3} %
}}

\begin{document}
Let $\partinto[n]{\lambda}{d}$ be a partition of $d$ into at most $n$ parts.
Also, \[ \bigoplus_{\partinto[n]{\lambda}{d}} V_\lambda. \]
\end{document}

My problem is, the xymatrix in the index of the big direct sum symbol does not scale. Is there any way I can make it automatically scale? I could certainly make a new command \scrpartinto which works as an index, but I would like to know a way to make \partinto scale automatically once it is used as an index.

1 Answer 1

5
\newcommand{\partinto}[3][]{\mathchoice
  {
   \xymatrix@C=.85em@1{%
     *+{\displaystyle#2\,} \ar@{|-}[r]_-*-{\scriptstyle #1} & *+{\displaystyle\,#3}}
  }
  {
   \xymatrix@C=.85em@1{%
     *+{\textstyle#2\,} \ar@{|-}[r]_-*-{\scriptstyle #1} & *+{\textstyle\,#3}}
  }
  {
   \xymatrix@C=.65em@1{%
     *+{\scriptstyle#2\,} \ar@{|-}[r]_-*-{\smash{\raisebox{-.4ex}{$\scriptscriptstyle #1$}}} & *+{\scriptstyle\,#3}}
  }
  {
  }
}

I've added nothing for scriptscript style, just adapt the code for script style, if you really need it.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .