# Referencing equations and sections without enumerate

The question is ... I would like several things:

First I want not enumerated sections (because I'll use them as themes). Second I would like enumerate subsubsections with letters. Third I would like do cross-reference with equations even sections, subsections or subsubsections.

I've got that code,

\documentclass[8pt,a4paper,dvipsnames]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{cleveref}
\usepackage{chngcntr}
\counterwithin*{equation}{section}
\counterwithin*{equation}{subsection}
\counterwithin*{equation}{subsubsection}

\newcommand{\sect}[1]{
\section*{#1}
\stepcounter{section}
} %to enumerate sections and put them in toc even they are not enumerated%

\newcommand{\seclabel}[1] {\numberwithin{equation}{section}\label{#1}}
\newcommand{\sseclabel}[1] {\numberwithin{equation}{subsection}\label{#1}}
\renewcommand{\thesubsubsection} {\thesubsection.\alph{subsubsection}} %to enumerate subsubsections with letters%
\newcommand{\ssseclabel}[1] {\numberwithin{equation}{subsubsection}\label{#1}}

\begin{document}
\sect{Test not enumerated}
$$\pi=3.1416 \seclabel{eq:pi1}$$
First, this equation~\eqref{eq:pi1} is properly enumerated but not properly referenced.

\section{Test 2 enumerated}
$$\pi=3.1416 \seclabel{eq:pi2}$$
Equation ~\eqref{eq:pi2} is properly enumerated and referenced.

\sect{Test 3}
$$\pi=3.1416 \seclabel{eq:pi3}$$
This other equation~\eqref{eq:pi3} is properly enumerated and referenced, however the first equation isn't.
\subsection{subsection}
\subsubsection{here inside}
$$\pi=3.1416 \ssseclabel{eq:pi4}$$
Second when I do a cross-reference to equation ~\eqref{eq:pi4} I've not got the letter and right reference either.
\end{document}


But I get something like this, actually the enumerate is right, but not the references, thank so much all:

Do you know, at least, where could I find a complete manual about how format tags, labels and references?

I'm not sure, but I think you want

\documentclass[a4paper,dvipsnames]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{cleveref}
\usepackage{chngcntr}
\counterwithin*{equation}{section}
\counterwithin*{equation}{subsection}
\counterwithin*{equation}{subsubsection}

\newcommand{\sect}[1]{%%%
\section*{#1}%%%
\refstepcounter{section}%%%
} %to enumerate sections and put them in toc even they are not enumerated%

\renewcommand{\thesubsubsection} {\thesubsection.\alph{subsubsection}} %to enumerate subsubsections with letters%
\renewcommand\theequation{\ifnum\value{subsubsection}>0 \thesubsubsection\else
\ifnum\value{subsection}>0 \thesubsection\else
\thesection\fi\fi.\arabic{equation}}

\begin{document}
\sect{Test not enumerated}
$$\pi=3.1416 \label{eq:pi1}$$
First, this equation~\eqref{eq:pi1} is properly enumerated but not properly referenced.

\section{Test 2 enumerated}
$$\pi=3.1416 \label{eq:pi2}$$
Equation ~\eqref{eq:pi2} is properly enumerated and referenced.

\sect{Test 3}
$$\pi=3.1416 \label{eq:pi3}$$
This other equation~\eqref{eq:pi3} is properly enumerated and referenced, however the first equation isn't.
\subsection{subsection}
\subsubsection{here inside}
$$\pi=3.1416 \label{eq:pi4}$$
Second when I do a cross-reference to equation ~\eqref{eq:pi4} I've not got the letter and right reference either.
\end{document}

• It would be fine an explanation (or manual) about what are exactly doing these conditional commands. But thanks anyway. – JFernan Jul 5 '16 at 21:25
• @JFernan they just implement the (slightly odd) implied requirement that equations are numbered within subsubsections, or subsections or sections depending on the nearest heading level. – David Carlisle Jul 5 '16 at 21:31
• Do you know if would be possible include figures in with same numeration of equations? – JFernan Jul 11 '16 at 19:33