Skip to content

Reduce slide wrapper duplication in src/ #44

@dbosk

Description

@dbosk

Context

While implementing the review follow-ups for the add-litprog-java-factory-tutorial branch, I checked the new slide wrapper src/slides-tutorial-java.tex against the existing src/slides-intro.tex.

Observation

The two files are near-identical Beamer wrappers:

  • src/slides-intro.tex
  • src/slides-tutorial-java.tex

They currently differ only in which content file they \input:

  • slides-intro.tex inputs contents.tex
  • slides-tutorial-java.tex inputs factory.tex

Everything else in the wrapper is duplicated.

Why it matters

This is not a correctness bug today, but it creates a small maintenance trap. If the shared Beamer setup changes later, every wrapper copy has to be updated by hand. The duplication is still manageable with two files, but it becomes more awkward if another slide deck is added.

Evidence

Current file contents are both 12-line wrappers with the same structure:

  • src/slides-intro.tex
  • src/slides-tutorial-java.tex

The only material difference is the \input{...} target.

Suggested follow-up

Introduce a shared wrapper, for example _slides-wrapper.tex, and let each concrete slide target set only the content file to include.

One possible pattern is:

  • each deck-specific file defines a macro such as \def\slidecontent{contents.tex} or \def\slidecontent{factory.tex}
  • the shared wrapper performs the common Beamer setup once
  • the shared wrapper inputs \slidecontent

That would keep the per-deck files minimal while avoiding repeated boilerplate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions