# Error using subequations

I am using subequations. There is no way to get a right output... I am using

\documentclass{book}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}

\begin{document}

\begin{subequations}
$$%<-----------------------< h\nu'=\frac{h\nu}{1+\gamma(1-\cos\theta)}$$
$$T=h\nu-h\nu'=h\nu \frac{\gamma(1-\cos\theta)}{1+\gamma(1-\cos\theta)}$$
$$\cos\theta=1-\frac{2}{(1+\gamma)^2\tan^2\phi+1}$$
$$\cot\phi=(1+\gamma)\tan\frac{\theta}{2}$$
\end{subequations}

\end{document}


I also used $some equations$ and $some equations$ instead of equation enviroment but I can't get numbering... Any ideas?

P.S.: The error occurs on line marked with arrow in aforementioned code which states: extra \else Missing \endcsname inserted Incomplete \iffalse; all text wasignored after line67.

\documentclass[11pt,a4paper]{book}
\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
\usepackage{kerkis}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{units}
\usepackage{array}
\usepackage{framed} % ãéá ãêñé background ðßóù áðü êÜðïéá paragraphs
\usepackage{extarrows}
\usepackage{cancel}
\usepackage[pdftex]{graphicx}
\usepackage[margin=2.8cm]{geometry}
%Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\renewcommand\chaptername{ÊåöÜëáéï}
%\usepackage{babelbib}
%\selectbiblanguage{english}
\renewcommand\bibname{Âéâëéïãñáößá}
\usepackage[Glenn]{fncychap}
\usepackage{fancybox}
\usepackage{fancyhdr}
\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{footmisc}
\usepackage{subfiles}
\usepackage{float}
\usepackage{slashbox}
\usepackage{float}
%\restylefloat{figure}
%_________________________________________________________________________________________

%\usepackage[nottoc,numbib]{tocbibind}
\usepackage{fancyhdr}

%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
\usepackage{tocloft}
\makeatletter
\newcommand*{\tocwithouttitle}{\@starttoc{toc}}
\makeatother
%--------------------------------------------------------------------------------
\makeatletter
\newcommand*{\lofwithouttitle}{\@starttoc{lof}}
\makeatother
%--------------------------------------------------------------------------------
\makeatletter
\newcommand*{\lotwithouttitle}{\@starttoc{lot}}
\makeatother
%--------------------------------------------------------------------------------
%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
\usepackage{hyperref}
\usepackage{subfigure}
\renewcommand{\labelitemi}{$\circ$}
\usepackage{wrapfig}
\usepackage{color}
%\usepackage[usenames,dvipsnames]{color}
\definecolor{Darkgreen}{rgb}{0,0.4,0}
\definecolor{Darkblue}{rgb}{0,0,0.4}
\newcommand{\HRule}{\rule{\linewidth}{0.8mm}}
\usepackage{rotating}
%\usepackage[landscape]{geometry}
\usepackage{lscape}
\usepackage{cancel}
\usepackage{fancyvrb}
%\usepackage{yannisgr}
\usepackage{listings}
%\lstset{ %
%language=matlab,                % choose the language of the code
%basicstyle=\footnotesize,       % the size of the fonts that are used for the code
%numbers=left,                   % where to put the line-numbers
%numberstyle=\footnotesize,      % the size of the fonts that are used for the line-    numbers
%stepnumber=1,                   % the step between two line-numbers. If it is 1 each     line will be numbered
%numbersep=5pt,                  % how far the line-numbers are from the code
%backgroundcolor=\color{white},  % choose the background color. You must add     \usepackage{color}
%showspaces=false,               % show spaces adding particular underscores
%showstringspaces=false,         % underline spaces within strings
%showtabs=false,                 % show tabs within strings adding particular     underscores
%frame=single,           % adds a frame around the code
%tabsize=2,          % sets default tabsize to 2 spaces
%captionpos=b,           % sets the caption-position to bottom
%breaklines=true,        % sets automatic line breaking
%breakatwhitespace=false,    % sets if automatic breaks should only happen at     whitespace
%escapeinside={\%*}{*)}          % if you want to add a comment within your code
%}
\usepackage{textcomp}
\definecolor{listinggray}{gray}{0.9}
\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
\lstset{
backgroundcolor=\color{lbcolor},
tabsize=4,
rulecolor=,
language=matlab,
basicstyle=\scriptsize,
upquote=true,
aboveskip={1.5\baselineskip},
columns=fixed,
showstringspaces=false,
extendedchars=true,
breaklines=true,
prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
frame=single,
showtabs=false,
showspaces=false,
showstringspaces=false,
identifierstyle=\ttfamily,
keywordstyle=\color[rgb]{0,0,1},
stringstyle=\color[rgb]{0.627,0.126,0.941},
}
\usepackage{pifont}
\usepackage{subfiles}

%_________________________________________________________________________________________

