Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XeLaTeX: Package grffile Adds Second Part of Filename to PDF #7

Closed
sanssecours opened this issue Aug 19, 2017 · 15 comments
Closed

XeLaTeX: Package grffile Adds Second Part of Filename to PDF #7

sanssecours opened this issue Aug 19, 2017 · 15 comments

Comments

@sanssecours
Copy link

👋 Hi,

thank you for providing this useful bundle!

Recently I discovered thatgrffile does not work correctly anymore, if a XeLaTeX document includes graphic files with spaces in their name. For example, if I translate the following file:

% !TEX TS-program = xelatex

\documentclass{article}
\usepackage{grffile}

\begin{document}
  \includegraphics{Filename With Spaces}
\end{document}

, then the resulting PDF includes the text With Spaces.bb. The file below shows what I mean. If you need any additional information, then please comment below. Thank you.

XeLaTeX.pdf

@davidcarlisle
Copy link
Member

davidcarlisle commented Aug 19, 2017 via email

@PeteCrighton
Copy link

It does indeed work flawlessly, I just tested it with a book that includes about 30 PDF files.
Thank you very much, you just saved my book release next week! :-)

@smalakys
Copy link

I am still experiencing the same problem in January of 2018. Are there any updates regarding this issue?

@davidcarlisle
Copy link
Member

@smalakys sorry no public update yet, does the fix in the earlier comment work for you?

@smalakys
Copy link

@davidcarlisle The fix works perfectly! Sorry for not mentioning it.

@davidcarlisle
Copy link
Member

