Is there a way to set a figure label based on the basename of the eps file used?
\begin{figure}
\centering
\includegraphics[width=.8\textwidth]{figures/MYFIGNAMEXXX.eps}
\caption{my caption}
\label{fig:MYFIGNAMEXXX}
\end{figure}
This pattern repeats itself at least 15 to 20 times in my document, so what is a convenient way to program/compile this support in? Probably just a touch beyond my Latex competence.
Edit: @texenthusiast referred to a useful snippet of code by @MMM: https://tex.stackexchange.com/a/116843/15717
This answer generally captures what I want so far. From the looks of this code, how can I take this code snippet to only consider the basename (no folder name or eps extension)?
Edit 2: @Fran provided an excellent answer https://tex.stackexchange.com/a/123511/33383 so far!
figure's file name as label
see MMM's answer to global relabeling of all figures – texenthusiast Jul 10 '13 at 23:19pdflatex
and therefore my images are not.eps
, but propably you can omit safely the extension. That work at least with.png
,.jpg
or.pdf
images. – Fran Jul 10 '13 at 23:47