# Citing a reference in a table

I was preparing a table in my research paper where I was having a formula in one column and the name of the Mathematician who discovered it in another column. I also want to cite the paper of the Mathematician where this formula is given besides the Mathematician's name (in the same column). For example, Ramanujan [21]. However, LaTeX doesn't like it and I am getting errors like

Command \mdseries invalid in math mode

and

Command \upshape invalid in math mode

which I don't understand.

I would be really grateful if someone can help me with circumventing these errors.

-
Would you be able to produce a minimal working example (MWE) that illustrates this problem? It should start with \documentclass and end with \end{document}. It should allow us to reproduce the problem and provide a viable means to overcome this error. –  Werner May 4 '13 at 5:36
Welcome to TeX.sx! –  Marc van Dongen May 4 '13 at 6:34

Without an example this is only an educated guess, but basically what you are looking for is table in which one column is holding a formula (ie in math mode) and one or more columns that hold text.

Now most of the commands for math do not work in text and vice versa which is why you are seeing such errors.

How to resolve this? Couple of ways:

• simply put your text into a \text{Ramanujan \cite{foo}} command inside the formula. So if you for example use the array environment then all your columns are in math mode. Downside: you need to do this for every cell.
• Better probably: use the arraypackage: then you can specify that some columns should have math inside, e.g.

\usepackage{array}
...
\begin{center}
\begin{tabular}{>$l<$l}
a^n+b^n=c^n & Fermat \cite{xyz} \\
\end{tabular}
\end{center}

-
Hello Frank, That worked! Thanks so much! –  Atul Dixit May 4 '13 at 13:32
@AtulDixit if this is the solution for you, you should checkmark the answer to make this visible for others haveing the same or a similar problem –  Frank Mittelbach May 4 '13 at 13:34