Class PresentationTemplate

java.lang.Object
atessera.templ.PresentationTemplate

public final class PresentationTemplate extends Object
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:
  • Constructor Details

    • PresentationTemplate

      public PresentationTemplate(EngineFactory engineFactory)
      Constructs a new presentation template.
      Parameters:
      engineFactory - the factory for obtaining a Velocity engine; must not be null
      Throws:
      org.apache.velocity.exception.ResourceNotFoundException - if presentation.vm cannot be loaded
  • Method Details

    • setHeader

      public void setHeader(PresentationContent c)
      Sets the presentation metadata from a PresentationContent object.

      Populates template variables: TITLE, AUTHORS, DATE, and FOOTLINE.

      Parameters:
      c - the presentation metadata; must not be null
    • setFrames

      public void setFrames(List<PresentationTemplate.Frame> frames)
      Sets the frames (slides) of the presentation.
      Parameters:
      frames - the list of frames; must not be null
    • render

      public void render(Writer wr)
      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 be null
    • renderToStringList

      public List<String> 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)