Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Somwhere in preambula:

\renewcommand{\f}[2]{\frac{#1}{#2}}
\newcommand{\eqnl}[2]{\label{eq:#1} \eqn{#2}} %eqn is smthlike $$ $$
\newcommand{\eqf}[1]{\eqref{eq:#1}}

Text part:

Будем полагать, что 
\eqnl{a}{\pf{y}{x}=f(x,y)} 
непрерывна (!) и 
\eqnl{b}{y=y(x)} 
такова, что 
\eqnl{c}{\pf{y}{x} \equiv f(x,y(x))\qquad ,x \in (a,b)}
Имеем \eqf{c} для каждой точки кривой.
\cent{Тут крутой график}
Функция \eqf{b}, удовлетворяющая \eqf{c}, ....

And here is what i get in output: (equations are here, everything is as planned til...)

Функция (2), удовлетворяющая (2), ....

How can it be? It should be Функция (2), удовлетворяющая (3). It's my second day with LaTeX and this is the first time it ever made me cry.

share|improve this question
5  
Welcome to TeX.sx! My only guess would that \newcommand{\eqnl}[2]{\eqn{#2}\label{eq:#1}} should solve your problem - putting the \label after your \eqn. It would help though to see the full definition of \eqn by providing a minimal working example (MWE). –  Werner Sep 26 '12 at 23:19
    
#define is evil... –  Xiè Jìléi Sep 28 '12 at 7:50
add comment

2 Answers

I recommend against using that kind of abbreviations that make the input file very confuse. Here's an edited version:

\documentclass[a4paper]{article}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage{amsmath}

\begin{document}
Будем полагать, что 
\begin{equation}\label{eq:a}
\frac{y}{x}=f(x,y)
\end{equation}
непрерывна (!) и 
\begin{equation}\label{eq:b}
y=y(x)
\end{equation}
такова, что 
\begin{equation}\label{eq:c}
\frac{y}{x} \equiv f(x,y(x)),\qquad x \in (a,b)
\end{equation}
Имеем \eqref{eq:c} для каждой точки кривой.
\begin{center}
Тут крутой график
\end{center}
Функция \eqref{eq:b}, удовлетворяющая \eqref{eq:c}
\end{document}

that prints correctly. I guess that the definition of \eqnl you have is wrong.

enter image description here

share|improve this answer
add comment

Because of lack of a MWE … try putting \label inside your math environment:

\documentclass{article}
\usepackage{amsmath}
\newcommand{\eqnl}[2]{\begin{equation} #2 \label{eq:#1} \end{equation}} %eqn is smthlike $$ $$
\newcommand{\eqf}[1]{\eqref{eq:#1}}

\begin{document}
\eqnl{a}{a} 
\eqnl{b}{b} 
\eqnl{c}{c}
\eqf{a}, \eqf{b}, \eqf{c}, ....
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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