I suppose there is some reason why the command \@ifpackageloaded
is not just called \ifpackageloaded
But with the @ one has some additional work:
\makeatletter
\@ifpackageloaded{geometry}
{ % i the package was loaded
\newcommand*{\qw}{\itshape} % this is enabled, else is not enabled.
}{}
\makeatother
Is it a security feature?
\IfPackageLoadedTF{<package>}{<true code>}{<false code>}without\makeatletter(it is equivalent to\@ifpackageloaded) – mbert Oct 23 '23 at 01:14\makeatletter???? – David Carlisle Oct 23 '23 at 07:43\makeatletteras@is allowed automatically. – David Carlisle Oct 23 '23 at 07:51\@ifpackageloadedin a document preamble, the document is a single entity the package is used or not, no need to test for it. this is not like package A which might need to test for package B being loaded. But your comment about@only applies to the first case that should never happen. – David Carlisle Oct 24 '23 at 12:59a.\@ifpackageloaded{beamer}{a}{b}interprets\@as one command, which is sth about spacing. Only if @ is a letter, the whole@ifpackageloadedis a single command. – user2609605 Oct 24 '23 at 13:13\makeatletterand using commands with@is as easy as using ones without. – David Carlisle Oct 24 '23 at 13:19@notifying work. It's easiest to type the@and then the first few letters and then tab complete the username. Just @david won't work, and you misspelled mine up above. – Teepeemm Oct 24 '23 at 13:42