Apparently llncs.cls conflicts with amsthm (proof already defined), so I'm trying to test for whether that class is loaded. The proposed code is based on the question cited within. It does check article correctly (if proof commented out), but not llncs. Any suggestion?
%\documentclass{article}
\documentclass{<path>/llncs}
\usepackage{xparse}
% https://tex.stackexchange.com/a/43568/112708
% http://texdoc.net/texmf-dist/doc/latex/base/source2e.pdf
\makeatletter
\@ifclassloaded{llncs}
{
\edef\ClassloadedisI{llncs}
}
{
\edef\ClassloadedisI{other~than~llncs}
%\usepackage{amsthm}
}
\makeatother
\ExplSyntaxOn
\seq_new:N \l_pclist_classes_seq
\seq_new:N \l_pclist_packages_seq
\seq_new:N \l_pclist_other_seq
\clist_map_inline:cn { @filelist }
{
\tl_if_in:nnTF { #1 } { .cls }
{
\tl_set:Nn \l_tmpa_tl { #1 }
\tl_remove_once:Nn \l_tmpa_tl { .cls }
\seq_put_right:NV \l_pclist_classes_seq \l_tmpa_tl
}
{
\tl_if_in:nnTF { #1 } { .sty }
{
\tl_set:Nn \l_tmpa_tl { #1 }
\tl_remove_once:Nn \l_tmpa_tl { .sty }
\seq_put_right:NV \l_pclist_packages_seq \l_tmpa_tl
}
{
\seq_put_right:Nn \l_pclist_other_seq { #1 }
}
}
}
\seq_if_in:NnTF \l_pclist_classes_seq { llncs }
{ \def\ClassloadedisII{llncs} }
{
\def\ClassloadedisII{other~than~llncs}
%\usepackage{amsthm}
}
\seq_log:N \l_pclist_classes_seq % Document Class: llncs 2018/03/10 v2.20
%\seq_show:N \l_pclist_packages_seq
%\seq_show:N \l_pclist_other_seq
\ExplSyntaxOff
\begin{document}
This document uses class
\begin{enumerate}
\item \ClassloadedisI.
\item \ClassloadedisII.
\end{enumerate}
\begin{proof}is in the pudding\end{proof}
\end{document}