diff options
author | Karl Berry <karl@freefriends.org> | 2006-12-08 00:12:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-12-08 00:12:55 +0000 |
commit | 46b8a6fe6247a9476df0a843a54793d042ac2196 (patch) | |
tree | baf017ba6a634f9f0fa7012a5c4544a1eee062a8 /Master/texmf-dist/tex | |
parent | 7f549680dc21a5a0b6c80ce7b1252b232d8535ff (diff) |
srcltx update (7dec06)
git-svn-id: svn://tug.org/texlive/trunk@2624 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/srcltx/srcltx.sty | 52 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/srcltx/srctex.sty | 31 |
2 files changed, 58 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/srcltx/srcltx.sty b/Master/texmf-dist/tex/latex/srcltx/srcltx.sty index 9fea37aea90..a38d206c947 100644 --- a/Master/texmf-dist/tex/latex/srcltx/srcltx.sty +++ b/Master/texmf-dist/tex/latex/srcltx/srcltx.sty @@ -13,7 +13,7 @@ %% Current maintainer: Stefan Ulrich <stefanulrich@users.sourceforge.net> %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{srcltx}[2004/10/05 v1.5 Source specials for inverse search in DVI files] +\ProvidesPackage{srcltx}[2006/11/12 v1.6 Source specials for inverse search in DVI files] \newif\ifSRCOK \SRCOKtrue \newif\ifsrc@debug@ \newif\ifsrc@dviwin@ @@ -56,6 +56,10 @@ }% }{}% } +\newcommand*\srcIncludeHook[1]{\protected@xdef\CurrentInput{#1.tex}} +\newcommand*\srcInputHook[1]{% + \src@getfilename@with@ext{#1}% +} \newcommand*\src@spec{} \def\src@spec{% \ifSRCOK @@ -69,11 +73,10 @@ } \newcommand\src@before@file@hook{} \newcommand\src@after@file@hook{} -\def\src@before@file@hook#1{% - \protected@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{<-}% @@ -82,22 +85,27 @@ \gdef\CurrentInput{#1}% \src@spec } -\newcommand*\src@fname{} -\newcommand*\src@getfilename@with@ext[2]{% - \src@@getfilename@with@ext#1.\end{#2}% - \PackageInfo{srcltx}{Expanded filename `#1' to `\src@fname'}% +\newcommand*\src@fname{}% +\newcommand*\src@tempa{}% +\newcommand*\src@extensions@path{}% +\newcommand*\src@getfilename@with@ext{}% +\def\src@extensions@path#1.#2\end{% + \ifthenelse{\equal{#2}{}}{% + \protected@edef\src@extensions@last{#1}% + \let\src@tempa\relax + }{% + \def\src@tempa{\src@extensions@path#2\end}% + }% + \src@tempa } -\newcommand*\src@@getfilename@with@ext{} -\def\src@@getfilename@with@ext#1.#2\end#3{% - \ifthenelse{\equal{#2}{}}{% - \def\src@fname{#1.#3}% +\def\src@getfilename@with@ext#1{% + \expandafter\src@extensions@path#1.\end + \ifthenelse{\equal{\src@extensions@last}{tex}}{% + \protected@xdef\CurrentInput{#1}% }{% - \ifthenelse{\equal{#2}{#3.}}{% - \def\src@fname{#1.#3}% - }{% - \def\src@fname{#1.#2#3}% - }% + \protected@xdef\CurrentInput{#1.tex}% }% + \PackageInfo{srcltx}{Expanded filename `#1' to `\CurrentInput'}% } \newcommand*\src@include{} \newcommand*\src@@include{} @@ -108,7 +116,8 @@ \expandafter\src@@include\expandafter{\CurrentInput}{#1}% }% \def\src@@include#1#2{% - \src@before@file@hook{#2.tex}% + \srcIncludeHook{#2}% + \src@before@file@hook \src@include{#2}% \src@after@file@hook{#1}% } @@ -121,8 +130,8 @@ \expandafter\src@@@input\expandafter{\CurrentInput}{#1}% } \def\src@@@input#1#2{% - \src@getfilename@with@ext{#2}{tex}% this sets \src@fname - \src@before@file@hook{\src@fname}% + \srcInputHook{#2}% + \src@before@file@hook \src@input{#2}% \src@after@file@hook{#1}% } @@ -147,7 +156,8 @@ \expandafter\src@@bibliography\expandafter{\CurrentInput}{#1}% } \def\src@@bibliography#1#2{% - \src@before@file@hook{\jobname.bbl}% + \protected@xdef\CurrentInput{\jobname.bbl}% + \src@before@file@hook \src@bibliography{#2}% \src@after@file@hook{#1}% } 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}% } |