# Concatenate string for \includegraphics

I'm trying to create a string (caseid) to which I can concatenate different string inside \includegraphics.

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htbp]
\centering
\includegraphics[width=0.45\linewidth]{varios_US/{R1_H7_T1.85_wv0__d50_B2.5__07_06_raw}.jpg}
\includegraphics[width=0.45\linewidth]{varios_US/{R1_H7_T1.85_wv0__d50_B2.5__07_07_raw}.jpg}

\includegraphics[width=0.45\linewidth]{varios_US/{R1_H7_T1.85_wv0__d50_B2.5__07_06_eaverage}.jpg}
\includegraphics[width=0.45\linewidth]{varios_US/{R1_H7_T1.85_wv0__d50_B2.5__07_07_eaverage}.jpg}

\includegraphics[width=0.45\linewidth]{varios_US/{R1_H7_T1.85_wv0__d50_B2.5__07_06_dspk}.jpg}
\includegraphics[width=0.45\linewidth]{varios_US/{R1_H7_T1.85_wv0__d50_B2.5__07_07_dspk}.jpg}

\caption{$V_w=$0}
\end{figure}

\end{document}


So I would like to define a string for "R1_H7_T1.85_wv0__d50_B2.5" and then concatenate the different endings.

I tried using \csname ... \endcsname but since the name has underscores and points, I had no luck.

Any ideas?

Thanks!

• \includegraphics[width=0.45\linewidth]{varios_US/\foo __07_06_raw.jpg} works for me with \def\foo{R1....}, but in general you should be careful with underscore in filenames – user31729 Nov 30 '17 at 11:33