diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/srcltx/srctex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/srcltx/srctex.sty | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/srcltx/srctex.sty b/Master/texmf-dist/tex/latex/srcltx/srctex.sty index aeb603238c1..8edc5a0f0d7 100644 --- a/Master/texmf-dist/tex/latex/srcltx/srctex.sty +++ b/Master/texmf-dist/tex/latex/srcltx/srctex.sty @@ -45,6 +45,10 @@ }% \fi } +\def\srcIncludeHook#1{\xdef\CurrentInput{#1.tex}} +\def\srcInputHook#1{% + \src@getfilename@with@ext{#1}% +} \def\src@spec{% \ifSRCOK \ifnum\inputlineno>\src@lastline @@ -55,11 +59,10 @@ \fi \fi } -\def\src@before@file@hook#1{% - \xdef\CurrentInput{#1}% +\def\src@before@file@hook{% \WinEdt{<+ \CurrentInput}% \global\src@lastline=0 - \ifSRCOK\special{src:1\CurrentInput}\fi + \ifSRCOK\special{src:1\src@maybe@space\CurrentInput}\fi } \def\src@after@file@hook#1{% \WinEdt{<-}% @@ -68,12 +71,32 @@ \gdef\CurrentInput{#1}% \src@spec } +\def\src@tempa{}% +\def\src@extensions@path#1.#2\end{% + \ifx\\#2\\ + \edef\src@extensions@last{#1}% + \let\src@tempa\relax + \else + \def\src@tempa{\src@extensions@path#2\end}% + \fi + \src@tempa +} +\def\src@getfilename@with@ext#1{% + \expandafter\src@extensions@path#1.\end + \def\src@tempa{tex}% + \ifx\src@extensions@last\src@tempa + \xdef\CurrentInput{#1}% + \else + \xdef\CurrentInput{#1.tex}% + \fi +} \let\src@input\input \def\Input#1{% \expandafter\src@Input\expandafter{\CurrentInput}{#1}% } \def\src@Input#1#2{% - \src@before@file@hook{#2}% + \srcInputHook{#2}% + \src@before@file@hook \src@input #2 \src@after@file@hook{#1}% } |