From d25c2909171999d6094a1a8e5711cfe94502c943 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 8 Jun 2020 21:20:13 +0000
Subject: latex-make (8jun20)

git-svn-id: svn://tug.org/texlive/trunk@55486 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/latex-make/figlatex.sty   | 51 +++++++++-------------
 1 file changed, 20 insertions(+), 31 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/latex-make/figlatex.sty')

diff --git a/Master/texmf-dist/tex/latex/latex-make/figlatex.sty b/Master/texmf-dist/tex/latex/latex-make/figlatex.sty
index fb2326d8294..922be37af91 100644
--- a/Master/texmf-dist/tex/latex/latex-make/figlatex.sty
+++ b/Master/texmf-dist/tex/latex/latex-make/figlatex.sty
@@ -41,20 +41,12 @@
 %%
 \NeedsTeXFormat{LaTeX2e}%
 \ProvidesPackage{figlatex}%
-[2018/10/17 v2.3.0 No changes in figlatex.dtx]
-\newif\ifFL@compatibility
-\DeclareOption{compatibility}{%
-  %\PackageWarning{figlatex}{option compatibility}%
-  \global\FL@compatibilitytrue%
-}
+[2020/06/01 v2.4.0 Fix support for new latex]
 \newif\ifFL@debug
 \DeclareOption{debug}{%
   \global\FL@debugtrue%
 }
 {
-  \def\compatibility{%
-    \ExecuteOptions{compatibility}%
-  }
   \def\debug{%
     \ExecuteOptions{debug}%
   }
@@ -70,6 +62,7 @@
 \RequirePackage{ifthen}
 \RequirePackage{ifpdf}
 \RequirePackage{graphicx}
+\RequirePackage{xstring}
 \RequirePackage{color}
 \RequirePackage{epstopdf}
 \def\FL@dmessage#1{%
@@ -124,18 +117,9 @@
   \def\FL@svgext{pdftex_t}%
   \let\Gread@rawtex\Gread@pdf%
   \DeclareGraphicsRule{.pdftex}{pdf}{*}{}%
-  \ifFL@compatibility%
-    \PackageWarningNoLine{figlatex}{Compatibility mode enabled
-      for old LaTeX
-      \MessageBreak Using .pdf extension for pdftex files}%
-    \DeclareGraphicsRule{.pdftex_t}{rawtex}{.pdf}{}%
-    \DeclareGraphicsRule{.fig}{figtex}{.pdf}{}%
-    \DeclareGraphicsRule{.svg}{svgtex}{.pdf}{}%
-  \else%
-    \DeclareGraphicsRule{.pdftex_t}{rawtex}{.pdftex}{}%
-    \DeclareGraphicsRule{.fig}{figtex}{.pdftex}{}%
-    \DeclareGraphicsRule{.svg}{svgtex}{.pdftex}{}%
-  \fi%
+  \DeclareGraphicsRule{.pdftex_t}{rawtex}{.pdftex}{}%
+  \DeclareGraphicsRule{.fig}{figtex}{.pdftex}{}%
+  \DeclareGraphicsRule{.svg}{svgtex}{.pdftex}{}%
 \else
   \def\FL@figext{pstex_t}%
   \def\FL@svgext{pstex_t}%
@@ -151,22 +135,26 @@
 \def\FL@exclamation{!}%
 \let\FL@subfig@name\FL@exclamation%
 \define@key{Gin}{subfig}{%
+  \typeout{using subfig #1}%
   \def\FL@subfig@name{#1}%
 }
 \def\FL@sepdefault{_}%
 \def\FL@subfig@check#1{%
 }
 \def\FL@Gin@getbase#1{%
+  \typeout{In getbase #1 with \FL@subfig@name / \FL@exclamation}%
   \ifx\FL@subfig@name\FL@exclamation%
   \else%
-  \ifthenelse{\equal{#1}{.fig}}{%
+  \typeout{getbase lets go (\filename@area)(\filename@base)(#1)}%
+  \IfStrEq*{#1}{.fig}{%
     % If we're including a subfig
     \IfFileExists{\filename@area\filename@base#1}{%
       % If the original .fig file exists, just change the name so that
-      % it comprises the full path.
-      \filename@parse{\@filef@und}%
-      % Remove potential trailing spage at the end of the extension
-      \def\filename@ext{fig}%
+      % it comprises the full path (file has been looked into
+      % texgraphics, etc.)
+      % Warning: the found filename is quoted :-(
+      \StrBetween[1,2]{\@filef@und}{"}{"}[\FL@filename@unquoted]
+      \filename@parse{\FL@filename@unquoted}%
       % Check if the subfig file exists
       \FL@subfig@check{\filename@area\filename@base.subfig}%
     }{%
@@ -179,14 +167,15 @@
     \edef\filename@base{\filename@base\FL@sepdefault\FL@subfig@name}%
   }{%
   }%
-  \ifthenelse{\equal{#1}{.svg}}{%
+  \IfStrEq*{#1}{.svg}{%
     % If we're including a subfig
     \IfFileExists{\filename@area\filename@base#1}{%
       % If the original .svg file exists, just change the name so that
-      % it comprises the full path.
-      \filename@parse{\@filef@und}%
-      % Remove potential trailing spage at the end of the extension
-      \def\filename@ext{svg}%
+      % it comprises the full path (file has been looked into
+      % texgraphics, etc.)
+      % Warning: the found filename is quoted :-(
+      \StrBetween[1,2]{\@filef@und}{"}{"}[\FL@filename@unquoted]
+      \filename@parse{\FL@filename@unquoted}%
       % Check if the subfig file exists
       \FL@subfig@check{\filename@area\filename@base.subfig}%
     }{%
-- 
cgit v1.2.3

