>>>>> Enrico Gregorio <
Facile.d...@in.rete.it> writes:
>>>>> Ivan Shmakov <
onei...@gmail.com> wrote:
>> BTW, is there an easy way to invoke an arbitrary TeX macro just
>> before a file is read within \include? The macro is to be called
>> with either the filename, or just the \include argument (i. e.,
>> without the .tex suffix.)
> \let\latexinclude\include
> \def\include#1{\macro{#1}\latexinclude{#1}}
There's a catch: this way, \macro will be invoked before
\clearpage (which is in turn invoked by \include before doing
\input) and thus may be unfit for my purposes. (I hope to check
it shortly.)
> You may write also \macro{#1.tex} if you need the complete file name
> (.tex is implicitly added for \include).
Actually, I'd need to strip leading directories of the filename
instead. I guess I can, e. g.:
\def \@basename #1/#2\@endbasename {%
#2}
But I'm curious, is there be a predefined LaTeX macro to do
that? (I believe there is, but it's probably undocumented.)