I insert the name and licence with the command \nameofcompany
at the end of my document like this:
\nameofcompany
\end{document}
Now, I want to generalize it to some documents, for that I found \AtEndDocument{\nameofcompany}
but it doesn't have exactly the same result than \nameofcompany \end{document}
. It seems that with \AtEndDocument
, the command is only executed after \end{document}
, while I want it to be executed before.
I also try to redefine the document
environment like this
\renewenvironment{document}%
{\begin{document}}
{%
\nameofcompany
%
\end{document}%
}
but it doesn't work either.
Is there a command like \beforTheEndDocument
?
Best Answer
is a shorthand equivalent to
Why? Look at the definition of
\enddocument
(fromlatex.ltx
):\@enddocumenthook
is the hook that is updated by\AtEndDocument
:You may consider alternative end-of-document hooks by looking into the
atveryend
package. It provides the following hooks, all of which are executed after the\AtEndDocument
hook, except the first:Refer to the definition of
\enddocument
in order to see an approximate location where the above hooks are placed.