Here's the framework for an answer, based on @Ignasi's suggestion. Documentation for the combine
package (http://tug.ctan.org/tex-archive/macros/latex/contrib/combine/combine.pdf) will help you play with formatting, make the toc work, even generate an index and a table of figures.
The student gets two files, preamble.tex
(read only if possible) and template.tex
. She fills in the template, compiles it and submits it with a new name along with her image files (you have to establish the naming conventions).
The preamble:
% preamble.tex
% provided to students, read only
\documentclass[12pt,notitlepage]{article}
\usepackage{graphicx}
\newcommand{\theschool}{to be renewed}
\newcommand{\school}[1]{%
\renewcommand{\theschool}{#1}
}
\newcommand{\theteacher}{to be renewed}
\newcommand{\teacher}[1]{%
\renewcommand{\theteacher}{#1}
}
% hack the \date field of \maketitle
\date{School: \theschool{} -- Teacher: \theteacher{}}
\newcommand{\myfigure}[2]{%
\centering
\includegraphics[height=3cm]{#1}\\
Caption: #2
}
\begin{document}
\newcommand{\alldone}{\end{document}}
template.tex
, saved as plato.tex
:
% template for students to fill in
%
\input{preamble}
\author{Plato}
\title{The Republic}
\school{Athens}
\teacher{Socrates}
\maketitle
\begin{abstract}
\emph{The Republic} in one short paragraph \ldots
\end{abstract}
% first argument is image (.jpg, .png, .pdf)
% second argument is figure caption
\myfigure{therepublic}{Image from wikipedia}
\alldone
Compiles to
The wrapper is putittogether.tex
, in the directory with student submissions and an empty preamble.tex
. I compiled and tested it with a second saved template - code not included here.
% putittogether.tex
\documentclass[12pt]{combine}
% macros from the preamble seen by the students
\usepackage{graphicx}
\newcommand{\theschool}{to be renewed}
\newcommand{\school}[1]{%
\renewcommand{\theschool}{#1}
}
\newcommand{\theteacher}{to be renewed}
\newcommand{\teacher}[1]{%
\renewcommand{\theteacher}{#1}
}
\newcommand{\hackdate}{%
\date{School: \theschool{} -- Teacher: \theteacher{}}
}
\newcommand{\myfigure}[2]{%
\centering
\includegraphics[height=3cm]{#1}\\
Caption: #2
}
% The \date must be renewed between \imports
\newcommand{\goget}[1]{%
\hackdate{}\import{#1}
}
\newcommand{\alldone}{} % do nothing
% Combine package configuration
\title{All Together Now}
\author{many authors}
\date{\today}
\begin{document}
\pagestyle{combine} % use the combine page style
\maketitle % main title
\tableofcontents % main ToC
\clearpage
% The files to glue together - all in this directory,
% along with all graphics files required.
%
% Generate this list with a script, then \include it here.
\goget{plato}
\goget{vonneumann}
\end{document}
Best Answer
You might be interested in the TeX Showcase http://www.tug.org/texshowcase/.