# Hook into \input (or any underlying command) in order to allow transparent preprocessing

Which command would be most suitable to be hooked in order to preprocess input before it is passed to TeX?

Input file:

\begin{document}
\input{a}
\end{document}

Seen by TeX (after a file a_pp.tex has been created):

\begin{document}
\input{a_pp}
\end{document}

What about \include, \bibliography, or even other means of including files?

Note that the preprocessing is to be applied only to files that are interpreted/compiled by TeX directly, not to files that are read and parsed by some macro.

This is to move towards Forward-inverse search using SyncTeX with the precison of a single word.

-