|
| 1 | +# latexlike-report |
| 2 | +A simple report for Typst with LaTeX style, fully customizable. |
| 3 | + |
| 4 | +## Usage |
| 5 | +You can use this template in the Typst web app by clicking "Start from template" on the dashboard and searching for `latexlike-report`. |
| 6 | + |
| 7 | +Alternatively, you can use the CLI to kick this project off using the command |
| 8 | + |
| 9 | +```shell |
| 10 | +typst init @preview/latexlike-report |
| 11 | +``` |
| 12 | + |
| 13 | +Typst will create a new directory with all the files needed to get you started. |
| 14 | + |
| 15 | +## Configuration |
| 16 | + |
| 17 | +The template exports one function `latexlike-report` with the following named parameters: |
| 18 | + |
| 19 | +### Cover Parameters |
| 20 | +- `author (str)`: The main author of the document (must be a string) |
| 21 | +- `title (content)`: The main title of the report |
| 22 | +- `subtitle (content)`: The document's subtitle |
| 23 | +- `participants (content)`: List of additional authors (the main author appears first) |
| 24 | +- `affiliation (content)`: Institution or academic affiliation |
| 25 | +- `year (content)`: Publication year of the document |
| 26 | +- `class (content)`: Academic class or subject |
| 27 | +- `other (content)`: Additional optional information |
| 28 | +- `date (content)`: Document date (can use #datetime.today().display() for current date) |
| 29 | +- `logo (image)`: Institutional logo image (usage: image("path/to/image.svg")) |
| 30 | + |
| 31 | +### Theme and Language Configuration |
| 32 | +- `theme-color (color)`: Main theme color (see [color](https://typst.app/docs/reference/visualize/color/) for more information) |
| 33 | +- `lang (str)`: Document language ("es" for Spanish, "en" for English, etc) |
| 34 | +- `participants-supplement (str)`: Text preceding the authors list (adjusts based on language) |
| 35 | + |
| 36 | +### Font Configuration |
| 37 | +- `title-font (str)`: Font used for titles |
| 38 | +- `font (str)`: Main document text font |
| 39 | +- `font-size (length)`: Main font size (default: 13pt) |
| 40 | +- `font-weight (number)`: Font weight (default: 400) |
| 41 | + |
| 42 | +### Mathematics Configuration |
| 43 | +- `math-font (str)`: Font for mathematical equations |
| 44 | +- `math-weight (number)`: Mathematical font weight |
| 45 | +- `math-ref-supplement (str/function)`: Supplement for mathematical references (none, auto, or custom) |
| 46 | +- `math-numbering` (see [numbering](https://typst.app/docs/reference/model/numbering/)): Equation numbering style (default: "(1.1)") |
| 47 | +**From [equate](https://typst.app/universe/package/equate) package** |
| 48 | +- `math-number-mode (str)`: Numbering mode ("label" or "line") |
| 49 | +- `math-sub-numbering (boolean)`: Enables sub-equation numbering (true or false) |
| 50 | + |
| 51 | +### Page Style |
| 52 | +- `pagebreak-section (boolean)`: Inserts page break after level 1 headings (true or false) |
| 53 | +- `show-outline (boolean)`: Shows or hides table of contents (true or false) |
| 54 | +- `page-paper (str)`: Defines the type of paper (default: "a4") |
| 55 | +### Headers and Footers (from [chic header](https://typst.app/universe/package/chic-hdr) package) |
| 56 | +You can add images, text, the number of the current page, etc, or put none if you don't want some part of the header or footer. |
| 57 | +Some useful function: `chic-page-number()`, `chic-heading-name()` |
| 58 | +- `h-l (content)`: Left header content |
| 59 | +- `h-r (content)`: Right header content |
| 60 | +- `h-c (content)`: Center header content |
| 61 | +- `f-l (content)`: Left footer content |
| 62 | +- `f-r (content)`: Right footer content |
| 63 | +- `f-c (content)`: Center footer content |
| 64 | + |
| 65 | +## Special Features |
| 66 | +### Unnumbered headings |
| 67 | +You can use `<nonumber>` at the end of the same line of your heading to toggle to unnumbered headings, similar to `\section*` in LaTeX |
| 68 | +```typst |
| 69 | += Unnumbered heading <nonumber> |
| 70 | += <nonumber> Not an unnumbered heading |
| 71 | +``` |
| 72 | +Unnumbered headings won't appear in the outline. |
| 73 | +### Customize outline |
| 74 | +You can customize the outline by disabling the default and then using a show rule and calling the function like [here](https://typst.app/docs/reference/model/outline/). |
| 75 | +```typst |
| 76 | +#show: latexlike-report.with( |
| 77 | +..... |
| 78 | +show-outline:false, |
| 79 | +..... ) |
| 80 | +#show outline.entry: it => link( |
| 81 | + it.element.location(), |
| 82 | + it.indented(it.prefix(), it.body()), |
| 83 | +) //this is just an example, it can be customized to your preference |
| 84 | +#outline() |
| 85 | + ``` |
| 86 | + |
| 87 | +## Fixed Features and Overriding |
| 88 | + |
| 89 | +This template has some fixed features that you can keep or replace if you don't like making it fully customizable. To replace it you just need to add a show rule below the main function call, for example: |
| 90 | +```typst |
| 91 | +#show: latexlike-report.with( |
| 92 | +..... ) |
| 93 | +#show smallcaps: set text(font: "Latin Modern Roman Caps") |
| 94 | + ``` |
| 95 | +The fixed features are listed below: |
| 96 | +- `Headings style and color`: see [heading](https://typst.app/docs/reference/model/heading/) to learn how to customize it. |
| 97 | +- `Tables and figures caption`: using `#show figure.caption()` you can change it |
| 98 | +- `Paragraph style`: see [par](https://typst.app/docs/reference/model/par/), default with justify and first line indentation. |
| 99 | +- `Paragraph justify off in tables` : I don't recommend changing this, but you can do it adding `#show table.cell: set par(justify: true)` |
| 100 | +- `chic-hdr package`: Learn how to use it [here](https://typst.app/universe/package/chic-hdr), you don't need to import it, just add the show rule below the main function |
| 101 | +- `equate package`: Learn how to use it [here](https://typst.app/universe/package/equate), you don't need to import it, just add the show rule below the main function |
| 102 | + |
0 commit comments