You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if it would be ok to use safer inclusion to avoid potential conflict if this is used in a document where the is already loaded package 🤔
Using \@ifpackageloaded{pkgname}{}{\usepackage[options]{name}}
If a package needs options to be set though, there is not really a good way to avoid option conflict, unless this is loaded before documentclass with \PassOptionsToPackage{options}{pkgname}
Anyhow, I feel latex_dependency is not that much used, and if it would be it need to be safer.
Perhaps using \@ifpackageloaded{pkgname} only when opts == ''? That means, if users don't need any options, we can guarantee that the package will be loaded without conflicts. If they do, we just respect the options, which may or may not lead to conflicts.
Activity
yihui commentedon Mar 13, 2024
Perhaps using
\@ifpackageloaded{pkgname}only whenopts == ''? That means, if users don't need any options, we can guarantee that the package will be loaded without conflicts. If they do, we just respect the options, which may or may not lead to conflicts.cderv commentedon Mar 13, 2024
Yes definitely -
\@ifpackageloaded{pkgname}should be only used ifopts == ''. I like that. thanks !