[Tex/LaTex] Equation number syntax: [Section] . [Subsection] . [Subsubsection] – [EquationNumber]

equationsnumbering

I would like to use section numbers within equation reference counters.
This typically requires \numberwithin from the amsmath package.

I would like to change the section number depth of these references mid-document.
This instead requires the \counterwithin commands from the chngcntr package.

Problem:

I would like to change the syntax of the \counterwithin counter output, such that the symbol past the deepest section depth is a hyphen rather than a period:

  • Actual: [Section] . [Subsection] . [Subsubsection] . [EquationNumber]
  • Desired: [Section] . [Subsection] . [Subsubsection] – [EquationNumber]

Important Note:
It is intended that the section depth of the equation numbering scheme changes accordingly with the depth of the level. Thus, I plan to have something like:

  • Equation 1.1-1
  • Equation 1.2-1
  • Equation 1.3.1-1
  • Equation 1.4-1
  • Equation 2-1
  • Equation 3.1-1

Checking the documentation:

The chngcntr package documentation is pretty weak.

The amsmath documentation [pg.9] states that simply renewing the counter code:

\renewcommand{\theequation}{\thesection–\arabic{equation}}

creates problems by not resetting. Additionally, this code is not a catch all, as section depth changes throughout the document, making a catch-all type of command much more difficult.

MWE Description:

In the code, the code within the user-created command \equationNumbering does not seem to have an easy method to remove the . after \thesubsubsection (or whichever section is deepest) and add a hyphen in its place.

MWE, Updated with Local Answer from Hupfen and Answer from Werner from Here:

\documentclass{scrartcl}

