Closed koppor closed 6 years ago
Check out afterpackage
.
(Also, you shouldn't be using \<mylength>amount blah blah blah
-- use LaTeX syntax instead :smile:)
Thank you for the pointer. Maybe, you could include that in the documentation? That will help users not knowing all packages :innocent:
Some code snippets are just copy and paste from the internet... There are so many things going wrong out there.
Well, we'll have to leave the decision of what to add to the package or its documentation to @mhelvens 😄
"So many things going wrong out there" – you're telling me… It's a major problem we're trying to address as a community: see johannesbottcher/templateConfusion. Unfortunately I haven't been involved in the conversation lately (work has gotten a little crazy), but I imagine it's still going on. I'd pop into the TeX.SX chatroom and ask if you're interested in recent efforts.
Hi guys! Yes, afterpackage
could be used for this. But pkgloader
itself can be used for this as well:
\RequirePackage {pkgloader}
\usepackage[amsmath,hyperref]{ntheorem}
\begin{filecontents}{ntheorem-config.sty}
\theorempreskipamount 2ex plus1ex minus0.5ex
\theorempostskipamount 2ex plus1ex minus0.5ex
\theoremstyle{break}
\newtheorem{definition}{Definition}[section]
\end{filecontents}
\Load {ntheorem-config} always after {ntheorem}
\LoadPackagesNow
Sure, there is the downside of having to come up with a redundant file name, but this is still conceptually more elegant, because your configuration code now has its own place in the dependency graph, and will be treated as such.
Would you try this and let me know if it works? I'm not in a good position to test it myself at the moment.
That's super clever.
In our computer science template, we not only load packages, but also configure them after loading.
Example:
When directly using
\RequirePackage{pkgloader}
, these commands fail as the package does not get loaded immediatly.One possiblity is to use
\LoadPackagesNow
and issue all configurations afterwards. The drawback is that theusepackage
commands and the configurations are then split away. My goal is to keep them together.Therefore, I'd like to have a
\ExecuteAfterPackageLoaded
environment, which executes the nested commands directly after the given package is loaded.Example: