Code: Select all
%NEW MACRO TO HANDLE APPENDICES
\newcounter{appendixc}
\newcounter{subappendixc}[appendixc]
\newcounter{subsubappendixc}[subappendixc]
\renewcommand{\thesubappendixc}{\Alph{appendixc}.\arabic{subappendixc}}
\renewcommand{\thesubsubappendixc}
{\Alph{appendixc}.\arabic{subappendixc}.\arabic{subsubappendixc}}
\renewcommand{\appendix}[1] {\vspace{14pt}
\refstepcounter{appendixc}
\setcounter{section}{0}
\setcounter{figure}{0}
\setcounter{table}{0}
\setcounter{lemma}{0}
\setcounter{theorem}{0}
\setcounter{corollary}{0}
\setcounter{equation}{0}
\renewcommand{\thesection}{\Alph{appendixc}.\arabic{section}}
\renewcommand{\thefigure}{\Alph{appendixc}.\arabic{figure}}
\renewcommand{\thetable}{\Alph{appendixc}.\arabic{table}}
\renewcommand{\theappendixc}{\Alph{appendixc}}
\renewcommand{\thelemma}{\Alph{appendixc}.\arabic{lemma}}
\renewcommand{\thetheorem}{\Alph{appendixc}.\arabic{theorem}}
%\renewcommand{\thedefinition}{\Alph{appendixc}.\arabic{definition}}
\renewcommand{\thecorollary}{\Alph{appendixc}.\arabic{corollary}}
\renewcommand{\theequation}{\Alph{appendixc}.\arabic{equation}}
%\noindent{\bf Appendix \theappendixc. #1}\par\vspace{5pt}}
\noindent{\bfseries Appendix \theappendixc \quad #1}\par\vspace{5pt}}
\newcommand{\subappendix}[1] {\vspace{14pt}
\refstepcounter{subappendixc}
\noindent{\bfseries Appendix \thesubappendixc {\kern1pt \textit{ #1}}}
\par\vspace{8pt}}
\newcommand{\subsubappendix}[1] {\vspace{14pt}
\refstepcounter{subsubappendixc}
\noindent{\textrm{Appendix \thesubsubappendixc {\kern1pt \textit{#1}}}}
\par\vspace{8pt}}
Code: Select all
\@ifundefined{appendix}{}{%
\g@addto@macro\appendix{%
\@ifundefined{chapter}{%
\gdef\refstepcounter@noarg#1{%
\cref@old@refstepcounter{#1}%
\cref@constructprefix{#1}{\cref@result}%
\ifx\cref@result\@empty%
\def\cref@result{2147483647}%
\else%
\edef\cref@result{2147483647,\cref@result}%
\fi%
\def\@tempa{#1}%
\def\@tempb{section}%
\ifx\@tempa\@tempb%
\protected@edef\cref@currentlabel{%
[appendix][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\else%
\def\@tempa{#1}%
\def\@tempb{subsection}%
\ifx\@tempa\@tempb%
\protected@edef\cref@currentlabel{%
[subappendix][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\else%
\def\@tempa{#1}%
\def\@tempb{subsubsection}%
\ifx\@tempa\@tempb%
\protected@edef\cref@currentlabel{%
[subsubappendix][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\else%
\@ifundefined{cref@#1@alias}%
{\def\@tempa{#1}}%
{\def\@tempa{\csname cref@#1@alias\endcsname}}%
\protected@edef\cref@currentlabel{%
[\@tempa][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\fi%
\fi%
\fi}%
}{%
\def\refstepcounter@noarg#1{%
\cref@old@refstepcounter{#1}%
\cref@constructprefix{#1}{\cref@result}%
\ifx\cref@result\@empty%
\def\cref@result{2147483647}%
\else%
\edef\cref@result{2147483647,\cref@result}%
\fi%
\def\@tempa{#1}%
\def\@tempb{chapter}%
\ifx\@tempa\@tempb%
\protected@edef\cref@currentlabel{%
[appendix][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\else%
\def\@tempa{#1}%
\def\@tempb{section}%
\ifx\@tempa\@tempb%
\protected@edef\cref@currentlabel{%
[subappendix][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\else%
\def\@tempa{#1}%
\def\@tempb{subsection}%
\ifx\@tempa\@tempb%
\protected@edef\cref@currentlabel{%
[subsubappendix][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\else%
\def\@tempa{#1}%
\def\@tempb{subsubsection}%
\ifx\@tempa\@tempb%
\protected@edef\cref@currentlabel{%
[subsubsubappendix][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\else%
\@ifundefined{cref@#1@alias}%
{\def\@tempa{#1}}%
{\def\@tempa{\csname cref@#1@alias\endcsname}}%
\protected@edef\cref@currentlabel{%
[\@tempa][\arabic{#1}][\cref@result]%
\csname p@#1\endcsname\csname the#1\endcsname}%
\fi%
\fi%
\fi%
\fi}%
}%
}%
}% end of \@ifundefined{appendix}
Code: Select all
! Argument of \@ifundefined has an extra }.
<inserted text>
\par
l.52 \appendix
{A}
TIA