True WYSIWYG LaTeX System
Windows     Mac     Linux  

Topic Messages

2017/12/24 18:26:11 UTC
John Gallup    
\label not working for me

I cannot seem to get the \label and \ref combination to work. 
Both when I create very simple examples (see below) and 
I try to use files with labels from colleagues who have not problem with them, 
I consistently get the error message like this 
"LaTeX Warning: Reference `sec:greetings' on page 1 undefined 
on input line 12." This message comes from the following document:

%&latex
\documentclass{article}

\begin{document}

\section{Greetings}
\label{sec:greetings}

Hello!
\section{Referencing}

I greeted in section~\ref{sec:greetings}.

\end{document}

The \ref command gives me a "??".

I just completed a clean reinstall and I still have this problem.

Please help because I need to send out a .pdf of my research paper to a conference in the next couple of days!

Thanks,
John
2017/12/24 18:36:52 UTC
Basil Malyshev    

2017/12/24 18:56:35 UTC
Basil Malyshev    

BTW: The sample is correct and work well in BaKoMa TeX.
2017/12/24 22:52:32 UTC
Brian Cowan    

Remember, John, you have to "TeX" the file a few times to get the references showing correctly. Click on the "refresh" item a couple of times.
2017/12/25 08:09:20 UTC
Basil Malyshev    

LaTeX writes labels into AUX file at first run (pass).
Then cross references will be used at second pass.
However, your document may be changed, for example by inserting Table of Contents.
NOTE: Table of contents also may be appeared only at second pass.
In this reason, third pass may be required to get correct references.
In more complex cases more passes may be required.

  • Centaur: 'TeX / Typeset Entire document' (F5) - is command for next pass (run)
  • TeXWord: 'View / TeX Refresh' (F5) - is the same.

Take attention that we provide the same key building for these commands.

Notifications

You are already subscribed for notification about changes in this thread.

You can add own message by below form:

To add comment you must be signed at Support page.

Go to see list of topics