summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/x-res-04.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/x-res-04.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-04.tex99
1 files changed, 32 insertions, 67 deletions
diff --git a/Master/texmf-dist/tex/context/base/x-res-04.tex b/Master/texmf-dist/tex/context/base/x-res-04.tex
index 83998a4c42e..b5032f5503f 100644
--- a/Master/texmf-dist/tex/context/base/x-res-04.tex
+++ b/Master/texmf-dist/tex/context/base/x-res-04.tex
@@ -207,13 +207,14 @@
\globalletempty\figurefileoriginal
\globalletempty\figurefilefile
\xdef\figurefilebasepath{#1}%
- \assignfullfilename{#1}{\figurefilebase.xml}\to\filename
- \doiffileelse\filename
+ \assignfullfilename{#1}{\figurefilebase}\to\filename
+ \doiffileelse{\filename.xml}
{\doshowfigurestate{base file : \filename}%
- \processXMLfilegrouped\filename}
+ \expanded{\processXMLfilegrouped{\filename.xml}}}
\donothing
\ifx\figurefilename\empty \else
- \global\let\figurefilebase\figurefilebase
+% \global\let\figurefilebase\figurefilebase
+ \globallet\figurefilebase\filename % hm, bad omen that this is needed
\fi
\egroup
\fi}
@@ -235,69 +236,33 @@
\ifx\doshowfigurestate\undefined \let\doshowfigurestate\gobbleoneargument \fi
-\ifx\doanalyzefiguredimensionsfromfile\undefined
-
- % will become obsolete once the new core-fig is used
-
- \let\normalcalculateexternalfigure\calculateexternalfigure
-
- \def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
- {\resetfigurefilebase
- \ifx\figurebaselist\empty
- \normalcalculateexternalfigure[#1][#2][#3][#4][#5][#6]%
- \else
- \def\docommand##1%
- {\doshowfigurestate{base : check #3 in ##1}%
- \getfigurefilename{##1}{#3}%
- \ifx\figurefilename\empty\else\quitcommalist\fi}%
- \processcommacommand[\figurebaselist]\docommand
- \ifx\figurefilename\empty
- \stripspaces\from#3\to\figurefilename % to be sure
- \normalcalculateexternalfigure[#1][#2][\figurefilename][#4][#5][#6]%
- \else
- \doiffileelse{\figurefilebase.pdf}
- {\let\figurepathlist\figurefilebasepath
- \normalcalculateexternalfigure
- [#1][#2][\figurefilebase.pdf]%
- [\c!page=\figurefilepage,#4][#5][#6]}
- {\@EA\stripspaces\@EA\from\figurefilename\to\figurefilename
- \normalcalculateexternalfigure[#1][#2][\figurefilename][#4][#5][#6]}%
- \fi
- \fi}
-
-\else
-
- % todo: use different internal names, \figurebasepage and such
-
- \def\doanalyzefiguredimensionsfromfile
- {\ifcase\figurestatus \ifx\figurebaselist\empty \else
- \resetfigurefilebase
- \doshowfigurestate{base list : \figurebaselist}%
- \processcommacommand[\figurebaselist]\dodoanalyzefiguredimensionsfromfile
- \ifx\figurefilename\empty
- \doshowfigurestate{base warning : no matching name found}%
- \else
- \doiffileelse{\figurefilebase.pdf}
- {\doshowfigurestate{base file : \figurefilebase.pdf}%
- \doshowfigurestate{base page : \figurefilepage}%
- \let\figurepathlist\figurefilebasepath
- \analyzefigurefilename{\figurefilebase.pdf}\wantedfigurelabel
- \let\wantedfigurepage\figurefilepage}
- {\doshowfigurestate{base missing : \figurefilebase.pdf}}
- \fi
- \ifcase\figurestatus
- \analyzefigurefilename\expandedfigurename\wantedfigurelabel
- \fi
- \fi \fi}
-
- \def\dodoanalyzefiguredimensionsfromfile#1%
- {\doshowfigurestate{base check : \wantedfigurename\space in #1}%
- \getfigurefilename{#1}\wantedfigurename
- \ifx\figurefilename\empty\else
- \quitcommalist
- \fi}
-
-\fi
+\def\doanalyzefiguredimensionsfromfile
+ {\ifcase\figurestatus \ifx\figurebaselist\empty \else
+ \resetfigurefilebase
+ \doshowfigurestate{base list : \figurebaselist}%
+ \processcommacommand[\figurebaselist]\dodoanalyzefiguredimensionsfromfile
+ \ifx\figurefilename\empty
+ \doshowfigurestate{base warning : no matching name found}%
+ \else
+ \doiffileelse{\figurefilebase.pdf}
+ {\doshowfigurestate{base file : \figurefilebase.pdf}%
+ \doshowfigurestate{base page : \figurefilepage}%
+ \let\figurepathlist\figurefilebasepath
+ \analyzefigurefilename{\figurefilebase.pdf}\wantedfigurelabel
+ \let\wantedfigurepage\figurefilepage}
+ {\doshowfigurestate{base missing : \figurefilebase.pdf}}
+ \fi
+ \ifcase\figurestatus
+ \analyzefigurefilename\expandedfigurename\wantedfigurelabel
+ \fi
+ \fi \fi}
+
+\def\dodoanalyzefiguredimensionsfromfile#1%
+ {\doshowfigurestate{base check : \wantedfigurename\space in #1}%
+ \getfigurefilename{#1}\wantedfigurename
+ \ifx\figurefilename\empty\else
+ \quitcommalist
+ \fi}
% management