3

I'm using the PNAS two column style (pnastwo.cls). As per the answer here, I need to wrap my text in the article environment to have it actually display in two columns. However, this makes it so that references to my table don't appear. The caption sometimes doesn't appear either. Below is my code

\documentclass{pnastwo}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{article}
\begin{table}
  \begin{tabular}{|c|}
  \hline
  testing \\
  \hline
  \end{tabular}
  \caption{TESTING}
  \label{test}
\end{table}
Table~\ref{test}
\end{article}
\end{document}

and the output is

pdf output

As you can see, no reference to the table # and the caption doesn't appear either. If I remove the article environment, then the table # appears but the caption still doesn't.

Edit: As suggested by egreg below, moving the table out of the article environment makes the table # appear. The caption still doesn't though.

  • 1
    IIRC, tables should go after \end{article}. – egreg Apr 9 '15 at 22:04
  • Ok, that makes the table # appear but the caption still doesn't – Opt Apr 9 '15 at 22:05
  • The caption must go above the tabular. – egreg Apr 9 '15 at 22:08
2

The tables and figures must go after \end{article}. In both cases the caption must precede the object.

\documentclass{pnastwo}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{article}

Table~\ref{test}

\end{article}

\begin{table}
  \caption{TESTING}
  \label{test}
  \begin{tabular}{ccc}
  \hline
  testing & testing & testing \\
  \hline
  \end{tabular}
\end{table}

\end{document}

enter image description here

I'm very sorry for you being forced to use such a horrible document class: horrible for how it's written and for the output it produces.

3

All floats must be after \end{article}, using the starred form if two-column mode is used.

This is clearly stated in the instruction manual:

enter image description here

\documentclass[final]{pnastwo}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{article}

In Table~\ref{test} we see

\end{article}
  \begin{table*}
    \caption{TESTING}
    \label{test}

    \begin{tabular}{|c|}
      \hline
      testing \\
      \hline
    \end{tabular}
  \end{table*}


\end{document}
  • I omit a screen shot – user31729 Apr 9 '15 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.