# \ref and \label [closed]

\documentclass[b5paper,10pt,twoside,onecolumn,draft]{article}‎
‎\usepackage{seamb}‎
\begin{document}‎‎
\begin{lem}\label{t2}
This is my lemma.
\end{lem}

By Lemma \ref{t2}, we have
\end{document}


But the output is :

Lemma 0.1. This is my lemma.

By Lemma , we have

I mean \ref does not work here.

Ps. The important part is seamb pachackege which includes three files and it is not online.

## closed as off-topic by Mico, Werner, user31729, Adam Liter, Paul GesslerJul 14 '14 at 18:33

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• Welcome to TeX.SE! Please post not just some code snippets, but a minimum working example (MWE for short, starting with \documentclass and ending with \end{document}) that reproduces the problem you're looking to solve. In particular, since the problem only seems to occur when you're using a certain "template" (a LaTeX document class? a LaTeX package?), please indicate where the template might be found online. – Mico Jun 14 '14 at 13:22
• I suppose an unnumbered Lemma. But without knowing your documentclass it is difficult to say what went wrong. – user2478 Jun 14 '14 at 13:31
• @Negin: You're right that seamb is important... but where can we find it? – Werner Jun 14 '14 at 14:06
• This is a template which the journal sent to me and it is online. Maybe it is better I ask the editor of journal first. – Negin Jun 14 '14 at 14:13
• This question appears to be off-topic because the errors that are describe would seem to be the result of the OP using a proprietary package, viz., "seamb". – Mico Jul 14 '14 at 18:08

You easily define any theorem-like enunciation on your own with amsthm-package.

\documentclass[b5paper,10pt,twoside,onecolumn,draft]{article}

\usepackage{amsthm}

\theoremstyle{plain}
\newcounter{lem}
\newtheorem{lemma}[lem]{Lemma}

\begin{document}

\begin{lemma}\label{t2}
This is my lemma.
\end{lemma}

By Lemma \ref{t2}, we have

\end{document}

• Thank you for your reply, but I should use seamb package as well and they do not work toghether. – Negin Jun 14 '14 at 14:23
• Do you get any errors? – SLx64 Jun 14 '14 at 14:26
• @ SLx64: yes, when I click on the error massege it goes to the following line in "seamb" package: \newenvironment{proof}{\vspace{-2mm}\begin{sloppypar}\noindent{\it Proof.\enspace}\ignorespaces}{\hspace*{\fill}\rule{1.7mm}{1.7mm}\end{sloppypar}\dl}‎ – Negin Jun 14 '14 at 14:29
• But without my example everything works fine? – SLx64 Jun 14 '14 at 14:34
• @Negin: Where can we download the seamb.sty? – user2478 Jun 14 '14 at 14:49

When you call label, what happens is that it writes a record to auxout which is read the next time latex is run. To debug, examine the contents of auxout, or expand \@currentlabel and \@currentlabelname in your code (you will need to use \makeatletter ... \makeatother around your macro definition). Or you could just set \@currentlabel to be what you want displayed by \ref before expanding \label.

\def\label#1{% one of many definitions
\@bsphack
\begingroup
\def\label@name{#1}%
\protected@write\@auxout{}{%
\string\newlabel{#1}{%
{\@currentlabel}% set by \refstepcounter
{\thepage}%
{\@currentlabelname}% depends on type of label
{\@currentHref}{}% used by hyperref
}%
}%
\endgroup
\@esphack
}%

\def\refstepcounter#1{\stepcounter{#1}%
\def\@currentlabel{\csname p@#1\endcsname\csname the#1\endcsname}}%