[latex3-commits] [git/LaTeX3-latex3-latex2e] utf8andspace: fixed the graphic file loading (needs improvements, qupting is still weird); added test file (c65a3ce)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Mar 10 09:12:39 CET 2019


Repository : https://github.com/latex3/latex2e
On branch  : utf8andspace
Link       : https://github.com/latex3/latex2e/commit/c65a3ce811061ff0d64340c79ae52694582c1275

>---------------------------------------------------------------

commit c65a3ce811061ff0d64340c79ae52694582c1275
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Tue Feb 12 16:33:47 2019 +0100

    fixed the graphic file loading (needs improvements, qupting is still weird); added test file


>---------------------------------------------------------------

c65a3ce811061ff0d64340c79ae52694582c1275
 base/utf8andspace.tex                              |   36 +++++++++++-
 .../{cat.eps => testfiles/support/foo bar.eps}     |    0
 .../graphics/testfiles/support}/foo bar.png        |  Bin 726 -> 726 bytes
 .../foo\342\202\254\342\202\254\342\202\254.eps"   |    0
 required/graphics/testfiles/utf8-filenames-001.lvt |   41 +++++++++++++
 required/graphics/testfiles/utf8-filenames-001.tlg |   62 ++++++++++++++++++++
 6 files changed, 138 insertions(+), 1 deletion(-)

diff --git a/base/utf8andspace.tex b/base/utf8andspace.tex
index c5d6cf6..ff82fd4 100644
--- a/base/utf8andspace.tex
+++ b/base/utf8andspace.tex
@@ -425,9 +425,43 @@
 
 % graphics
 