\usepackage{geometry}                   % margin/page layout settings
\usepackage{scrlayer-scrpage}           % improved header commands. [supercedes `fancyhdr' package].

\usepackage{mathtools}                  % includes amsmath, supplements it.
\usepackage{chngcntr}                   % allows changing equation section depth mid-document
\usepackage{etoolbox}


% Margin Settings:
\KOMAoptions{fontsize   = 12pt    ,
             parskip    = half-   ,
             headheight = 1.000em , 
             footheight = 2.700em , 
             DIV        = current }

\geometry{letterpaper              ,
          hmargin      = 0.750in   ,
          tmargin      = 0.750in   ,
          bmargin      = 0.750in   ,
          headsep      = 1.000em   ,
          footskip     = 3.700em   } % [ = Footheight + Footsep]


%Initialize headers and footers
\chead{\normalfont Header 1 \\ Header 2}
\cfoot{\normalfont Footer 1 \\ Footer 2}
\ofoot{\normalfont Page \thepage}


% Section numbering: Format \paragraph like \subsection
\newcommand{   \subsubsubsection} [1] {    \paragraph{#1} }
\newcommand{\subsubsubsubsection} [1] { \subparagraph{#1} }

\setcounter{secnumdepth}{5}

\makeatletter
\renewcommand{\paragraph}               %
  {\@startsection{paragraph}{4}{\z@}    %
  {-2.5ex\@plus -1ex \@minus -.25ex}    %
  {1.25ex \@plus .25ex}                 %
  {\normalfont\sffamily\normalsize\bfseries}     }

\renewcommand{\subparagraph}               %
  {\@startsection{subparagraph}{4}{\z@}    %
  {-2.5ex\@plus -1ex \@minus -.25ex}    %
  {1.25ex \@plus .25ex}                 %
  {\normalfont\sffamily\normalsize\bfseries}     }

\makeatother




\let\origtheequation\theequation

% Equation Numbering
\counterwithin*{equation}{section}       % Reset equation at \section
\counterwithin*{equation}{subsection}    % Reset equation at \subsection
\counterwithin*{equation}{subsubsection} % Reset equation at \subsubsection
\counterwithin*{equation}{paragraph}     % Reset equation at \paragraph
\counterwithin*{equation}{subparagraph}  % Reset equation at \subparagraph

\newcommand{\xequationFormat} {\determineSection-\arabic{equation}}
\newcommand{\determineSection}{
  \ifnum\value{subsection}    > 0
  \ifnum\value{subsubsection} > 0
  \ifnum\value{paragraph}     > 0
  \ifnum\value{subparagraph}  > 0 \thesubparagraph
  \else                           \theparagraph      \fi
  \else                           \thesubsubsection  \fi
  \else                           \thesubsection     \fi
  \else                           \thesection        \fi
}




\begin{document}

\setcounter{section}{-1}
\let\theequation\origtheequation

\section{Level 1}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsection{Level 2}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{Level 3}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{Level 4}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subparagraph{Level 5}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\let\theequation\xequationFormat

\section{Level 1}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsection{Level 2}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{Level 3}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{Level 4}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subparagraph{Level 5}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\section{Level 1}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsection{Level 2}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{Level 3}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{Level 4}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subparagraph{Level 5}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\end{document}

Original MWE:

\documentclass{scrartcl}

\usepackage{geometry}                   % margin/page layout settings
\usepackage{scrlayer-scrpage}           % improved header commands. [supercedes `fancyhdr' package].

\usepackage{mathtools}                  % includes amsmath, supplements it.
\usepackage{chngcntr}                   % allows changing equation section depth mid-document


% Margin Settings:
\newlength{\xhmargin   } \setlength{\xhmargin   }{0.750in}
\newlength{\xtmargin   } \setlength{\xtmargin   }{0.750in}
\newlength{\xbmargin   } \setlength{\xbmargin   }{0.750in}
\newlength{\xheadheight} \setlength{\xheadheight}{2.700em}
\newlength{\xheadsep   } \setlength{\xheadsep   }{1.000em}
\newlength{\xfootheight} \setlength{\xfootheight}{2.700em}
\newlength{\xfootskip  } \setlength{\xfootskip  }{3.700em} % [ = Footheight + Footsep]

\KOMAoptions{fontsize   = 12pt         ,
             parskip    = half-        ,
             headheight = \xheadheight , 
             footheight = \xfootheight , 
             DIV        = current      }

\geometry{letterpaper                ,
          hmargin      = \xhmargin   ,
          tmargin      = \xtmargin   ,
          bmargin      = \xbmargin   ,
          headsep      = \xheadsep   ,
          footskip     = \xfootskip  }

%Initialize headers and footers
\chead{\normalfont Header 1 \\ Header 2}
\cfoot{\normalfont Footer 1 \\ Footer 2}
\ofoot{\normalfont Page \thepage}


\counterwithin{equation}{section}
\newcommand{\equationNumbering} [2] { \counterwithout{equation}{#1}\counterwithin{equation}{#2} }
% syntax: \equationNumbering{oldSectionDepth}{newSectionDepth}


% Section numbering: Section depth
\setcounter{secnumdepth}{5}

% Section numbering: Format \paragraph like \subsection
\newcommand{\subsubsubsection}    [1] {    \paragraph{#1} }

\makeatletter
\renewcommand{\paragraph}               %
  {\@startsection{paragraph}{4}{\z@}    %
  {-2.5ex\@plus -1ex \@minus -.25ex}    %
  {1.25ex \@plus .25ex}                 %
  {\normalfont\sffamily\normalsize\bfseries}     }
\makeatother




\begin{document}

\section{Item I}

\equationNumbering{section}{subsubsection}

\clearpage

\subsection{A}
\subsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsection{B}
\subsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\equationNumbering{subsubsection}{section}


\clearpage




\section{Item II}

\equationNumbering{section}{paragraph}

\clearpage

\subsection{Item IIa}

\clearpage

\subsubsection{A}
\subsubsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsubsection{B}
\subsubsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsubsection{C}
\subsubsubsection{x}
\subsubsubsection{y}
\subsubsubsection{z}

\clearpage

\subsection{Item IIb}

\clearpage

\subsubsection{A}
\subsubsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsubsection{B}
\subsubsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsubsection{C}
\subsubsubsection{x}
\subsubsubsection{y}
\subsubsubsection{z}

\equationNumbering{paragraph}{section}




\clearpage




\section{Item IV}

\equationNumbering{section}{subsection}

\clearpage

\subsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\end{document}

Best Answer

I've redefined the \theequation with some query about the value of the counters:

 \renewcommand{\theequation}{%
      \ifnum\value{subsection} > 0
      \ifnum\value{subsubsection} > 0
      \thesubsubsection-\arabic{equation}
      \else
      \thesubsection-\arabic{equation}
      \fi
      \else 
      \thesection-\arabic{equation}
      \fi
    }

I changed the resetting of the equation counter to subsubsection.

This won't work if a \subsubsection appears without \subsection before.

Here is the full code

\documentclass{scrartcl}

\usepackage{geometry}                   % margin/page layout settings
\usepackage{scrlayer-scrpage}           % improved header commands. [supercedes `fancyhdr' package].

\usepackage{mathtools}                  % includes amsmath, supplements it.
\usepackage{chngcntr}                   % allows changing equation section depth mid-document


% Margin Settings:
\newlength{\xhmargin   } \setlength{\xhmargin   }{0.750in}
\newlength{\xtmargin   } \setlength{\xtmargin   }{0.750in}
\newlength{\xbmargin   } \setlength{\xbmargin   }{0.750in}
\newlength{\xheadheight} \setlength{\xheadheight}{2.700em}
\newlength{\xheadsep   } \setlength{\xheadsep   }{1.000em}
\newlength{\xfootheight} \setlength{\xfootheight}{2.700em}
\newlength{\xfootskip  } \setlength{\xfootskip  }{3.700em} % [ = Footheight + Footsep]

\KOMAoptions{fontsize   = 12pt         ,
             pars

    kip    = half-        ,
                 headheight = \xheadheight , 
                 footheight = \xfootheight , 
                 DIV        = current      }

    \geometry{letterpaper                ,
              hmargin      = \xhmargin   ,
              tmargin      = \xtmargin   ,
              bmargin      = \xbmargin   ,
              headsep      = \xheadsep   ,
              footskip     = \xfootskip  }

    %Initialize headers and footers
    \chead{\normalfont Header 1 \\ Header 2}
    \cfoot{\normalfont Footer 1 \\ Footer 2}
    \ofoot{\normalfont Page \thepage}


    \counterwithin{equation}{subsubsection}  % Reset with \subsubsection

    \let\origtheequation\theequation

    %
    \renewcommand{\theequation}{%
      \ifnum\value{subsection} > 0
      \ifnum\value{subsubsection} > 0
      \thesubsubsection-\arabic{equation}
      \else
      \thesubsection-\arabic{equation}
      \fi
      \else 
      \thesection-\arabic{equation}
      \fi
    }


    % Section numbering: Table of contents and section depth
    \setcounter{secnumdepth}{5}

    % Section numbering: Format \paragraph like \subsection
    \newcommand{\subsubsubsection}    [1] {    \paragraph{#1} }

    \makeatletter
    \renewcommand{\paragraph}               %
      {\@startsection{paragraph}{4}{\z@}    %
      {-2.5ex\@plus -1ex \@minus -.25ex}    %
      {1.25ex \@plus .25ex}                 %
      {\normalfont\sffamily\normalsize\bfseries}     }
    \makeatother





    \begin{document}

    \section{Item I}

    \begin{equation}
    x
    \end{equation}

    \begin{equation}
    x
    \end{equation}

    \subsection{First sub}
    \begin{equation}
    x \label{first}
    \end{equation}



    \clearpage

    \subsection{A}
    \subsubsection{x}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsection{y}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsection{z}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}

    \clearpage

    \subsection{B}
    \subsubsection{x}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsection{y}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsection{z}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}



    \clearpage




    \section{Item II}


    \clearpage

    \subsection{Item IIa}

    \clearpage

    \subsubsection{A}
    \subsubsubsection{x}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsubsection{y}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsubsection{z}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}

    \clearpage

    \subsubsection{B}
    \subsubsubsection{x}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsubsection{y}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsubsection{z}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}

    \clearpage

    \subsubsection{C}
    \subsubsubsection{x}
    \subsubsubsection{y}
    \subsubsubsection{z}

    \clearpage

    \subsection{Item IIb}

    \clearpage

    \subsubsection{A}
    \subsubsubsection{x}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsubsection{y}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsubsection{z}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}

    \clearpage

    \subsubsection{B}
    \subsubsubsection{x}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsubsection{y}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsubsubsection{z}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}

    \clearpage

    \subsubsection{C}
    \subsubsubsection{x}
    \subsubsubsection{y}
    \subsubsubsection{z}

    \clearpage




    \section{Item IV}


    \clearpage

    \subsection{x}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsection{y}
    \begin{equation} x \end{equation}
    \begin{equation} x \end{equation}
    \subsection{z}
    \begin{equation} x \end{equation}
    \begin{equation} x

 \end{equation}

\end{document}

Edit: New version

The following code uses a toggle and a command \toggleformat to switch between the both formats, i.e. the standard as \origtheequation provides and the user defined, hidden in a wrapper command named \myequationformat.

The resetting is switched back to standard section level too.

\let\origtheequation\theequation


\newcommand{\formatsubstitute}[1]{%
  \csname the#1\endcsname-\arabic{equation}%
}

\newtoggle{enableFormat}

\newcommand{\myequationformat}{%
  \ifnum\value{subsection} > 0
  \ifnum\value{subsubsection} > 0
  \ifnum\value{paragraph} > 0
  \ifnum\value{subparagraph} > 0
  \formatsubstitute{subparagraph}
  \else % it's paragraph
  \formatsubstitute{paragraph}
  \fi
  \else % it's subsubsection
  \textbf{\formatsubstitute{subsubsection}}
  \fi
  \else % it's subsection
  \formatsubstitute{subsection}
  \fi
  \else % it's section
  \textbf{\formatsubstitute{section}}
  \fi
}

\newcommand{\toggleformat}{%
  \iftoggle{enableFormat}{%
    \counterwithin{equation}{section}  % Reset with \subparagraph
    \let\theequation\origtheequation%
    \togglefalse{enableFormat}%
  }{%
    \counterwithin{equation}{subparagraph}  % Reset with \subparagraph
    \let\theequation\myequationformat%
    \toggletrue{enableFormat}%
  }%
}

Here's a rather lengthy testing code:

\documentclass{scrartcl}

\usepackage{geometry}                   % margin/page layout settings
\usepackage{scrlayer-scrpage}           % improved header commands. [supercedes `fancyhdr' package].

\usepackage{mathtools}                  % includes amsmath, supplements it.
\usepackage{chngcntr}                   % allows changing equation section depth mid-document
\usepackage{etoolbox}


% Margin Settings:
\newlength{\xhmargin   } \setlength{\xhmargin   }{0.750in}
\newlength{\xtmargin   } \setlength{\xtmargin   }{0.750in}
\newlength{\xbmargin   } \setlength{\xbmargin   }{0.750in}
\newlength{\xheadheight} \setlength{\xheadheight}{2.700em}
\newlength{\xheadsep   } \setlength{\xheadsep   }{1.000em}
\newlength{\xfootheight} \setlength{\xfootheight}{2.700em}
\newlength{\xfootskip  } \setlength{\xfootskip  }{3.700em} % [ = Footheight + Footsep]

\KOMAoptions{fontsize   = 12pt         ,
             parskip    = half-        ,
             headheight = \xheadheight , 
             footheight = \xfootheight , 
             DIV        = current      }

\geometry{letterpaper                ,
          hmargin      = \xhmargin   ,
          tmargin      = \xtmargin   ,
          bmargin      = \xbmargin   ,
          headsep      = \xheadsep   ,
          footskip     = \xfootskip  }

%Initialize headers and footers
\chead{\normalfont Header 1 \\ Header 2}
\cfoot{\normalfont Footer 1 \\ Footer 2}
\ofoot{\normalfont Page \thepage}



\let\origtheequation\theequation


\newcommand{\formatsubstitute}[1]{%
  \csname the#1\endcsname-\arabic{equation}%
}

\newtoggle{enableFormat}

\newcommand{\myequationformat}{%
  \ifnum\value{subsection} > 0
  \ifnum\value{subsubsection} > 0
  \ifnum\value{paragraph} > 0
  \ifnum\value{subparagraph} > 0
  \formatsubstitute{subparagraph}
  \else % it's paragraph
  \formatsubstitute{paragraph}
  \fi
  \else % it's subsubsection
  \textbf{\formatsubstitute{subsubsection}}
  \fi
  \else % it's subsection
  \formatsubstitute{subsection}
  \fi
  \else % it's section
  \textbf{\formatsubstitute{section}}
  \fi
}

\newcommand{\toggleformat}{%
  \iftoggle{enableFormat}{%
    \counterwithin{equation}{section}  % Reset with \subparagraph
    \let\theequation\origtheequation%
    \togglefalse{enableFormat}%
  }{%
    \counterwithin{equation}{subparagraph}  % Reset with \subparagraph
    \let\theequation\myequationformat%
    \toggletrue{enableFormat}%
  }%
}


% Section numbering: Table of contents and section depth
\setcounter{secnumdepth}{5}

% Section numbering: Format \paragraph like \subsection
\newcommand{\subsubsubsection}    [1] {    \paragraph{#1} }

\makeatletter
\renewcommand{\paragraph}               %
  {\@startsection{paragraph}{4}{\z@}    %
  {-2.5ex\@plus -1ex \@minus -.25ex}    %
  {1.25ex \@plus .25ex}                 %
  {\normalfont\sffamily\normalsize\bfseries}     }
\makeatother





\begin{document}

\section{Item 0}

\begin{equation}
x
\end{equation}

\begin{equation}
x
\end{equation}

\subsection{First sub}
\begin{equation}
x \label{first}
\end{equation}


\subsubsection{First subsub}


\begin{equation}
x \label{second}
\end{equation}


\subsubsubsection{First paragraph}


\begin{equation}
x \label{third}
\end{equation}

\subparagraph{First subparagraph}


\begin{equation}
x \label{fourth}
\end{equation}



\toggleformat

\section{Item I}


\begin{equation}
x
\end{equation}

\begin{equation}
x
\end{equation}

\subsection{First sub}
\begin{equation}
\end{equation}


\subsubsection{First subsub}


\begin{equation}
x
\end{equation}


\subsubsubsection{First paragraph}


\begin{equation}
x 
\end{equation}

\subparagraph{First subparagraph}


\begin{equation}
x
\end{equation}



\clearpage

\subsection{A}
\subsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsection{B}
\subsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}



\clearpage




\section{Item II}

\begin{equation}
x \label{fifth}
\end{equation}


\clearpage

\subsection{Item IIa}

\clearpage

\subsubsection{A}
\subsubsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsubsection{B}
\subsubsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsubsection{C}
\subsubsubsection{x}
\subsubsubsection{y}
\subsubsubsection{z}

\clearpage

\subsection{Item IIb}

\clearpage

\subsubsection{A}
\subsubsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsubsection{B}
\subsubsubsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsubsubsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\clearpage

\subsubsection{C}
\subsubsubsection{x}
\subsubsubsection{y}
\subsubsubsection{z}

\clearpage


\toggleformat

\section{Item IV}


\clearpage

\subsection{x}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsection{y}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}
\subsection{z}
\begin{equation} x \end{equation}
\begin{equation} x \end{equation}

\end{document}
Related Question