nmfs-opensci / quarto_titlepages

A Quarto extension for making title and cover pages for PDF output.
https://nmfs-opensci.github.io/quarto_titlepages/
Creative Commons Zero v1.0 Universal
115 stars 20 forks source link

How to add last modified date to Title page #46

Closed donert closed 10 months ago

donert commented 10 months ago

I want to use " date: last-modified " to place the date on the title page, like I can with a PDF. It doesn't work. Is there another way to achieve same goal? (a dynamically generated date)

`

title: "my title " author: "my name " date: last-modified date-format: "[Last Updated on] MMMM DD YYYY" format: titlepage-pdf: documentclass: scrbook classoption: ["oneside", "open=any"] titlepage: "bg-image"

... Rest of content

`

eeholmes-uw commented 10 months ago

Hi,

To change the elements on the title page, you use the titlepage-theme yaml: https://nmfs-opensci.github.io/quarto_titlepages/02-titlepages.html#title-page-element-customization

To add the date, you would add something like this, note the \\dateblock:

    titlepage-theme:
      elements: ["\\titleblock", "\\authorblock", "\\vfill", "\\dateblock", "\\vfil", "\\affiliationblock",  "\\logoblock", "\\footerblock"]

Here is a full yaml example:


---
title: A Sample Title - The SocioEconomic Aspects of Stock Assessments
subtitle: with non-English diacritics in the author names. See documentation.
date: last-modified
date-format: "[Last Updated on] MMMM DD YYYY"
author:
  - name: Jane Doe
    affiliations:
      - name: Minnesota Department of Natural Resources
        address: 500 Lafayette Road Saint Paul, MN 55155
      - name: University of Minnesota
        department: Department of Mathematics
bibliography: references.bib
format: 
  titlepage-pdf:
    documentclass: scrbook
    classoption: ["oneside", "open=any"]
    number-sections: true
    toc: true
    lof: true
    lot: true
    titlepage: "bg-image"
    titlepage-theme:
      elements: ["\\titleblock", "\\authorblock", "\\vfill", "\\dateblock", "\\vfil", "\\affiliationblock",  "\\logoblock", "\\footerblock"]
    titlepage-bg-image: "img/corner-bg.png"
    titlepage-logo: "img/logo.png"
    titlepage-header: "The Publisher"
    titlepage-footer: |
      NOAA Fisheries OpenSci\
      Tools for Open Science\
      [https://github.com/nmfs-opensci](https://github.com/nmfs-opensci)\
    coverpage-include-file:
      - tex/copyright.tex
    titlepage-include-file:
      - tex/dedication.tex
    coverpage: otter
    coverpage-bg-image: "img/otter-bar.jpeg"
    coverpage-title: "Otters"
    coverpage-author: ["EE", "Holmes"]
    coverpage-theme:
      title-color: "white"
      title-fontfamily: "QTDublinIrish.otf"
      title-fontsize: 100
      author-style: "plain"
      author-sep: "newline"
      author-fontstyle: "textsc"
      author-fontsize: 30
      author-align: "right"
      author-bottom: "2in"
      footer-style: "none"
      header-style: "none"
      date-style: "none"
      keep-tex: true
---
donert commented 10 months ago

Perfect. Thanks.