1

I have a strange problem that I can't resolve.

In my main *.tex file I have

\input{Chapter1VB.tex}
\input{vbq.tex}
\newpage
\input{Chapter2VB.tex}

In the first tex file I have

\begin{thm}\label{thm1.3}

In the third I have

(which exists by Theorem~\cite{thm1.3}

No matter how many times I 'latex' or 'pdflatex' I keep getting a warning that thm1.3 is undefined.

Any thoughts?

1 Answer 1

4

The \cite macro should be used to cite bibliography references (marked by \bibitem inside a thebibliography environment). For cross-references (marked by \label), use \ref instead of \cite.

Note: You may use packages like cleveref to automatically add "Theorem" (or whatever term is appropriate) to a cross-reference.

\documentclass{article}

\newtheorem{thm}{Theorem}

\usepackage{filecontents}

\begin{filecontents}{first.tex}
\begin{thm}\label{thm1.3}
Some text.
\end{thm}
\end{filecontents}

\begin{filecontents}{second.tex}
\dots~which exists by Theorem~\ref{thm1.3}
\end{filecontents}

\begin{document}

\input{first}

\input{second}

\end{document}

(The filecontents environment is only used to include some external files directly into the example, so that it compiles. It is not necessary for the solution.)

1
  • opps, I did know that. I'll blame...Friday-itis
    – Qwirk
    May 20, 2011 at 6:23

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.