I am trying to make a command that will take a list of labels and use psfrag
to hide them. in my figure X3 is removed but X1, X2 and X7 are still there.
Is there something special i need to do to use the foreach \thing
counter in the \HideLabel
command
\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage{pgffor}
\usepackage{psfrag}
\usepackage{graphicx}
\usepackage[runs=2,crop=off]{auto-pst-pdf}
\newcommand{\HideLabel}[1]{\foreach \thing in {#1} {%
\psfrag{\thing}{}}
}
\begin{document}
\begin{figure}[ht!]
\centering
\HideLabel{X1,X2,X7}
\psfrag{X3}{}
\includegraphics[scale=1]{Figure}
\caption{Figure caption}
\label{Figure1}
\end{figure}
\end{document}