I got 2 problems. 1. If the figure is converted as ``` \includegraphics{img/logo.png} ``` in a table cell, the image is two big to fill in the cell in the resulting pdf. It seems the image is not constained by the width of the table cell. 2. Now if I want to add caption for the figure and manually modify it as ``` \begin{figure} \centering \includegraphics{img/logo.png} \caption{blah blah} \end{figure} ``` It results in error during pdf generation. According to https://tex.stackexchange.com/questions/383254/placing-figures-inside-table-with-captions-for-each I wonder if it is possible for a lua filter to use subfigure when a figure is found in a table. --