Package atessera.templ
Class PresentationTemplate
java.lang.Object
atessera.templ.PresentationTemplate
Velocity template for generating LaTeX Beamer source of a presentation.
This class populates the presentation.vm template with
metadata (title, authors, date) and slide frames, producing a compilable
LaTeX Beamer document.
Typical usage:
PresentationTemplate t = new PresentationTemplate(factory);
t.setHeader(presentationContent);
t.setFrames(frames);
List<String> latexSource = t.renderToStringList();
- See Also:
-
BasePresentationContent
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents a single frame (slide) within a presentation. -
Constructor Summary
ConstructorsConstructorDescriptionPresentationTemplate(EngineFactory engineFactory) Constructs a new presentation template. -
Method Summary
Modifier and TypeMethodDescriptionvoidMerges the context into the template and writes the result to the given writer.Renders the template and returns the result split into lines.voidsetFrames(List<PresentationTemplate.Frame> frames) Sets the frames (slides) of the presentation.voidSets the presentation metadata from aPresentationContentobject.
-
Constructor Details
-
PresentationTemplate
Constructs a new presentation template.- Parameters:
engineFactory- the factory for obtaining a Velocity engine; must not benull- Throws:
org.apache.velocity.exception.ResourceNotFoundException- ifpresentation.vmcannot be loaded
-
-
Method Details
-
setHeader
Sets the presentation metadata from aPresentationContentobject.Populates template variables:
TITLE,AUTHORS,DATE, andFOOTLINE.- Parameters:
c- the presentation metadata; must not benull
-
setFrames
Sets the frames (slides) of the presentation.- Parameters:
frames- the list of frames; must not benull
-
render
Merges the context into the template and writes the result to the given writer.- Parameters:
wr- the writer to receive the rendered output; must not benull
-
renderToStringList
Renders the template and returns the result split into lines.- Returns:
- the rendered output as a list of lines (trailing empty lines are preserved)
-