6

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.

4

The filehook package gives you the options to do something at the beginning or end of each \input and \include.

For instance you could use \AtBeginEveryFile to have some arbitrary code called whenever a file is included.

| improve this answer | |
  • You should thank Martin Scharrer who wrote the package! – Seamus Jun 14 '12 at 12:21
  • True. It is so much easier to use packages that define a clear interface for a certain aspects, than having to delve into TeX internals. Thanks a lot, @MartinScharrer! – krlmlr Jun 14 '12 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.