2

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}
  • You seem to be interested in \renewcommand{\theequation}{\thesubsubsecton-\arabic{equation}}. Why would that be a problem? The only problem I foresee is when you have a \section or \subsection with an equation in it. – Werner Sep 2 '15 at 15:26
  • @Werner : According to the amsmath documentation: The equation counter won’t be reset to zero at the beginning of a new section or chapter, unless you do it yourself using \setcounter. – kando Sep 2 '15 at 15:30
  • Yes, so you do have equations in the higher level sections? – Werner Sep 2 '15 at 15:31
  • @kando: \counterwithin{equation}{subsubsection} would do the resetting. And you must switch back to the original equation format after your special formatting – user31729 Sep 2 '15 at 15:31
  • 1
    @kando: I think, you should edit your question -- making clear the 1.1-1 etc. format. On first thought I think you have to keep track of the current sectioning depth – user31729 Sep 2 '15 at 15:43
3

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}
  • What should be done in the instance in which a higher level section is missing? – kando Sep 2 '15 at 15:54
  • Can you extend the if statement through the level of subparagraph? – kando Sep 2 '15 at 15:55
  • @kando: Short answer: Don't omit a higher level section ;-) – user31729 Sep 2 '15 at 15:55
  • You may have to reset the equation counter at the higher levels as well, not only at \subsubsection. – Werner Sep 2 '15 at 16:26
  • @Werner: I am aware of this, but where should I reset the counter? What's the condition? I am not really convinced of this numbering scheme at all. I wouldn't use it personally. – user31729 Sep 2 '15 at 16:31

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.