Here is an attempt to define an extra level for linguex
. It seems to work but there may be unintended side effects, so test carefully.
The idea is to define an extra counter which is bound to (i.e., resets with) the lowest level linguex
counter SubSubExNo
. With a newly defined command the linguex
command \a.
can be combined with printing (in uppercase alphabetic letters) and increasing this new counter. The spacing is adjusted a bit with \hskip
to position the label. Another new command is defined analogous to \b.
.
The label for cross-referencing is set by redefining \@currentlabel
, as described in https://tex.stackexchange.com/a/292890/. Here the cross-reference is composed of the four level counters Exno
, SubExNo
, SubSubExNo
and the new counter SubSubSubExNo
.
Code:
\documentclass{article}
\usepackage{linguex}
\newcounter{SubSubSubExNo}[SubSubExNo]
\setcounter{SubSubSubExNo}{0}
\makeatletter
\newcommand{\lfourlabel}{%
\@bsphack%
\csname phantomsection\endcsname % in case hyperref is used
\def\@currentlabel{(\arabic{ExNo}-\alph{SubExNo}-\roman{SubSubExNo}-\Alph{SubSubSubExNo})}%
\@esphack%
}
\makeatother
\newcommand{\lvlfoura}{%
\a. \hskip -1em\stepcounter{SubSubSubExNo}\Alph{SubSubSubExNo}.\lfourlabel\hskip 1em%
}
\newcommand{\lvlfourb}{%
\b. \hskip -1em\stepcounter{SubSubSubExNo}\Alph{SubSubSubExNo}.\lfourlabel\hskip 1em%
}
\begin{document}
\ex. Level one.\label{l1}
\a. Level 2.\label{l2}
\a. Level 3.\label{l3}
\lvlfoura Level 4\label{l4}.
\lvlfourb Also level 4.
\z.
\b. Also level 3\label{l32}.
\lvlfoura Level 4.
\lvlfourb Also level 4\label{l42}.
\z.
See example \ref{l3} and \ref{l4} and higher level \ref{l32} and \ref{l42}.
\end{document}
Result:
