6

I am already using grffile to ensure that all files are found on the file system (windows 7), but now I have an example where the second file is not found.

\documentclass[]{scrbook} % 
\usepackage[%
   extendedchars, encoding, multidot, space,
   filenameencoding=latin1, % Windows XP, Vista, 7
]{grffile}
\RequirePackage{pdfpages}
\begin{document}
\includepdf{fonts/fontsample - Latin Modern Family.pdf}
\includepdf{fonts/fontsample - Charter, Bera Sans, Luxi Mono.pdf}
\end{document}

The error is

LaTeX Error: File `fonts/fontsample - Charter' not found.

How can I ensure that a comma is a valid char for a filename in \includepdf ?

lockstep
  • 250,273
  • 1
    The grffile package might help. But IMNSHO it's better to avoid filenames like these with TeX. – Martin Schröder Jan 29 '13 at 18:54
  • Do you really need commas in the filenames ? It's really a coz' I can choice. It might cause more trouble even after you figure this one out. – percusse Jan 29 '13 at 18:55
  • No i do not. The file names are generated by script that creates these files. But I would be interested in a solution if there is a simple one. – Matthias Pospiech Jan 29 '13 at 18:56
  • 1
    The \includepdf command executes internally \AM@readlist that gets as argument a comma separated list; it's probably done for avoiding code duplication with \includepdfmerge, but has the effect of not accepting file names with commas. – egreg Jan 29 '13 at 22:48
  • 2
    Try \includepdf{{...}}, i.e., protect the filename in quotes. – Aditya Jan 30 '13 at 06:17
  • @Aditya Unfortunately, on unix, it ends up looking for a file name including the braces. – Andrew Swann Feb 06 '13 at 11:30
  • maybe it's easier to modify the part of the script that creates these names? – Mario S. E. Apr 10 '13 at 00:30

1 Answers1

4

The grffile package might help. But IMNSHO it's better to avoid filenames like these with TeX.

If you really need such file name you can use:

\includepdf{\string"fonts/fontsample - Charter, Bera Sans, Luxi Mono.pdf"}
Marco Daniel
  • 95,681