I would like to redefine a character (say .) in such a way that it does its original function and also performs another task (for example runs certain command, say \mycommand).
I wrote the following, but it does not work. How I can correct this code.
\documentclass{article}
\newcommand\mycommand{OK}
\catcode`\.=\active
\def.{.\mycommand}%
\begin{document}
Hello.
\end{document}
babeldoes). – egreg Mar 04 '20 at 13:07