Is there a way to get a list of all used graphics with full pathnames? The problem is that I have set the $TEXINPUTS variable pointing to a directory containing images (which I included just using the filename), but I have also images included from the current directory and from some directories above (via ../image.png).

I tried the snapshot package but this gives me only the filenames without the complete path.


Many TeX compilers (pdfTeX, luaTeX, XeTeX) have an option -recorder, which behaves independent of the output mode (DVI, PDF). It records the input and output files in the file name <jobname>.fls.


% test.tex

Compilation: pdflatex -recorder test

Then test.fls contains the absolute path of the image (grep INPUT test.fls|sort|uniq|grep png):

INPUT /absolute-path-to/texmf-dist/tex/latex/mwe/example-image-a.png
| improve this answer | |

This will output at the end of the log file the list of included graphic files, with the full path unless the image file is called with a relative path.



  \tl_set:Nx \l_student_ig_filename_tl { #1 }
  \tl_set_from_file:Nnn \l_student_ig_filename_tl { } { "|kpsewhich~\l_student_ig_filename_tl" }
  \tl_gput_right:Nx \g_student_ig_files_tl { \l_student_ig_filename_tl ^^J }
\tl_new:N \l_student_ig_filename_tl
\tl_new:N \g_student_ig_files_tl
\tl_gset:Nn \g_student_ig_files_tl { ***~Graphic~files~*** ^^J }






I ran this with

TEXINPUTS=/usr/local/texlive/2016/texmf-dist/doc/generic/pgf/images/: pdflatex mwe

so the variable TEXINPUTS is set for the specific job; it would be the same if it is set in the environment; in that case, just pdflatex mwe would suffice.

Here's the relevant part of the log file

*** Graphic files ***

Note that the last file wouldn't be found without setting TEXINPUTS.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.