sorry about the delay but the issue is raised on grffile but I think I want to fix it in the latex core (that is make IfFileExists by default work with filenames with spaces. But any change to the latex format has "compatibility issues" so rushing isn't a good idea (and other issues meant I had no tex time at the end of last year)

@hannesdorn
Copy link

Sorry, your fix does not work any more.
Miktex 2.9.6753-x64 on Windows

@rauschma
Copy link

rauschma commented Jul 31, 2018

My problem is similar to @hannesdorn’s: I’m seeing the .bb text since I upgraded to XeTeX 3.14159265-2.6-0.99999 (TeX Live 2018, Mac).

My LaTeX code is:

\includepdf{file with \string~ and spaces.pdf}

Before the upgrade, everything worked without a hitch. Since the upgrade, not even your fix helps.

I tried wrapping the whole argument in double quotes, I tried escaping the space via \space and several other things. Alas, to no avail. Any help is much appreciated.

@u-fischer
Copy link

The casing in the command names is wrong in the patch above, it should be xetex not XeTeX (it looks as if some automatic markup interfered, the XeTeX are in bold and are links).

\documentclass{article}
\usepackage{grffile}
\makeatletter
\def\Gread@@xetex#1{%
  \IfFileExists{"\Gin@base".bb}%
    {\Gread@eps{\Gin@base.bb}}%
    {\Gread@@xetex@aux#1}%
}
\makeatother


\begin{document}
 \includegraphics{test space}
 
\end{document}

@uwezi
Copy link

uwezi commented Oct 7, 2019

grffile.sty (Package: grffile 2017/06/30 v1.18) as installed with the latest MikTeX version does still not work.

Files are not included into the XeLaTeX generated pdf files. In the log-file weird tripple-quotation marks appear in the filenames:
File: D:/Uppsala/projects/courses/Bilder/electronics/digital/"""74ls181_chip".j pg Graphic file (type bmp) <D:/Uppsala/projects/courses/Bilder/electronics/digital/"""74ls181_chip".jpg> [4

@u-fischer
Copy link

@uwezi could you please show a complete example that demonstrates how you are trying to include the file?

@uwezi
Copy link

uwezi commented Oct 11, 2019

@uwezi could you please show a complete example that demonstrates how you are trying to include the file?

@u-fischer well, Ulrike, nothing special, It is just included using a
\includegraphics[width=0.5\textwidth]{74ls181_chip}

The file is actually located in a separate directory, which is included into the path using
\graphicspath{{D:/Uppsala/projects/courses/Bilder/electronics/digital/}}
together with a bunch of other directories.

Just excluding grffile.sty completely fixes the problem, but as long as it is included the file will not be included and no warning or error will be created.

Windows 10, latest MikTeX-bundle.

@uhlajs
Copy link

uhlajs commented Nov 20, 2019

Same for Arch Linux.

\documentclass{article}
    \usepackage{adjustbox} % Used to constrain images to a maximum size
    \usepackage{grffile} % extends the file name processing of package graphics 
                         % to support a larger range
\begin{document}

\begin{center}
  \adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{./report_files/report_4_0.png}
\end{center}
\end{document}

Log:

This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Arch Linux) (preloaded format=xelatex 2019.11.20)  20 NOV 2019 16:15
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**report.tex
(./report.tex
LaTeX2e <2019-10-01> patch level 1
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/08/27 v1.4j Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2019/08/27 v1.4j Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texmf-dist/tex/latex/adjustbox/adjustbox.sty
Package: adjustbox 2019/01/04 v1.2 Adjusting TeX boxes (trim, clip, ...)

(/usr/share/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

(/usr/share/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texmf-dist/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks14
\XKV@tempa@toks=\toks15

(/usr/share/texmf-dist/tex/generic/xkeyval/keyval.tex))
\XKV@depth=\count88
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
(/usr/share/texmf-dist/tex/latex/adjustbox/adjcalc.sty
Package: adjcalc 2012/05/16 v1.1 Provides advanced setlength with multiple back
-ends (calc, etex, pgfmath)
)
(/usr/share/texmf-dist/tex/latex/adjustbox/trimclip.sty
Package: trimclip 2018/04/08 v1.1 Trim and clip general TeX material

(/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)

(/usr/share/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2019/10/08 v1.3c Standard LaTeX Graphics (DPC,SPQR)

(/usr/share/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(/usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: xetex.def on input line 105.

(/usr/share/texmf-dist/tex/latex/graphics-def/xetex.def
File: xetex.def 2017/06/24 v5.0h Graphics/color driver for xetex
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
(/usr/share/texmf-dist/tex/latex/collectbox/collectbox.sty
Package: collectbox 2012/05/17 v0.4b Collect macro arguments as boxes
\collectedbox=\box27
)
\tc@llx=\dimen105
\tc@lly=\dimen106
\tc@urx=\dimen107
\tc@ury=\dimen108
Package trimclip Info: Using driver 'tc-xetex.def'.

(/usr/share/texmf-dist/tex/latex/adjustbox/tc-xetex.def
File: tc-xetex.def 2019/01/04 v2.2 Clipping driver for xetex
))
\adjbox@Width=\dimen109
\adjbox@Height=\dimen110
\adjbox@Depth=\dimen111
\adjbox@Totalheight=\dimen112
\adjbox@pwidth=\dimen113
\adjbox@pheight=\dimen114
\adjbox@pdepth=\dimen115
\adjbox@ptotalheight=\dimen116

(/usr/share/texmf-dist/tex/latex/ifoddpage/ifoddpage.sty
Package: ifoddpage 2016/04/23 v1.1 Conditionals for odd/even page detection
\c@checkoddpage=\count89
)
(/usr/share/texmf-dist/tex/latex/varwidth/varwidth.sty
Package: varwidth 2009/03/30 ver 0.92;  Variable-width minipages
\@vwid@box=\box28
\sift@deathcycles=\count90
\@vwid@loff=\dimen117
\@vwid@roff=\dimen118
))
(/usr/share/texmf-dist/tex/latex/oberdiek/grffile.sty
Package: grffile 2017/06/30 v1.18 Extended file name support for graphics (HO)

(/usr/share/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2018/09/07 v3.3 Provides the ifpdf switch
)
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)
(/usr/share/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

(/usr/share/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)
(/usr/share/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)

(/usr/share/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
(/usr/share/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

(/usr/share/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
))))
(/usr/share/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2019/07/25 v0.30 Utility functions of pdfTeX for LuaTeX (HO
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: pdfTeX >= 1.30 not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode not found.
)
Package grffile Info: Option `multidot' is set to `true'.
Package grffile Info: Option `extendedchars' is set to `false'.
Package grffile Info: Option `space' is set to `true'.
Package grffile Info: \Gin@ii of package `graphicx' fixed on input line 494.
) (./report.aux)
\openout1 = `report.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 11.
LaTeX Font Info:    ... okay on input line 11.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 11.
LaTeX Font Info:    ... okay on input line 11.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 11.
LaTeX Font Info:    ... okay on input line 11.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 11.
LaTeX Font Info:    ... okay on input line 11.
LaTeX Font Info:    Checking defaults for TU/lmr/m/n on input line 11.
LaTeX Font Info:    ... okay on input line 11.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 11.
LaTeX Font Info:    ... okay on input line 11.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 11.
LaTeX Font Info:    ... okay on input line 11.
File: "./report_files/""report_4_0".png Graphic file (type bmp)
<"./report_files/""report_4_0".png>

[1

] (./report.aux) ) 
Here is how much of TeX's memory you used:
 2120 strings out of 492483
 32386 string characters out of 6134978
 99314 words of memory out of 5000000
 6596 multiletter control sequences out of 15000+600000
 3648 words of font info for 15 fonts, out of 8000000 for 9000
 1348 hyphenation exceptions out of 8191
 43i,4n,36p,338b,262s stack positions out of 5000i,500n,10000p,200000b,80000s

Output written on report.pdf (1 page).

@davidcarlisle
Copy link
Member

@uhlajs


usr/share/texmf-dist/tex/latex/oberdiek/grffile.sty
Package: grffile 2017/06/30 v1.18 Extended file name support for graphics (HO

That is the old version, not the version distributed from this repository (the new version does nothing)

@davidcarlisle davidcarlisle transferred this issue from ho-tex/oberdiek Nov 20, 2019
@davidcarlisle
Copy link
Member

The current version of grffile does nothing other than include the standard graphicx package, so closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants