# How do I typeset a fraction of Young tableaux?

How do I typeset a fraction of Young tableaux so that the fraction is nicely spaced and diagonal?

\documentclass{article}
\usepackage{nicefrac}
\usepackage{xfrac}
\usepackage{youngtab} % for Young tableaux
\usepackage{young} % for Young tableaux
\begin{document}
This looks horrible
$\frac{\young(345,23,1) }{ \young(531,31,1)}$
So does this
$\sfrac{\young(345,23,1) }{ \young(531,31,1)}$
This isn't bad, but the separator is small, and the spacing is not so good.
$\nicefrac{\young(345,23,1) }{ \young(531,31,1)}$
\end{document}

-
You ought to try my package ytableau, which is strictly better than both of those put together. This does not address your fractions question, however. –  Ryan Reich Jun 14 '14 at 4:23
in all the answers so far, the fraction slash is visually off center. since the adjacent sides of the tableau aren't symmetrical, i'd try just to get the spacing between the top rows to look "right". to approximate that, i think that getting the point of the slash that cuts the vertical midpoint of the top row to be centered horizontally between the edges would look better than any of the attempts so far. maybe this can be calculated using tikz (i'm not good enough with that package to attempt it). –  barbara beeton Jun 14 '14 at 20:49

I would use the good old \middle since then the / is automatically scaled and a proper glyph is used. The only problem is that the tableaux are not vertically centered; a trick with array solved this:

\documentclass{article}
\usepackage{nicefrac}
\usepackage{xfrac}
\usepackage{youngtab} % for Young tableaux
\usepackage{young} % for Young tableaux

\newcommand\mathcenter[1]{\begin{array}{@{}c@{}}#1\end{array}}
\newcommand\yngfrac[2]{\left.\mathcenter{#1}\,\middle/\,\mathcenter{#2}\right.}

\begin{document}
$\yngfrac{ \young(345,23,1) }{ \young(531,31,1) }$
$\yngfrac{ \young(345,23) }{ \young(531,1) }$
$\yngfrac{ \young(345,23) }{ \young(531,31,1) }$
\end{document}

-
@Mico That's quite true. I wanted it to be short and similar to stuff like \sfrac. Nevertheless, \yngfrac should do the job ;) –  yo' Jun 14 '14 at 9:05
A separate thought: Instead of using an array to center the two tableaux, you could make use of the TeX primitives \vcenter and \hbox to define \mathcenter as \newcommand\mathcenter[1]{\vcenter{\hbox{#1}}}. –  Mico Jun 14 '14 at 9:10

One approach could be the package graphicx

\documentclass{article}
\usepackage{graphicx,youngtab}
\begin{document}
\young(345,23,1)\raisebox{.6em}{\resizebox{1.5em}{3em}{/ }}\young(531,31,1)
\end{document}


If you are worried with the slope or thickness of the resized /, another approach could be draw a sloped line in a picture environment, where you have control of the line position:

\documentclass{article}
\setlength{\unitlength}{1em}
\begin{document}
\young(345,23,1)
\begin{picture}(1,3)(0.5,0)
\put(0,0){\line(1,3){1.11}}
\end{picture}
\young(531,31,1)
\end{document}


Or a rotated rule for tuning the thickness:

\documentclass{article}
\usepackage{graphicx,youngtab}
\setlength{\unitlength}{1em}

\begin{document}

\young(345,23,1)
\begin{picture}(0.5,0)(.6,0)
\put(-0.5,0){\rotatebox{-25}{\rule{.04em}{3.7em}}}
\end{picture}
\young(531,31,1)

\end{document}

-
The problem of this sort of solutions is that the stroke comes out too thick :-/ –  yo' Jun 14 '14 at 8:07
@tohecz May be in this MWE... but you can change the content of the box, for instance, by ~~/~~~. Thin enough? –  Fran Jun 14 '14 at 8:15
I don't see how it helps, you can as well change 1.5em to something smaller with a very similar effect, but then you get a very vertical slash ;) –  yo' Jun 14 '14 at 8:17
@tohecz Too thick, too upright ... you're too picky ;). BTW +1 for your answer. –  Fran Jun 14 '14 at 11:54
I like the simplicity of this one. Thanks for all the answers! –  Luke Oeding Jun 15 '14 at 4:30

\documentclass{article}
\usepackage{tikz}
\usepackage{youngtab} % for Young tableaux
\usepackage{young} % for Young tableaux

\newcommand{\YoungFrac}[2]{%
\begin{tikzpicture}[%
outer sep=2pt,
baseline={(current bounding box.center)}
]
\node (A) {\young(#1)} ;
\node[anchor=west,xshift=10pt]
at (A.east) (B)
{\young(#2)} ;
\draw (A.south east) -- (B.north west) ;
\end{tikzpicture}
}

\begin{document}
\YoungFrac{345,23,1}{531,31,1}
\end{document}

-