GithubHelp home page GithubHelp logo

mikaeljagelid / typstdoc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elipousson/typstdoc

0.0 0.0 0.0 463 KB

An extended version of the standard Quarto typst template.

License: Creative Commons Zero v1.0 Universal

Typst 100.00%

typstdoc's Introduction

typstdoc Format

Installing typstdoc

quarto use template elipousson/typstdoc

This will install the format extension and create an example qmd file that you can use as a starting place for your document.

To skip the template (which is only just intendended as an example):

quarto add elipousson/typstdoc

Using typstdoc

This format extends the existing typst template with more complete coverage of settable parameters for the page, text, and par Typst elements:

  • page
    • paper (set by papersize)
    • flipped
    • margin
    • fill
    • numbering (set by page-numbering)
    • number-align (set by page-number-align)
    • header
    • header-ascent
    • footer
    • footer-descent
  • text
    • font (set by mainfont)
    • fill (set by fontfill)
    • weight (set by fontweight)
    • spacing (set as a default property of par blocks)
    • slashed-zero
  • par
    • justify
    • first-line-indent
    • hanging-indent
    • linebreaks
    • leading

These additional parameters allow more fine-grained control over the typography and appearance of the document. You can set the font, size, and fill for the headings (using heading-font, heading-fontfill, etc.) and font, weight, and size for the title (using title-font, title-fontweight, etc.).

You can custom the color of the main body, heading, title, footer, and header text using the fill parameters. By default, these elements all inherit the main font fill.

This format includes experimental support for a listing of figures (set lof: true) which mostly works and a listing of tables (set lot: true) which mostly doesn't work.

This format supports hex color strings (with or without a hash symbol at the start of the string) and standard Typst color names (see color for documentation). Both quoted and unquoted fill parameters are allowed as the following example shows:

---
format:
  typstdoc-typst:
    title: "Typst Document Title"
    heading-fontfill: blue
    title-fontfill: "#0074d9"
    footer: "This is a custom footer"
    footer-fontfill: 0074d9
---

You can also set the font, size, fill, and align for the header and footer and provide custom text for the header or footer. Note the page number will be suppressed if page-number-align is set to bottom when footer is supplied or top when header is supplied.

---
title: "My Paper"
author: Janet Doe
format:
  typstdoc-typst:
    mainfont: "Roboto"
    fontsize: 18pt
    leading: 12pt
    heading-font: "Roboto Narrow"
    heading-fontfill: blue
    monofont: "Roboto Code"
---

The format also overrides the standard template for callouts by converting units from pt to em to ensure that the size of the border and padding around the callout text is appropriate when using a large papersize. While main font defaults to a point size value (11pt), the other font sizes are set using em units to allow everything to scale to match the main fontsize value.

This format is published under the CC0 1.0 Universal public domain license.

typstdoc's People

Contributors

elipousson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.