\definecolor{mygray}{gray}{.75}%{.9, .9, .9}
\definecolor{lightgray}{gray}{.8}%{.9, .9, .9}
%\definecolor{mygray}{rgb}{.9, .9, .9} %enallaktika !! anti gia panw
\newcommand*\mygraybox[1]{\colorbox{mygray}{\hspace{1em}#1\hspace{1em}}}

%\renewcommand{\topfraction}{0.85}%gia na min uparxoun 2 figures se mia selida kai     tipota allo
\renewcommand{\textfraction}{0.1}
\renewcommand{\floatpagefraction}{0.75}

\newcommand{\sw}{\selectlanguage{english}}
\newcommand{\sq}{\selectlanguage{greek}}
\newcommand{\eng}[1]{\latintext#1\greektext}
\newcommand{\gre}[1]{\greektext\latintext#1}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{comment}   %ÁõôÜ ãéá âéâëßï
\let\origdoublepage\cleardoublepage  %áõôá åéíáé ãéá íá áöçíåé åíôåëùò êåíç óåëéäá     ìåôáîõ êåöáëáéùí
\newcommand{\clearemptydoublepage}{%
\clearpage
{\pagestyle{empty}\origdoublepage}%
}
\let\cleardoublepage\clearemptydoublepage

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{} % delete current setting for header and footer
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt} % make space for the rule      %Ôï ÷ù ïñßóåé 0.8 áð ôï     package
\fancypagestyle{plain}%

\newtheorem{thm}{Èåþñçìá}[chapter]
\newtheorem{cor}[thm]{Ðüñéóìá}
\newtheorem{lem}[thm]{ËÞììá}
\newtheorem{defgr}{Ïñéóìüò}[chapter]
\end{comment}

\parskip 3mm
\footskip = 15mm
%
%--\texorpdfstring{$\textswab{BoSonS}$}{Bosons}--
%

-
You shouldn't be getting any error, though the input is stylistically incorrect; of course your log snippet refers to another example, as there's no line 67 here. – egreg Sep 10 '12 at 8:59
@Thanos: I can't reproduce the error with the code provided. – Count Zero Sep 10 '12 at 9:23
@egreg: There is no line 67 because this code is a part of the code. Replace line 67 with , right after \begin{subequations} – Thanos Sep 10 '12 at 15:20
Please try removing packages until the error continues to be raised. What TeX distribution are you using? – egreg Sep 10 '12 at 15:30
I am using LaTeX...I don't think that it is important, but I am using subfiles...I tried to do the same thing without subfiles, but the problem remains...I'll try removing packages... – Thanos Sep 10 '12 at 15:38

But you can try this one:

\documentclass{book}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsthm}

\begin{document}
\renewcommand{\theequation}{1\alph{equation}}
\setcounter{equation}{0}

%\begin{subequations}
$$%<-----------------------< h\nu'=\frac{h\nu}{1+\gamma(1-\cos\theta)}$$
$$T=h\nu-h\nu'=h\nu \frac{\gamma(1-\cos\theta)}{1+\gamma(1-\cos\theta)}$$
$$\cos\theta=1-\frac{2}{(1+\gamma)^2\tan^2\phi+1}$$
$$\cot\phi=(1+\gamma)\tan\frac{\theta}{2}$$
%\end{subequations}

\end{document}

-
I don't think this is a solution. – egreg Sep 10 '12 at 9:30
It is working...let's say... The problem is that I am writing a book. These equations are part of a chapter, which contains more equations. So if I add later on another equation, it will not be numbered correctly, let alone I am suppossed to have a number like 1.1a and not 1a – Thanos Sep 10 '12 at 9:41
You can use this one if you want to have an output 1.1a \renewcommand{\theequation}{1.1\alph{equation}} \setcounter{equation}{0} – jeecabz Sep 10 '12 at 10:11
But again the problem remains. If I want to add another equation, it will be numbered 1.1b and not 1.2. Somehow I have to reset the counter, but I want to avoid 1.1.a... – Thanos Sep 10 '12 at 15:27

I would use

\documentclass{book}
\usepackage{amsmath}

\begin{document}

\begin{subequations}
\begin{align}
h\nu'&=\frac{h\nu}{1+\gamma(1-\cos\theta)}\\
T&=h\nu-h\nu'=h\nu \frac{\gamma(1-\cos\theta)}{1+\gamma(1-\cos\theta)}\\
\cos\theta&=1-\frac{2}{(1+\gamma)^2\tan^2\phi+1}\\
\cot\phi&=(1+\gamma)\tan\frac{\theta}{2}
\end{align}
\end{subequations}

\end{document}


which works fine.

-
It's not working either... I am gettin these errros: in \end{align}-->Argument of \declare@robustcommand has an extra }, paragraph ended before \declare@robustcommand was complete, missing \endcsname inserted, TeX capacity exceeded, sorry[input stack size=5000],no pdf file produced. – Thanos Sep 10 '12 at 8:36
The rule is &=, not =&: try and see the difference; the former gives correct spacing, the latter doesn't. – egreg Sep 10 '12 at 8:57
Sorry, my mistake... – Corentin Sep 10 '12 at 8:59
Even that, doesn't change the errors... – Thanos Sep 10 '12 at 9:41
Then the problem doesn't come from this part of the code. Do you use other packages than those mentioned in your MWE? – Corentin Sep 10 '12 at 9:51