summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/philex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-02-27 22:46:22 +0000
committerKarl Berry <karl@freefriends.org>2015-02-27 22:46:22 +0000
commit649af89268ea5428025f39e04734fcc8a940a91e (patch)
tree543841d27092b7868fef68aceaacd6e5826e0111 /Master/texmf-dist/tex/latex/philex
parent59ec3703e8068266ab208e8c512cc16a0105a229 (diff)
philex (27feb15)
git-svn-id: svn://tug.org/texlive/trunk@36396 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/philex')
-rw-r--r--Master/texmf-dist/tex/latex/philex/philex.sty557
1 files changed, 512 insertions, 45 deletions
diff --git a/Master/texmf-dist/tex/latex/philex/philex.sty b/Master/texmf-dist/tex/latex/philex/philex.sty
index 119369cdfa2..81f4df5b004 100644
--- a/Master/texmf-dist/tex/latex/philex/philex.sty
+++ b/Master/texmf-dist/tex/latex/philex/philex.sty
@@ -1,8 +1,8 @@
%This is a small package with additions to Wolfgang Sternefeld's linguex package (adapted to version 4.3). It provides extended functions for cross-referencing and repeating numbered and named sentences, additional formatting options and hyperref support.
%Author: Peter Pagin (with a contribution by Robin Fairbairns).
%email: peter.pagin@philosophy.su.se
-%Date: 2014.03.28
-%Version: 1.2
+%Date: 2014.08.20
+%Version: 1.3
%License type: lppl
@@ -10,22 +10,39 @@
\ProvidesPackage{philex}
-\RequirePackage{xspace,calc,cgloss4e,linguex}
+\RequirePackage{xspace,calc,cgloss4e,linguex,ifthen,suffix}
\newif\ifhyperref
\hyperreffalse
\newif\ifoldpunct
\oldpunctfalse
+\newif\ifphildraft
+\phildraftfalse
+
\DeclareOption{oldpunct}{\oldpuncttrue}
\DeclareOption{hyper}{\hyperreftrue}
+\DeclareOption{draft}{\phildrafttrue}
\ProcessOptions
\newcounter{altsub}
\newcounter{altsubsub}
\renewcommand{\thealtsub}{\subettan{altsub}}
\renewcommand{\Exroman}{\roman}
-\newcommand{\refdash}{-}
+\AtBeginDocument{\settowidth{\Exlabelwidth}{(110)}}
+\newlength{\seba}
+\newlength{\sebatemp}
+\newlength{\bpasize}
+\newlength{\bpbsize}
+\newlength{\bpcsize}
+\newlength{\bpdsize}
+
+
+\ifphildraft
+\setlength{\marginparwidth}{7em}
+\setlength{\marginparpush}{4pt}
+\newcommand{\philmarginfactor}{1.2}
+\else \fi
%Spacing and formatting commands
\setlength{\Exredux}{-\baselineskip}
@@ -36,8 +53,8 @@
\renewcommand{\philmiddle}{#1}
\renewcommand{\philsmall}{#1}}
\renewcommand{\phlabeldefault}{\renewcommand{\philarge}{3em}
-\renewcommand{\philmiddle}{3em}
-\renewcommand{\philsmall}{3em}}
+\renewcommand{\philmiddle}{2em}
+\renewcommand{\philsmall}{1em}}
\newcommand{\phlabelsep}[1]{\setlength{\Exlabelsep}{#1}}
\newcommand{\phlabelsepdefault}{\setlength{\Exlabelsep}{1.3em}}
\newcommand{\firstphildash}{}
@@ -93,7 +110,21 @@
%Top-level numbered sentence:
\newcommand{\lb}[3][n]{
-\ifdim\lastskip=\Extopsep\vspace\Exredux\else \fi
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\phlabelsepdefault
+\phlabeldefault
\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2r\endcsname{#3}\expandafter\gdef\csname#2\endcsname{\ref{#2}}
\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}}}
\expandafter\providecommand\expandafter{\csname#2r\endcsname}{#3}
@@ -106,13 +137,38 @@
\else
\ex. \label{#2} \if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}%
\parbox{\centro}{\centering #3\philpunct}\else #3\philpunct\fi\par%
-\fi}
+\fi}
+
+
%Top-level named sentence:
\newcommand{\lbp}[4][n]{
-\ifdim\lastskip=\Extopsep\vspace{\Exredux}\fi
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip\z@ \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip\z@ \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
\label{#2}
+\settowidth{\sebatemp}{#3}
+\settowidth{\seba}{\rsep{#2}}
+\ifdim \sebatemp>\seba
+\expandafter\gdef\csname #2sep\endcsname{#3}%
+\settowidth{\seba}{\rsep{#2}}%
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2sep\endcsname{#3}}}
+\else
+\fi
+\phlabelwidth{10cm}
+\ifdim \seba>2.5em \setlength{\Exlabelsep}{\seba-0.5em}%
+\else \phlabelsepdefault \fi
\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#4}\expandafter\gdef\csname#2\endcsname{#3} \expandafter\gdef\csname#2r\endcsname{#4}}}
\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#4}
\expandafter\providecommand\expandafter{\csname #2\endcsname}{#3}
@@ -129,12 +185,106 @@
\fi
}
+\WithSuffix\newcommand\lbp*{\lbpStar}
+\newcommand{\lbpStar}[4][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -100
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\label{#2}
+\phlabelsepdefault
+\settowidth{\sebatemp}{#3}
+\phlabelwidth{10cm}
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#4}\expandafter\gdef\csname#2\endcsname{#3} \expandafter\gdef\csname#2r\endcsname{#4}}}
+\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#4}
+\expandafter\providecommand\expandafter{\csname #2\endcsname}{#3}
+\expandafter\providecommand\expandafter{\csname#2r\endcsname}{#4}
+\ifhyperref
+\ex.[\hypertarget{#2}{\lebrack#3\ribrack}\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\renewcommand{\theFnExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #4\philpunct} \else \hspace{\sebatemp} \hspace{-2em} #4\philpunct\fi\par
+\else%
+\ex.[\lebrack#3\ribrack\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #4\philpunct} \else \hspace{\sebatemp} \hspace{-2em}
+#4\philpunct\fi\par
+\fi
+}
+
+%Top-level named sentence, alternative:
+\newcommand{\lbpsep}[5][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -100
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\label{#2}
+\phlabelwidth{10cm}
+\settowidth{\seba}{\rsep{#3}}
+\settowidth{\sebatemp}{#4}
+\ifdim \seba>\sebatemp
+\relax
+\else
+\expandafter\gdef\csname #3sep\endcsname{#4}%
+\settowidth{\seba}{\rsep{#3}}%
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#3sep\endcsname{#4}}}
+\fi
+\ifdim \seba>2.5em \setlength{\Exlabelsep}{\seba-0.5em}%
+\else \phlabelsepdefault\fi
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#5}\expandafter\gdef\csname#2\endcsname{#4} \expandafter\gdef\csname#2r\endcsname{#5}}}
+\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#5}
+\expandafter\providecommand\expandafter{\csname #2\endcsname}{#4}
+\expandafter\providecommand\expandafter{\csname#2r\endcsname}{#5}
+\ifhyperref
+\ex.[\hypertarget{#2}{\lebrack#4\ribrack}\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\renewcommand{\theFnExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #5\philpunct} \else #5\philpunct\fi\par
+\else%
+\ex.[\lebrack#4\ribrack\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #5\philpunct} \else #5\philpunct\fi\par
+\fi
+}
-%Stand-alone sub-level initial sentence, sequence a:
+
+%Stand-alone top-level initial sentence, sequence a:
\newcommand{\lbpa}[3][n]{
-\ifdim\lastskip=\Extopsep\vspace{\Exredux}\fi
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
\refstepcounter{bpa}\label{#2}
+\ifdim \bpasize>2.5em \setlength{\Exlabelsep}{\bpasize-0.5em}%
+\else \phlabelsepdefault\fi
\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}
\expandafter\gdef\csname#2\endcsname{\ref{#2}}
\expandafter\gdef\csname#2r\endcsname{#3}}}
@@ -153,11 +303,60 @@
\fi
}
+\WithSuffix\newcommand\lbpa*{\lbpaStar}
+\newcommand{\lbpaStar}[3][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\refstepcounter{bpa}\label{#2}
+\setlength{\Exlabelsep}{0pt}
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}
+\expandafter\gdef\csname#2\endcsname{\ref{#2}}
+\expandafter\gdef\csname#2r\endcsname{#3}}}
+\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#3}
+\expandafter\providecommand\expandafter{\csname#2\endcsname}{\ref{#2}}
+\expandafter\providecommand\expandafter{\csname#2r\endcsname}{#3}
+\ifhyperref
+\ex.[\hypertarget{#2}{\thebpa}\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\renewcommand{\theFnExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #3\philpunct} \else \hspace{\bpasize} \hspace{-2em}#3\fi\philpunct\par
+\else
+\ex.[\thebpa\hspace{-1em}]
+\renewcommand{\theSubExNo}{\csname#2\endcsname\subettan{SubExNo}}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #3\philpunct} \else \hspace{\bpasize} \hspace{-2em}#3\fi\philpunct\par
+\fi
+}
-%Stand-alone sub-level initial sentence, sequence b:
+
+%Stand-alone top-level initial sentence, sequence b:
\newcommand{\lbpb}[3][n]{
-\ifdim\lastskip=\Extopsep\vspace{\Exredux}\fi
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
\refstepcounter{bpb}\label{#2}
+\ifdim \bpbsize>2.5em \setlength{\Exlabelsep}{\bpbsize-0.5em}%
+\else \phlabelsepdefault\fi
\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}\expandafter\gdef\csname#2\endcsname{\ref{#2}} \expandafter\gdef\csname#2r\endcsname{#3}}}
\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#3}
\expandafter\providecommand\expandafter{\csname #2\endcsname}{\ref{#2}}
@@ -175,10 +374,59 @@
}
-%Stand-alone sub-level initial sentence, sequence c:
+\WithSuffix\newcommand\lbpb*{\lbpaStar}
+\newcommand{\lbpbStar}[3][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\refstepcounter{bpb}\label{#2}
+\setlength{\Exlabelsep}{0pt}
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}
+\expandafter\gdef\csname#2\endcsname{\ref{#2}}
+\expandafter\gdef\csname#2r\endcsname{#3}}}
+\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#3}
+\expandafter\providecommand\expandafter{\csname#2\endcsname}{\ref{#2}}
+\expandafter\providecommand\expandafter{\csname#2r\endcsname}{#3}
+\ifhyperref
+\ex.[\hypertarget{#2}{\thebpb}\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\renewcommand{\theFnExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #3\philpunct} \else \hspace{\bpasize} \hspace{-2em}#3\fi\philpunct\par
+\else
+\ex.[\thebpb\hspace{-1em}]
+\renewcommand{\theSubExNo}{\csname#2\endcsname\subettan{SubExNo}}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #3\philpunct} \else \hspace{\bpasize} \hspace{-2em}#3\fi\philpunct\par
+\fi
+}
+
+%Stand-alone top-level initial sentence, sequence c:
\newcommand{\lbpc}[3][n]{
-\ifdim\lastskip=\Extopsep\vspace{\Exredux}\fi
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
\refstepcounter{bpc}\label{#2}
+\ifdim \bpcsize>2.5em \setlength{\Exlabelsep}{\bpcsize-0.5em}%
+\else \phlabelsepdefault\fi
\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}\expandafter\gdef\csname#2\endcsname{\ref{#2}} \expandafter\gdef\csname#2r\endcsname{#3}}}
\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#3}
\expandafter\providecommand\expandafter{\csname #2\endcsname}{\ref{#2}}
@@ -196,14 +444,65 @@
}
+\WithSuffix\newcommand\lbpc*{\lbpaStar}
+\newcommand{\lbpcStar}[3][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\refstepcounter{bpc}\label{#2}
+\setlength{\Exlabelsep}{0pt}
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}
+\expandafter\gdef\csname#2\endcsname{\ref{#2}}
+\expandafter\gdef\csname#2r\endcsname{#3}}}
+\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#3}
+\expandafter\providecommand\expandafter{\csname#2\endcsname}{\ref{#2}}
+\expandafter\providecommand\expandafter{\csname#2r\endcsname}{#3}
+\ifhyperref
+\ex.[\hypertarget{#2}{\thebpc}\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\renewcommand{\theFnExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #3\philpunct} \else \hspace{\bpasize} \hspace{-2em}#3\fi\philpunct\par
+\else
+\ex.[\thebpc\hspace{-1em}]
+\renewcommand{\theSubExNo}{\csname#2\endcsname\subettan{SubExNo}}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #3\philpunct} \else \hspace{\bpasize} \hspace{-2em}#3\fi\philpunct\par
+\fi
+}
+
+
%Stand-alone sub-level initial sentence, sequence d:
\newcommand{\lbpd}[3][n]{
-\ifdim\lastskip=\Extopsep\vspace{\Exredux}\fi
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
\refstepcounter{bpd}\label{#2}
+\ifdim \bpdsize>2.5em \setlength{\Exlabelsep}{\bpdsize-0.5em}%
+\else \phlabelsepdefault\fi
\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}\expandafter\gdef\csname#2\endcsname{\ref{#2}} \expandafter\gdef\csname#2r\endcsname{#3}}}
\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#3}
\expandafter\providecommand\expandafter{\csname #2\endcsname}{\ref{#2}}
\expandafter\providecommand\expandafter{\csname#2r\endcsname}{#3}
+\else \fi
\ifhyperref
\ex.[\hypertarget{#2}{\thebpd}\hspace{-1em}]
\renewcommand{\theExNo}{\csname#2\endcsname}
@@ -217,9 +516,68 @@
}
+\WithSuffix\newcommand\lbpd*{\lbpdStar}
+\newcommand{\lbpdStar}[3][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\refstepcounter{bpd}\label{#2}
+\setlength{\Exlabelsep}{0pt}
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}
+\expandafter\gdef\csname#2\endcsname{\ref{#2}}
+\expandafter\gdef\csname#2r\endcsname{#3}}}
+\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#3}
+\expandafter\providecommand\expandafter{\csname#2\endcsname}{\ref{#2}}
+\expandafter\providecommand\expandafter{\csname#2r\endcsname}{#3}
+\ifhyperref
+\ex.[\hypertarget{#2}{\thebpd}\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\renewcommand{\theFnExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #3\philpunct} \else \hspace{\bpasize} \hspace{-2em}#3\fi\philpunct\par
+\else
+\ex.[\thebpd\hspace{-1em}]
+\renewcommand{\theSubExNo}{\csname#2\endcsname\subettan{SubExNo}}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #3\philpunct} \else \hspace{\bpasize} \hspace{-2em}#3\fi\philpunct\par
+\fi
+}
+
%Top-level sentence with repeated and suffixed name or number:
-\newcommand{\lbu}[5][n]{\ifdim\lastskip=\Extopsep\vspace{\Exredux}\fi
+\newcommand{\lbu}[5][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
\label{#2}
+\phlabelwidth{10cm}
+\settowidth{\sebatemp}{\rn{#3}#4}
+\settowidth{\seba}{\rsep{#2}}
+\ifdim \sebatemp>\seba
+\expandafter\gdef\csname #2sep\endcsname{\rn{#3}#4}%
+\settowidth{\seba}{\rsep{#2}}%
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2sep\endcsname{\rn{#3}#4}}}
+\else
+\fi
+\ifdim \seba>2.5em \setlength{\Exlabelsep}{\seba-1em}%
+\else \phlabelsepdefault\fi
\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#5}
\expandafter\gdef\csname #2\endcsname{\csname#3\endcsname#4}
\expandafter\gdef\csname #2r\endcsname{#5}}}
@@ -236,6 +594,93 @@
\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #5\philpunct} \else #5\philpunct\fi\par \fi
}
+\WithSuffix\newcommand\lbu*{\lbuStar}
+\newcommand{\lbuStar}[5][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\label{#2}
+\phlabelwidth{10cm}
+\phlabelsepdefault
+\settowidth{\sebatemp}{\rn{#3}#4}
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#5}
+\expandafter\gdef\csname #2\endcsname{\csname#3\endcsname#4}
+\expandafter\gdef\csname #2r\endcsname{#5}}}
+\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#5}
+\expandafter\providecommand\expandafter{\csname #2\endcsname}{\csname#3\endcsname#4}
+\expandafter\providecommand\expandafter{\csname #2r\endcsname}{#5}
+\ifhyperref
+\ex.[\lebrack\hypertarget{#2}{\csname#3\endcsname#4}\ribrack\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #5\philpunct} \else \hspace{\sebatemp} \hspace{-2em} #5\philpunct\fi\par
+\else
+\ex.[\lebrack\csname#3\endcsname#4\ribrack\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #5\philpunct} \else\hspace{\sebatemp} \hspace{-2em} #5\philpunct\fi\par \fi
+}
+
+
+%Top-level sentence with repeated and suffixed name or number, alternative for alignment:
+\newcommand{\lbusep}[6][n]{
+\ifdim\lastskip=\Extopsep\vspace{\Exredux}
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1\baselineskip}}\fi
+\else
+\ifphildraft
+\label{#2knut}
+ \vskip 0pt \penalty -400
+\label{#2ulla}
+\ifthenelse{\pageref{#2knut}=\pageref{#2ulla}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\raisebox{-1.6\baselineskip}{\bf #2}}}}{\marginpar{\hspace{-\philmarginfactor\textwidth}{\bf #2}}\vspace{-1.6\baselineskip}}\fi
+\fi
+\label{#2}
+\phlabelwidth{10cm}
+\settowidth{\seba}{\rsep{#5}}
+\settowidth{\sebatemp}{\rn{#3}#4}
+\ifdim \seba>\sebatemp
+\relax
+\else
+\expandafter\gdef\csname #5sep\endcsname{\rn{#3}#4}%
+\settowidth{\seba}{\rsep{#5}}%
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#5sep\endcsname{\rn{#3}#4}}}
+\fi
+\ifdim \seba>2.5em \setlength{\Exlabelsep}{\seba-1em}%
+\else \phlabelsepdefault\fi
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#6}
+\expandafter\gdef\csname #2\endcsname{\csname#3\endcsname#4}
+\expandafter\gdef\csname #2r\endcsname{#6}}}
+\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#6}
+\expandafter\providecommand\expandafter{\csname #2\endcsname}{\csname#3\endcsname#4}
+\expandafter\providecommand\expandafter{\csname #2r\endcsname}{#6}
+\ifhyperref
+\ex.[\lebrack\hypertarget{#2}{\csname#3\endcsname#4}\ribrack\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #6\philpunct} \else #6\philpunct\fi\par
+\else
+\ex.[\lebrack\csname#3\endcsname#4\ribrack\hspace{-1em}]
+\renewcommand{\theExNo}{\csname#2\endcsname}
+\if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}\parbox{\centro}{\centering #6\philpunct} \else #6\philpunct\fi\par
+\fi
+}
+
+%Non-printing command for setting of label-separation for alignment:
+\newcommand{\sepset}[2]{
+\label{#1}
+\expandafter\gdef\csname #1sep\endcsname{#2}%
+\immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#1sep\endcsname{#2}}}}
+
%----------------- Sub-environments -------------------------------
\newcommand{\philsemi}{@}
@@ -264,10 +709,12 @@
\expandafter\providecommand\csname#2q\endcsname{\ref{#2q}}
\a. \label{#2}#3\philsubpunct
\else
+
\ifnum\theExDepth=1
\renewcommand{\thealtsub}{#1}
\renewcommand{\theSubExNo}{\theExNo\firstphildash#1}
\refstepcounter{SubExNo}
+
\immediate\write\@auxout{%
\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}
\expandafter\gdef\csname#2r\endcsname{#3}
@@ -304,6 +751,9 @@
\setcounter{SubSubExNo}{0}
\fi
\fi
+\ifphildraft
+\marginpar{\vspace{-0.8\baselineskip}\quad \bf #2 \hspace{-2cm}}
+\else \fi
}
@@ -331,35 +781,38 @@
\expandafter\providecommand\csname#2\endcsname{\ref{#2}}
\expandafter\providecommand\csname#2q\endcsname{\ref{#2q}}
\b. \label{#2}#3\philsubpunct
- \else \immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2p \endcsname{\MakeLowercase#3}
+ \else
+ \ifnum\theExDepth=1
+\renewcommand{\thealtsub}{#1}
+\renewcommand{\theSubExNo}{\theExNo\firstphildash#1}
+\refstepcounter{SubExNo}
+ \immediate\write\@auxout{%
+\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}
\expandafter\gdef\csname#2r\endcsname{#3}
\expandafter\gdef\csname#2\endcsname{ref{#2}}
\expandafter\global\expandafter\def\csname#2q\endcsname{#1}
}}
-\ifnum\theExDepth=1 \renewcommand{\theSubExNo}{\theExNo\firstphildash#1}
-\refstepcounter{SubExNo}
-\renewcommand{\thealtsub}{#1}
-\renewcommand{\thealtsubsub}{#1\Exroman{altsubsub}}
-\else
-\ifnum\theExDepth=2
-\renewcommand{\thealtsub}{#1}
-\renewcommand{\theSubExNo}{\theExNo\firstphildash#1}
-\refstepcounter{altsub}\label{#2q}
\else
+\ifnum\theExDepth=2
\renewcommand{\thealtsubsub}{\thealtsub\secondphildash#1}
\refstepcounter{altsubsub}\label{#2q}
\renewcommand{\theSubSubExNo}{\theSubExNo\secondphildash#1}
\refstepcounter{SubSubExNo}
-\fi\fi
-\expandafter\providecommand\csname#2p\endcsname{\MakeLowercase#3}
-\expandafter\providecommand\csname#2r\endcsname{#3}
-\expandafter\providecommand\csname#2\endcsname{\ref{#2}}
-\expandafter\providecommand\csname#2q\endcsname{\ref{#2q}}
+\immediate\write\@auxout{%
+\unexpanded{\expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}
+\expandafter\gdef\csname#2r\endcsname{#3}
+\expandafter\gdef\csname#2\endcsname{\ref{#2}}
+\expandafter\global\expandafter\def\csname#2q\endcsname{\ref{#2q}}
+}}
+\else\fi\fi
\ifhyperref
\b.[\hypertarget{#2}\lebrack#1\ribrack] \label{#2}#3\philsubpunct
\else
\b.[\lebrack#1\ribrack] \label{#2}#3\philsubpunct \fi
-\fi}
+\fi
+\ifphildraft
+\marginpar{\vspace{-0.5\baselineskip}\quad \bf #2}
+\else \fi}
\newcommand{\lbz}[3][@]{\philempty
\def\tempa{#1}
@@ -422,6 +875,9 @@
\else
\b.[\lebrack#1\ribrack] \label{#2}#3\philsubpunct \fi
\fi
+\ifphildraft
+\marginpar{\vspace{-0.5\baselineskip}\quad \bf #2}
+\else \fi
\end{list}\addtocounter{ExDepth}{-1}\philsubempty}
@@ -493,6 +949,9 @@
%Repeating the sentence with name or number and bracket control:
\newcommand{\rfp}[1]{\ex.[\lebrack\csname#1\endcsname\ribrack\hspace{-1em}] \csname #1r\endcsname\par}
+%Cross-reference for control of label-separation
+\newcommand{\rsep}[1]{\csname#1sep\endcsname}
+
%Controlling numbering, prefix and suffix for SubExNo
\newcommand{\subformat}[3]{\if#1a \renewcommand{\subettan}{\alph} \else
\if#1A \renewcommand{\subettan}{\Alph} \else \if#11 \renewcommand{\subettan}{\arabic} \else \if#1r \renewcommand{\subettan}{\roman} \else \if#1R \renewcommand{\subettan}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\SubExLBr}{#2}
@@ -505,24 +964,32 @@
%Ditto for stand-alone sequences, a-d:
\newcommand{\bota}{\alph}
-\newcommand{\bpaformat}[3]{\setcounter{bpa}{0}%
-\if#1a \else
-\if#1A \renewcommand{\bota}{\Alph} \else \if#11 \renewcommand{\bota}{\arabic} \else \if#1r \renewcommand{\bota}{\roman} \else \if#1R \renewcommand{\bota}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\thebpa}{#2\bota{bpa}#3}}
+\newcommand{\bpaformat}[4][0]{\setcounter{bpa}{0}
+\settowidth{\sebatemp}{#399#4}
+\setlength{\bpasize}{#1em+\sebatemp}
+\if#2a \else
+\if#2A \renewcommand{\bota}{\Alph} \else \if#21 \renewcommand{\bota}{\arabic} \else \if#2r \renewcommand{\bota}{\roman} \else \if#2R \renewcommand{\bota}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\thebpa}{#3\bota{bpa}#4}}
\newcommand{\botb}{\alph}
-\newcommand{\bpbformat}[3]{\setcounter{bpb}{0}%
-\if#1a \else
-\if#1A \renewcommand{\botb}{\Alph} \else \if#11 \renewcommand{\botb}{\arabic} \else \if#1r \renewcommand{\botb}{\roman} \else \if#1R \renewcommand{\botb}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\thebpb}{#2\botb{bpb}#3}}
+\newcommand{\bpbformat}[4][0]{\setcounter{bpb}{0}
+\settowidth{\sebatemp}{#399#4}
+\setlength{\bpbsize}{#1em+\sebatemp}
+\if#2a \else
+\if#2A \renewcommand{\botb}{\Alph} \else \if#21 \renewcommand{\botb}{\arabic} \else \if#2r \renewcommand{\botb}{\roman} \else \if#2R \renewcommand{\botb}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\thebpb}{#3\botb{bpb}#4}}
\newcommand{\botc}{\alph}
-\newcommand{\bpcformat}[3]{\setcounter{bpc}{0}%
-\if#1a \else
-\if#1A \renewcommand{\botc}{\Alph} \else \if#11 \renewcommand{\botc}{\arabic} \else \if#1r \renewcommand{\botc}{\roman} \else \if#1R \renewcommand{\botc}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\thebpc}{#2\botc{bpc}#3}}
+\newcommand{\bpcformat}[4][0]{\setcounter{bpc}{0}
+\settowidth{\sebatemp}{#399#4}
+\setlength{\bpcsize}{#1em+\sebatemp}
+\if#2a \else
+\if#2A \renewcommand{\botc}{\Alph} \else \if#21 \renewcommand{\botc}{\arabic} \else \if#2r \renewcommand{\botc}{\roman} \else \if#2R \renewcommand{\botc}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\thebpc}{#3\botc{bpc}#4}}
\newcommand{\botd}{\alph}
-\newcommand{\bpdformat}[3]{\setcounter{bpd}{0}%
-\if#1a \else
-\if#1A \renewcommand{\botd}{\Alph} \else \if#11 \renewcommand{\botd}{\arabic} \else \if#1r \renewcommand{\botd}{\roman} \else \if#1R \renewcommand{\botd}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\thebpd}{#2\botd{bpd}#3}}
+\newcommand{\bpdformat}[4][0]{\setcounter{bpd}{0}
+\settowidth{\sebatemp}{#399#4}
+\setlength{\bpdsize}{#1em+\sebatemp}
+\if#2a \else
+\if#2A \renewcommand{\botd}{\Alph} \else \if#21 \renewcommand{\botd}{\arabic} \else \if#2r \renewcommand{\botd}{\roman} \else \if#2R \renewcommand{\botd}{\Roman} \else \fi \fi \fi \fi \fi \renewcommand{\thebpd}{#3\botd{bpd}#4}}
%Controlling numbering, prefix and suffix for SubSubExNo
\newcommand{\subsubformat}[3]{\if#1r \renewcommand{\Exroman}{\roman} \else