8000 Improving the Typst base template to match equivalent PDF options · Issue #9956 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Improving the Typst base template to match equivalent PDF options #9956
Open
@christopherkenny

Description

@christopherkenny

Proposed Improvement:

The default template for Typst currently supports many fewer base features than the PDF template. This, of course makes sense, as Typst is much newer. Many features included in PDF templates could be added to the Typst base template without substantial amounts of code. Below, I've shortened a list from a discussion in Quarto:

Title & Author

  • thanks: To the call to #title, we could add:
#if thanks != none {
    footnote(thanks, numbering: "*")
    counter(footnote).update(n => n - 1)
}

Fonts

  • linestretch: 1 = single spaced, 2 = double spaced, and so on
set par(leading: linestretch * 0.65em)
  • mathfont:
#show math.equation: set text(font: mathfont)
  • codefont:
#show raw: set text(font: codefont)
  • linkcolor: Each color setting below require converting content to string or running a .replace("\\#", "#") on linkcolor due to pandoc's escaping
#show link: set text(fill: rgb(linkcolor))
  • filecolor, urlcolor: these have to be handled together as far as I know
#show link: this => {
    if type(this.dest) != label {
        text(this, fill: rgb(filecolor))
    }
}
  • citecolor:
#show ref: this => {
    text(this, fill: rgb(citecolor))
}
  • toccolor
#show link: this => {
    if type(this.dest) == label {
        text(this, fill: rgb(to-string(filecolor)))
    }
}

Metadata

  • keywords
#set document(keywords: keywords)
  • title-meta
#set document(title: title-meta)
  • author-meta
#set document(author: author-meta)

I'm happy to PR in any of these, if you are interested.

Alternatives:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0