1

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[colorlinks=true]{hyperref}
\hypersetup{linkcolor=black}
\usepackage{cleveref}
\usepackage{chngcntr}
\counterwithin*{equation}{section}
\counterwithin*{equation}{subsection}
\counterwithin*{equation}{subsubsection}

\newcommand{\sect}[1]{
    \section*{#1}
    \addcontentsline{toc}{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}
\begin{equation}
    \pi=3.1416 \seclabel{eq:pi1}
\end{equation}
First, this equation~\eqref{eq:pi1} is properly enumerated but not properly referenced.

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

\sect{Test 3}
\begin{equation}
    \pi=3.1416 \seclabel{eq:pi3}
\end{equation}
This other equation~\eqref{eq:pi3} is properly enumerated and referenced, however the first equation isn't.
\subsection{subsection}
\subsubsection{here inside}
\begin{equation}
    \pi=3.1416 \ssseclabel{eq:pi4}
\end{equation}
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?

3

I'm not sure, but I think you want

enter image description here

\documentclass[a4paper,dvipsnames]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage[colorlinks=true]{hyperref}
\hypersetup{linkcolor=black}
\usepackage{cleveref}
\usepackage{chngcntr}
\counterwithin*{equation}{section}
\counterwithin*{equation}{subsection}
\counterwithin*{equation}{subsubsection}

\newcommand{\sect}[1]{%%%
    \section*{#1}%%%
    \addcontentsline{toc}{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}
\begin{equation}
  \pi=3.1416 \label{eq:pi1}
\end{equation}
First, this equation~\eqref{eq:pi1} is properly enumerated but not properly referenced.

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

\sect{Test 3}
\begin{equation}
    \pi=3.1416 \label{eq:pi3}
\end{equation}
This other equation~\eqref{eq:pi3} is properly enumerated and referenced, however the first equation isn't.
\subsection{subsection}
\subsubsection{here inside}
\begin{equation}
    \pi=3.1416 \label{eq:pi4}
\end{equation}
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
  • 1
    @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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