I would like a simple script to "scrape" every image in a directory into a single beamer presentation as follows:
$ ls
%img1.jpg
%img2.jpg
%img3.jpg
$ *run script*
%OUTPUT SOMETHING LIKE THIS:
\documentclass{beamer}
% for themes, etc.
\mode<presentation>
{ \usetheme{boxes} }
\usepackage{times} % fonts are up to you
\usepackage{graphicx}
\section{Images in this Directory}
\begin{frame}
\frametitle{img1.jpg}
\begin{center}
\includegraphics[width=4in]{img1.jpg}
\end{center}
\end{frame}
\begin{frame}
\frametitle{img2.jpg}
\begin{center}
\includegraphics[width=4in]{img2.jpg}
\end{center}
\end{frame}
\begin{frame}
\frametitle{img3.jpg}
\begin{center}
\includegraphics[width=4in]{img3.jpg}
\end{center}
\end{frame}
\end{document}
Best Answer
Option 1
Here's a
perl
script that can be used in the current directory:or if you make it executable and add it to your path, then simply
You can specify the image extensions in
and turn them on and off with a
1
or0
respectivelycreateslides.plx
Option 2 (first attempt, not as good as option 1)
Here's a
perl
script to automate the task, which you can save as (for example)createslides.plx
You can call it with:
or else with the following if you have multiple extensions:
createslides.plx
It will create a file
slides.tex
- a sample output is included below: