From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

\documentclass{article}
\newcommand{\sayhello}{Hello! }
\newcommand{\sayhellob}{And a Hearty Hello, to you! }
\newcommand{\saygoodbye}{Goodbye! }
\newcommand{\saygoodbyeb}{Farewell, Farewell! }
\AtBeginDocument{\sayhello}
\AtEndDocument{\saygoodbye}
\AtBeginDocument{\sayhellob}
\AtEndDocument{\saygoodbyeb}
\begin{document}
\section{Introduction}
An introductory section.
\section{Conclusion}
And a concluding section.
\end{document}