I changed the equation numbering format to avoid the 0 when I don't have subsubsection. Output ex. :
Equation (1.1.a)
instead of
Equation (1.1.0.a)
But now, when I use the \ref or the \eqref commands, they are extra spacing before the parenthesis. Output ex. :
( 1.1.a )
instead of
(1.1.a)
Do you have any solution?
Full Latex example :
\documentclass [11pt, twoside]{article}
\usepackage{amsmath}
\numberwithin{equation}{subsection}
\numberwithin{equation}{subsubsection}
\renewcommand{\theequation}{
\ifnum\value{subsubsection}=0
\thesubsection
\else
\thesubsubsection
\fi
.\alph{equation}
}
\begin{document}
\section{Section}
\subsection{Subsection}
\begin{equation}
equation = 1
\label{eq1}
\end{equation}
\subsubsection{Subsubsection}
\begin{equation}
equation = 2
\label{eq2}
\end{equation}
\subsection{Ref.}
Eqref for First equation \eqref{eq1}
Ref for Second equation (\ref{eq2})
\end{document}
Output :


