3

I want to put a formula number inside an \align enviroment. For eaxmple

\documentclass[12pt]{article}
\usepackage[left=2cm,right=2cm,
top=2cm,bottom=2cm,bindingoffset=0cm]{geometry}
\usepackage{amssymb,amsmath}
\usepackage[utf8]{inputenc} 
\usepackage[matrix,arrow,curve]{xy}
\usepackage[russian]{babel} 
\usepackage[final]{graphicx} 
\usepackage{mathrsfs}

\newtheorem{proposition}{Предложение}



\begin{document}
\begin{proposition}\label{Prop1}
bla bla follows from bla
\end{proposition}

\begin{proposition}\label{Prop2}
bla bla bla follows from bla bla
\end{proposition}

$$
\begin{aligned}
bla &\implies bla bla &\ref{Prop1}\\
bla bla &\implies bla bla bla &\ref{Prop2}
\end{aligned}
$$
\end{document}

But this doesn't work. I use writeLaTeX. Thank you for your help.

David Carlisle
  • 757,742
Norbert
  • 273

1 Answers1

3

\ref is a text not math construct so you need to locally get into text mode first:

enter image description here

\documentclass[12pt]{article}
\usepackage{amssymb,amsmath}
\usepackage[utf8]{inputenc} 

\newtheorem{proposition}{proposition}

\begin{document}

\begin{proposition}\label{Prop1}
bla bla follows from bla
\end{proposition}

\begin{proposition}\label{Prop2}
bla bla bla follows from bla bla
\end{proposition}

$$
\begin{aligned}
bla &\implies bla bla &\text{\ref{Prop1}}\\
bla bla &\implies bla bla bla &\text{\ref{Prop2}}
\end{aligned}
$$

\end{document}
David Carlisle
  • 757,742
  • you have removed some commands from preambule and your code strart working. Which command prevent my example to work in writeLaTeX ? – Norbert Apr 10 '13 at 22:59
  • @Norbert I just removed packages like xypic that were irrelevant to the question. I added \text{} around the ref. I know nothing about writelatex do they have all the packages you used? (just put them back one at a time:-) – David Carlisle Apr 10 '13 at 23:01
  • Instead of \ref, I'd recommend the \autoref command from the hyperref package, or writing \text{Proposition \ref{Prop1}} to avoid the confusion between the Proposition numbering and numbers within a math environment. – Herr K. Apr 10 '13 at 23:10
  • @DavidCarlisle I've checked cases. My code doesn't work because of the command \usepackage[russian]{babel} I can con remove it because my article written in Russian. – Norbert Apr 10 '13 at 23:47
  • Can you help me with that problem? – Norbert Apr 10 '13 at 23:56
  • @Norbert adding that causes my texlive2012 to spend ages starting up metafont making kpathsea: Running mktexmf larm0600 (although the final pdf only seems to use type1 fonts so I dont undestand that) anyhow it does work in a standard tex setup with russian babel so you could ask writelatex if they can install the needed package and fonts – David Carlisle Apr 11 '13 at 00:19