[latex3-commits] [git/LaTeX3-latex3-latex3] master: Support listing of image files (4ec35c6)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed May 8 12:02:56 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/4ec35c69c16bcb97d4e396629c3d74be0ef56d18

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

commit 4ec35c69c16bcb97d4e396629c3d74be0ef56d18
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed May 8 11:02:56 2019 +0100

    Support listing of image files
    
    Do we want this to go into the general file list?


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

4ec35c69c16bcb97d4e396629c3d74be0ef56d18
 l3experimental/l3image/l3image.dtx |   45 ++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/l3experimental/l3image/l3image.dtx b/l3experimental/l3image/l3image.dtx
index aa4a1e9..10635e9 100644
--- a/l3experimental/l3image/l3image.dtx
+++ b/l3experimental/l3image/l3image.dtx
@@ -182,6 +182,18 @@
 %   variable content. Spaces need not be quoted.
 % \end{variable}
 %
+% \begin{function}{\image_show_list:, \image_log_list:}
+%   \begin{syntax}
+%     \cs{image_show_list:}
+%     \cs{image_log_list:}
+%   \end{syntax}
+%   These functions list all image files loaded by in a similar manner to
+%   \cs{file_show_list:} and \cs{file_log_list:}. While
+%   \cs{image_show_list:} displays the list in the terminal,
+%   \cs{image_log_list:} outputs it to the log file only. In both cases, only
+%   images loaded by \pkg{l3image} are listed.
+% \end{function}
+%
 % \end{documentation}
 %
 % \begin{implementation}
@@ -458,6 +470,13 @@
 %    \end{macrocode}
 % \end{variable}
 %
+% \begin{variable}{\g_@@_record_seq}
+%   A list of image files used.
+%    \begin{macrocode}
+\seq_new:N \g_@@_record_seq
+%    \end{macrocode}
+% \end{variable}
+%
 % \begin{macro}{\image_include:n, \image_include:nn}
 % \begin{macro}{\@@_include:n}
 %   Actually including an image is relatively straight-forward: most of the
@@ -494,6 +513,14 @@
       {
         \exp_args:NnV \use:c { driver_image_getbb_ #1 :n }
           \l_@@_name_tl
+%<*initex>
+        \seq_gput_right:NV \g_@@_record_seq \l_@@_name_tl
+%</initex>
+%<*package>
+        \clist_if_exist:NTF \@filelist
+          { \exp_args:NV \@addtofilelist \l_@@_name_tl }
+          { \seq_gput_right:NV \g_@@_record_seq \l_@@_name_tl }
+%</package>
         \hbox_set:Nn \l_@@_internal_box
           {
             \exp_args:NnV \use:c { driver_image_include_ #1 :n }
@@ -508,6 +535,24 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\image_show_list:, \image_log_list:, \@@_list:N}
+% \begin{macro}[EXP]{\@@_list_aux:n}
+%   A function to list all image files used.
+%    \begin{macrocode}
+\cs_new_protected:Npn \image_show_list: { \@@_list:N \msg_show:nnxxxx }
+\cs_new_protected:Npn \image_log_list: { \@@_list:N \msg_log:nnxxxx }
+\cs_new_protected:Npn \@@_list:N #1
+  {
+    \seq_remove_duplicates:N \g_@@_record_seq
+    #1 { LaTeX/kernel } { file-list }
+      { \seq_map_function:NN \g_@@_record_seq \@@_list_aux:n }
+        { } { } { }
+  }
+\cs_new:Npn \@@_list_aux:n #1 { \iow_newline: #1 }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \subsection{Messages}
 %
 %    \begin{macrocode}





More information about the latex3-commits mailing list