How nasa/nasa-latex-docs works
Main Components
• Build Automation and Document Compilation:
• Python Build Script (support/buildPDF.py) – Implements an OS-independent routine to compile any LaTeX document.
• Latexmk Configuration (support/latexmk/latexmkrc) – Provides specific configuration for running the LaTeX compilation process and error/warning detection.
• Document Templates and Examples:
• Templates Directory (support/templates) – Contains subdirectories for AIAA, standalone, and tech templates. Each has multiple .tex template files tailored for different document types.
• Sample Content/Template Details (support/templates/doc-params.tex, etc.) – Additional settings and parameters for customization.
• Document Content and Assets:
• Citations (support/citations) – Contains citation style files (aiaa.bbx, aiaa.cbx) tailored for specific formats.
• Bibliography, Figures, and Document Resources (support/document) – Holds the main .tex source file, bibliography files, figures, and sample content.
• Export and Auxiliary Assets:
• Export Directory (support/export) – Possibly contains pre-formatted exports or sample output documents (.tex and .pdf).
• Images (support/images) – Hosts logos and coversheet PDFs.
• Additional Packages and Custom LaTeX Commands:
• Packages (support/packages) – Contains custom packages and style files (e.g., mcode.sty) used by the main LaTeX documents.
• Class Files (nasa-latex-docs.cls) – The class file that defines the core formatting.
Relationships and Interactions
• The build automation (via the Python build script and Latexmk configuration) orchestrates the compilation of LaTeX documents.
• When a user creates or modifies a document (in support/document or using a template in support/templates), the build script is invoked to process the LaTeX source.
• The LaTeX compiler then pulls in the class file (nasa-latex-docs.cls), necessary packages (from support/packages), citation files (support/citations), and image assets (support/images) to produce the final output.
• Exports and conversions may be handled within the support/export directory where additional formats or further processing scripts are housed.
Architectural Patterns and Design Principles
• Modular Design: Different directories handle separate concerns – building, templating, citations, and exports are isolated. This separation enhances maintainability and clarity.
• Extensibility: With multiple templates and package definitions, the system is designed for flexibility (supporting AIAA, tech, and standalone document types).
• Automation and Integration: The use of a Python build script integrated with Latexmk ensures that building documents is automated and uniform across platforms.