GeneralTrouble with the gather environment

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

Trouble with the gather environment

Post by spiegboy »

when i use \ref{label} to link the equation in the 'gather' environment, it insteads give the label of the section where it is.
could you help? cheers

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Trouble with the gather environment

Post by Stefan Kottwitz »

Did you use \label inside the gather environment? Here's a working example with correct reference to the equation 1 in section 2:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\begin{document}
\section{One}
\section{Two}
\begin{gather}
  x = 0 \label{gat}
\end{gather}
See \eqref{gat} or (\ref{gat}).
\end{document}
Stefan
LaTeX.org admin
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Trouble with the gather environment

Post by gmedina »

Hi,

as you can see in the following example

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\setcounter{section}{11}%just to do a test
\section{Dummy section}
\begin{gather}\label{equ:test}
  A = B.
  x = y.
\end{gather}

As you can see in \ref{equ:test}...

\end{document}
that is not the standard situation. Can you please post a minimal working example showing this undesired behaviour?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

Re: Trouble with the gather environment

Post by spiegboy »

Hi, stefan,

seriously, you make me hate myself.:)

thank you very much, finally i finished a journal paper and a first-year report of 100 pages within 1 month. you help me a lot.
thanks again. i wonder would it be possible for you to check my code to see whether i can make the whole report looks better.

Regards
spiegboy
Post Reply