feat(documentclass): add fallback to default \maketitle when custom files missing
Add file existence checks for frontmatter templates with graceful fallback to original \maketitle when frontmatter/maketitle.tex is not found. Includes class warnings for missing files.
This commit is contained in:
@@ -193,13 +193,26 @@
|
|||||||
|
|
||||||
|
|
||||||
% Redefine \maketitle
|
% Redefine \maketitle
|
||||||
|
% Save the original \maketitle before redefining it
|
||||||
|
\let\original@maketitle\maketitle
|
||||||
|
|
||||||
\renewcommand{\maketitle}{%
|
\renewcommand{\maketitle}{%
|
||||||
\if@primarytitle
|
\if@primarytitle
|
||||||
\input{frontmatter/maketitle}%
|
\IfFileExists{frontmatter/maketitle.tex}{%
|
||||||
|
\input{frontmatter/maketitle}%
|
||||||
|
}{%
|
||||||
|
% Fallback to original \maketitle
|
||||||
|
\ClassWarning{thesis.cls}{File frontmatter/maketitle.tex not found, using default maketitle}%
|
||||||
|
\original@maketitle
|
||||||
|
}%
|
||||||
\fi
|
\fi
|
||||||
\if@secondarytitle
|
\if@secondarytitle
|
||||||
\clearpage
|
\clearpage
|
||||||
\input{frontmatter/maketitle_secondary}%
|
\IfFileExists{frontmatter/maketitle_secondary.tex}{%
|
||||||
|
\input{frontmatter/maketitle_secondary}%
|
||||||
|
}{%
|
||||||
|
\ClassWarning{thesis.cls}{File frontmatter/maketitle_secondary.tex not found, skipping}%
|
||||||
|
}%
|
||||||
\fi
|
\fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user