-
+% the quoting business for graphic files needs further sorting
+%  out. This should be handled different, right now we quote and
+%  unquote all over the place as we still use the old code base.
+%
+% This also makes the file name displays weird!
 
 \AtBeginDocument{%
+\def\Gread at generic@aux#1#2{%
+  \begingroup
+  \@tempcnta\z@
+  \loop\ifnum\@tempcnta<\@xxxii
+     \catcode\@tempcnta14 %
+     \advance\@tempcnta\@ne
+  \repeat
+  \catcode`\^^?14 %
+  \let\do\@makeother
+  \dospecials
+  \catcode`\ 10 %
+  \catcode`\^^I10 %
+  \catcode\endlinechar5 %
+  \@makeother\:%
+  \@makeother\-%
+%%% this is a fix as we now have already quotes so can't add more
+%%% this is certainly not the the only place where this is wrong
+%%% needs checking all driver files
+  \immediate\openin\@inputcheck#1 %    <--- now already quoted!
+  #2{#1}%
+  \ifGin at bbox
+    \expandafter\xdef\csname #1 bbox\Gread at attr@hash\endcsname{\@gtempa}%
+  \else
+    \@latex at error
+      {Cannot determine size of graphic in #1 (no BoundingBox)}%
+      \@ehc
+    \gdef\@gtempa{0 0 72 72 }%
+  \fi
+  \endgroup
+}
 \def\Gin at getbase#1{%
   \edef\Gin at tempa{%
     \def\noexpand\@tempa####1#1\space{%
diff --git a/required/graphics/cat.eps b/required/graphics/testfiles/support/foo bar.eps
similarity index 100%
copy from required/graphics/cat.eps
copy to required/graphics/testfiles/support/foo bar.eps
diff --git a/base/testfiles-filename/foo bar.png b/required/graphics/testfiles/support/foo bar.png
similarity index 100%
copy from base/testfiles-filename/foo bar.png
copy to required/graphics/testfiles/support/foo bar.png
diff --git a/required/graphics/cat.eps "b/required/graphics/testfiles/support/foo\342\202\254\342\202\254\342\202\254.eps"
similarity index 100%
copy from required/graphics/cat.eps
copy to "required/graphics/testfiles/support/foo\342\202\254\342\202\254\342\202\254.eps"
diff --git a/required/graphics/testfiles/utf8-filenames-001.lvt b/required/graphics/testfiles/utf8-filenames-001.lvt
new file mode 100644
index 0000000..fd3be9b
--- /dev/null
+++ b/required/graphics/testfiles/utf8-filenames-001.lvt
@@ -0,0 +1,41 @@
+
+\documentclass{article}
+
+\input{test2e}
+
+\START
+
+\usepackage{graphicx}
+
+
+\begin{filecontents*}{one two three}
+1 2 3
+\end{filecontents*}
+
+
+\listfiles
+
+\OMIT
+
+\begin{document}
+
+\TIMO
+
+\input{one two three}
+
+\includegraphics{foo€€€}   % file is testfiles/support
+
+\includegraphics{foo bar}   % file is testfiles/support
+
+\includegraphics{"foo bar"}   % file is testfiles/support
+
+\includegraphics[scale=2]{foo bar.eps}
+
+\includegraphics[scale=2]{"foo bar".eps}
+
+\includegraphics{foo €€€} 
+
+\end{document}
+
+
+
diff --git a/required/graphics/testfiles/utf8-filenames-001.tlg b/required/graphics/testfiles/utf8-filenames-001.tlg
new file mode 100644
index 0000000..5d0841f
--- /dev/null
+++ b/required/graphics/testfiles/utf8-filenames-001.tlg
@@ -0,0 +1,62 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+(graphicx.sty
+Package: graphicx ....-..-.. v... Enhanced LaTeX Graphics (DPC,SPQR)
+(keyval.sty
+Package: keyval ....-..-.. v... key=value parser (DPC)
+\KV at toks@=\toks...
+) (graphics.sty
+Package: graphics ....-..-.. v... Standard LaTeX Graphics (DPC,SPQR)
+(trig.sty
+Package: trig ....-..-.. v... sin cos tan (DPC)
+) (graphics.cfg
+File: graphics.cfg ....-..-.. v... sample graphics configuration
+)
+Package graphics Info: Driver file: dvips.def on input line ....
+(dvips.def
+File: dvips.def ....-..-.. v... Driver-dependent file (DPC,SPQR)
+))
+\Gin at req@height=\dimen...
+\Gin at req@width=\dimen...
+)
+LaTeX Warning: File `one two three' already exists on the system.
+               Not generating it from this source.
+(one two three.tex)
+File: "foo^^e2^^82^^ac^^e2^^82^^ac^^e2^^82^^ac".eps Graphic file (type eps)
+ <"foo^^e2^^82^^ac^^e2^^82^^ac^^e2^^82^^ac".eps>
+File: "foo bar".eps Graphic file (type eps)
+<"foo bar".eps>
+File: "foo bar".eps Graphic file (type eps)
+ <"foo bar".eps>
+File: "foo bar".eps Graphic file (type eps)
+ <"foo bar".eps>
+File: "foo bar".eps Graphic file (type eps)
+ <"foo bar".eps>
+! LaTeX Error: File `foo ^^e2^^82^^ac^^e2^^82^^ac^^e2^^82^^ac' not found.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ......{foo ^^e2^^82^^ac^^e2^^82^^ac^^e2^^82^^ac}
+I could not locate the file with any of these extensions:
+.eps,.ps,.eps.gz,.ps.gz,.eps.Z,.mps
+Try typing  <return>  to proceed.
+If that doesn't work, type  X <return>  to quit.
+[1
+] (utf8-filenames-001.aux)
+ *File List*
+ article.cls    ....-..-.. v... Standard LaTeX document class
+  size10.clo    ....-..-.. v... Standard LaTeX file (size option)
+  test2e.tex
+graphicx.sty    ....-..-.. v... Enhanced LaTeX Graphics (DPC,SPQR)
+  keyval.sty    ....-..-.. v... key=value parser (DPC)
+graphics.sty    ....-..-.. v... Standard LaTeX Graphics (DPC,SPQR)
+    trig.sty    ....-..-.. v... sin cos tan (DPC)
+graphics.cfg    ....-..-.. v... sample graphics configuration
+   dvips.def    ....-..-.. v... Driver-dependent file (DPC,SPQR)
+one two three.tex
+"foo^^e2^^82^^ac^^e2^^82^^ac^^e2^^82^^ac".eps    Graphic file (type eps)
+"foo bar".eps    Graphic file (type eps)
+"foo bar".eps    Graphic file (type eps)
+"foo bar".eps    Graphic file (type eps)
+"foo bar".eps    Graphic file (type eps)
+ ***********





More information about the latex3-commits mailing list