Math & Science\align counter not working

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
J0mL-C
Posts: 4
Joined: Wed Dec 12, 2012 4:32 pm

\align counter not working

Post by J0mL-C »

Hello,
\align seems not functioning well:
it generates no numbering at all, and when referenced, shows the section number.

I tried to explain here. My class code is at last

Code: Select all

\begin{subequations} \label{e:015} %on page 16
	\begin{align}
		   & A\label{E-015-1}
          \intertext{procedemos a eliminar...}
	  U_1\cdot & A = B\label{E-015-2}
        \end{align}
some text....
\begin{align}
	U_2\cdot B &= 	L\label{E-015-3}
\end{align}
\end{subequations}
::: produces no numbers!:

A (expected I.1a)
procedemos a eliminar ...
U1 . A = B (expected I.1b)
some text...
U2 . B = L (expected I.1b)



But later

Code: Select all

\begin{subequations}
\begin{eqnarray}
	R&=S\label{E_m6000}\\
	&=S'\label{E_m6001}
\end{eqnarray}
\end{subequations}
produces

R = S (I.2a)
= S' (I.2b)


And later on
...some text... en la~\eqref{E_m6001} ... produces correctly ''en la (I.2b)''


BUT ....after some other text in the same subsection...

página~\pageref{e:015} \eqref{E-015-2} \eqref{E-m6001} \eqref{E-m6050}
just to prove the malfunction:
e:015 corresponds to the first ''subequations'' I put for you
E-015-2 is the second expresion in it
E-m6001 my (I.2b), I hope
E-m6050 the nearly next ''align'' expresion in a new paragraph

results in: página 16, (as espected) (I.1) (when expected I.2b again)!
(I.2.7.3) and (I.2.7.3)
wich is the current ''\subsubsection'' number

It seems \align related counter doesn't counts, and \eqnarray one <<dies>> quickly...


I traied to use only eqnarrays instead of align, but getting another errors
I traied to use \usepackage{mathenv} deactivating amsthm, without success
The ams manual doesn't provide a clue for me, as it shows

Code: Select all

\documentclass[11pt]{book}
\input{AlgebraMacros}
\usepackage{layouts}
\usepackage{bera,arev}
\begin{document}
\tableofcontents
\mainmatter % Capítulos
%

 \include{M6/cap1-m6}

%

\end{document}
AlgebraMacros.tex::::::::::
%::::::::::::::::::::::::::

Code: Select all

\usepackage[spanish, es-noshorthands]{babel}
\spanishdecimal{.}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx}
\usepackage[table]{xcolor}
\usepackage{textcomp}
% \usepackage{mathenv} %errors: to much & in eqnarray environments
\usepackage{amsmath}
\usepackage{amssymb,amsfonts,amsthm}
\usepackage{latexsym,exscale,cancel}% in three differents comands 
\newtheorem{thm}{Proposición}[chapter]
\newtheorem{cor}{Consecuencia}[thm]
\newtheorem{lem}[thm]{Lema}
\theoremstyle{remark}
\newtheorem{rem}{\textbf{Nota}}
\theoremstyle{definition}
\newtheorem{defin}{Definición}
\newtheorem{example}{Ejemplo}[chapter]
\newtheorem{definition}{Definición}
\newtheorem{exercise}{Ejercicio}

\newcounter{countej}%[\thechapter]

%many environments and commands

\sloppy
\usepackage{longtable}
\usepackage[breaklinks=true,bookmarks=true,...,pagebackref=true]{hyperref}
Last edited by cgnieder on Fri Dec 28, 2012 12:39 pm, edited 3 times in total.

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

\align counter not working

Post by Stefan Kottwitz »

Perhaps post a real compilable example, which we can test to verify and to fix the problem. I tried your code snippets, build an example with it, but it shows numbers! So the problem is hidden somewhere else.
numbering.png
numbering.png (4.52 KiB) Viewed 3802 times
Stefan
LaTeX.org admin
J0mL-C
Posts: 4
Joined: Wed Dec 12, 2012 4:32 pm

\align counter not working

Post by J0mL-C »

Thanks, Stefan_K for you quickly (schnell) answer

This noon have I also trayed that way and also obtained your result.

But when all the chapters are "on", the problem arises,
I tried putting together all archives in a single one...(that is time consuming with latexstudio) with the same wrong behaviour.

When trying to avoid \align, with equation or eqnarray, the problem is another: for example: in section I-2.6.4., the numeration of formulae are (1-1a) and so; while later in section I-2.7.3. it returns to (I.0a).

Here is the first chapter and the corresponding source you

Das ist Modulo6.tex

Code: Select all

\documentclass[11pt]{book}
\usepackage[a4paper,twoside,margin=2.5cm,bindingoffset=1cm]{geometry}
\newcommand{\mititulo}{Espacios Vectoriales}
a lot, lot code
Last edited by J0mL-C on Thu Dec 27, 2012 9:21 am, edited 2 times in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

\align counter not working

Post by Stefan Kottwitz »

Wow, more than 1400 lines in the post, with the code. Did you try to make a smaller version to to reproduce the problem? Think of readers, and of the other people which google because of the same problem and arrive here.

I prefer firstly supporting you in making a good test case instead of fighting with huge amounts of code - and doing the same in the next case of a problem.

So let us know if something doesn't work in the process of making a Infominimal working example, see also minimalbeispiel.de for explanation about why and how.

Stefan
LaTeX.org admin
J0mL-C
Posts: 4
Joined: Wed Dec 12, 2012 4:32 pm

\align counter not working

Post by J0mL-C »

Hello,
finally I could isolate the error. Time ago I did not know how suppress section numbering, and I added the command \nonumber after the section.

Here is the almost minimal code which causes the error. To remove it simply remove the ugly command

Code: Select all

\documentclass[11pt]{book}
\usepackage{amsmath}
\begin{document}
\frontmatter
\begin{titlepage}
  This is the titlepage
\end{titlepage}
\chapter*{Prologo}
  This is the prologue.
\section*{titleSec1}\nonumber
That is the error
\mainmatter
\chapter{First chapter}  
blah blah
\begin{align}
 here &= not\: numbered\label{E:001}
\end{align}

blah blah
\begin{align}
and &= not\: numbered\label{E:002}
\end{align}
Remove the \texttt{\textbackslash nonumber} command in line 10 to see \eqref{E:001} and \eqref{E:002} correctly
\end{document}
I'm sorry for the previous (long) post.
Last edited by cgnieder on Fri Dec 28, 2012 12:40 pm, edited 1 time in total.
Post Reply