I have a custom section frame defined for my presentations. I'd like to load an image with the name of the section title. Problem is that LaTeX usually fails to load image if their names contain spaces. So I'm looking for a solution to replace the spaces (and by chance other special chars too) when passing \insertsection as parameter to \includegraphics.
here is a (not) working minimal example:
\documentclass{beamer}
\usetheme{default}
\usepackage{inputenc}
\setbeamertemplate{section page}{{
\begin{frame}{\insertsectionhead}
\begin{columns}
\begin{column}{0.65\textwidth}
this should load an image with name
\texttt{some-section-with-spaces.png}
in the on the right of this text (if that exists...)
\end{column}
\begin{column}{0.45\textwidth}%
\includegraphics[width=0.7\linewidth]{%
%% how to replace spaces with minus or underscore here
\insertsection%
}
\end{column}
\end{columns}
\end{frame}
}}
\AtBeginSection{
\sectionpage
}
\begin{document}
\section{some section with spaces in name}
\end{document}
shortsectioninstead to define an alternative title with spaces replaced. – samcarter_is_at_topanswers.xyz Oct 27 '18 at 17:38\usetheme{default}, as the name says, this theme is loaded per default – samcarter_is_at_topanswers.xyz Oct 27 '18 at 17:40{grffile}package is my way to go (not only because of this special case....) So please make an answer from your comment so that I can accept it. – Timothy Truckle Oct 28 '18 at 08:20