I have been trying to add thumbnails as a column entry in {longtabu}.
LaTeX - Insert thumbnail with link to fullsize image contained in appendix came to the rescue.
Now, the thumbnails inserted as per the instructions in the above answer work perfectly, but the issue is that when I use the same thumbnail as a table entry, multiple duplicate images corresponding to that thumbnail get inserted in the appendix.
Would like to know a way to resolve this duplication.
Edit: MWE as asked for is here. I hope this serves the need.
\documentclass{article}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{longtable, tabu}
% set up a counter for links
\newcounter{thumbnail}
% to store the images for later
\newbox\savedimgs
\setbox\savedimgs\vbox{}
% thumbnail and appendix command
\newcommand{\thumbnailandappendix}[1]{
% #1: name of image
\refstepcounter{thumbnail}
% set up hypertarget before the thumbnail
\hypertarget{small\thethumbnail}{}
% input thumbnail version
\hyperlink{big\thethumbnail}{\includegraphics[width=1cm,height=1cm]{#1}}
% save the big version for later
\global\setbox\savedimgs\vbox{
\unvbox\savedimgs
\bigskip
\filbreak
\noindent
\hypertarget{big\thethumbnail}{}
\hyperlink{small\thethumbnail}{\includegraphics[width=10cm,height=10cm]{#1}}}
}
\begin{document}
%works fins when used normally like this:
%\thumbnailandappendix{image.jpg}
%use of thumbnail in longtable that is leading to duplicate entries in appendix
\clearpage
\section{Images}
\begin{center}
\begin{longtabu}{ | X[-1, l] |X[-1, l] |}
\caption{Images Table}\\ \hline
\hspace{0pt}FILENAME & \hspace{0pt}IMAGE REFERENCE \\ \hline \hline \endhead
image.jpg & \thumbnailandappendix{image.jpg}\\ \hline
\end{longtabu}
\end{center}
\clearpage
\appendix
\section{Full-size image}
\unvbox\savedimgs
\end{document}
}
Thanks.
P.S. I am a new member of this site and so do not have enough reputation points to directly comment on the link above and ask; and thereby I am asking this as a fresh question. Pardon me for deflecting from any rules, incase I did.
\documentclass{...}
and ending with\end{document}
.