I am trying to write a fraction in a matrix. I am doing it using the following code:
\[
\begin{bmatrix}
\frac{1}{6} & \frac{5}{6} & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & \frac{1}{6} & 0 & \frac{5}{6} \\
\frac{5}{6} & 0 & 0 & \frac{1}{6}
\end{bmatrix}
\]
What I get is as follows:
But what I am trying to achieve is:
Any help or suggestion will be appreciated.
Best Answer
Instead of writing
\frac{a}{b}
, usea/b
:In the second example above I've redefined the way
\frac
works to print it the way you want. Since the redefinition is done inside a display math group, it's normal function will be reset after\]
.Of course, one could also redefine the way
\frac
works globally, but that would not make sense.