Introduction
thoth
provides tools to create and manage custom Quarto
templates that maintain consistent branding and styling across your
organization’s reports. These templates can be easily created,
customized, and applied to any Quarto document.
Creating Templates
Basic Template
Create a new template with your organization’s branding:
library(thoth)
create_quarto_template(
template_name = "company_template",
primary_color = "#0054AD",
secondary_color = "#00B4E0",
font_family = "Source Sans Pro"
)
Using Templates
Applying to Reports
# Apply template to a single report
apply_template_to_report(
"reports/analysis.qmd",
"company_template"
)
# Apply to multiple reports
apply_template_to_report(
c("reports/analysis.qmd", "reports/summary.qmd"),
"company_template"
)
Customizing Templates
# Create template with custom settings
create_quarto_template(
template_name = "technical_report",
primary_color = "#2E5EAA",
secondary_color = "#30B8BE",
font_family = "JetBrains Mono",
code_font = "Fira Code",
toc_depth = 3,
code_fold = "show"
)
Best Practices
1. Design Principles
- Use consistent color schemes
- Choose readable fonts
- Maintain clear hierarchy
- Ensure accessibility
2. Organization
- Keep templates in version control
- Document customizations
- Use meaningful template names
- Share templates across team
3. Usage
# Create project with template
create_analytics_project(
"analysis",
use_quarto = TRUE,
template = "company_template"
)
# Apply template to existing report
apply_template_to_report(
"report.qmd",
"company_template",
overwrite = FALSE # Preview changes first
)
Next Steps
- Try the end-to-end example:
vignette("end-to-end-example")
- Learn about Docker setup:
vignette("docker-setup")
- Check Quarto documentation for advanced features