aboutsummaryrefslogtreecommitdiff
path: root/test/writer.typst
AgeCommit message (Collapse)Author
2026-01-03Typst template: disable hyphenation for title, subtitle.John MacFarlane
Closes #11375.
2025-10-30Fix tests for #11259 change.John MacFarlane
2025-10-26Typst template: fix font for compatibility with typst 0.14.John MacFarlane
Typst 0.14 doesn't permit an empty array for `font`. Closes #11238.
2025-10-18Typst template: ensure that title block is properly centered.John MacFarlane
Closes #11221.
2025-10-05Typst writer: don't add semicolons as much.John MacFarlane
Previously we added semicolons after inline commands not followed by spaces, but mainly this was to deal with one issue: the presence of a semicolon after an inline command, which would be swallowed as a command separator (#9252). This commits adopts an approach that should avoid so many superfluous semicolons: it escapes semicolons that might come right after a command. See #11196.
2025-10-04Typst template: fix 3.8 regression in which links disappear.John MacFarlane
A template change in 3.8 added a show rule for links which causes them to disappear except in special cases. This change fixes the problem. Closes #11194.
2025-09-02Add features to typst base template (take 2).Christopher T. Kenny
New template variables supported: `thanks`, `abstract-title`, `linestretch`, `mathfont`, `codefont`, `linkcolor`, `filecolor`, `citecolor`. Closes #9956, #11076. (This is a new version of f000fa168bd122fee6e67f5a67bdd6d42d173261 which was reverted.)
2025-08-24Revert "Add features to typst base template."John MacFarlane
This reverts commit f000fa168bd122fee6e67f5a67bdd6d42d173261.
2025-07-24Add features to typst base template.Christopher Kenny
This implements the changes suggested in #9956, with the exception of the filecolor/urlcolor one. These would require adding some regex to guess the link types. This is theoretically possible to do, but it wasn't clear to me that this is a good thing to put in a default template. Happy to adjust if you have thoughts on this. Closes #9956. Some things to note: I'm converting colors by passing them as content, as I was seeing pandoc escape # if that was included. I set the default fonts for math and code ("raw") to fonts that are bundled with Typst. These need not be those fonts if there are more familiar pandoc preferences.
2025-02-25Use latest dev texmath.John MacFarlane
2024-11-11Remove definitions.typst partial.John MacFarlane
Remove unnecessary definition of `endnote`. Incorporate the one remaining definition into `default.typst`.
2024-11-09Typst writer: make template sensitive to a `page-numbering` variable.John MacFarlane
This can be set to an empty string (or, in metadata, to false) for no page numbers. Addresses #10370.
2024-10-29Adjust test suite for typst template changes.John MacFarlane
Note: the new templates presuppose typst 0.12; if you try to use an earlier version of typst, an error will be raised.
2024-10-08Typst writer: make `smart` extension work.John MacFarlane
If `smart` is not enabled, a command in the default template will disable smartquote substitutions. When `smart` is enabled, render curly apostrophes as straight and escape straight apostrophes. When `smart` is disabled, render curly apostrophes as curly and don't escape straight apostrophes. And similarly for quotes, em and en dashes. This should give more idiomatic typst output, with fewer unnecessary escapes. Closes #10271.
2024-09-08Add options to change table/figure caption positions.John MacFarlane
+ Add command line options `--table-caption-position` and `--figure-caption-position`. These allow the user to specify whether to put captions above or below tables and figures, respectively. The following output formats are supported: HTML (and related such as EPUB), LaTeX (and Beamer), Docx, ODT/OpenDocument, Typst. + Text.Pandoc.Options: add `CaptionPosition` and new `WriterOptions` fields `writerFigureCaptionPosition` and `writerTableCaptionPosition` [API change]. + Text.Pandoc.Opt: add `Opt` fields `optFigureCaptionPosition` and `optTableCaptionPosition` [API change]. + Docx writer: make table/figure rendering sensitive to caption position settings. + OpenDocument writer: make table/figure rendering sensitive to caption position settings. + Typst writer/template: implement figure caption positions by triggering a show rule in the default template, which determines caption positions for figures and tables globally. + LaTeX writer: make table/figure rendering sensitive to caption position settings. Closes #5116. + HTML writer/template: make `<figcaption>` placement sensitive to caption position settings. For tables, `<caption>` must be the first element, and positioning is determined by CSS, for here we set a variable which the default template is sensitive to.
2024-05-30Fix typo in fix to template.typst.John MacFarlane
2024-05-30Typst template: use content rather than string...John MacFarlane
...for title, author, date, email. Fixes #9823 (escaped `\@` in rendered email). Allows formatting in title, author, date, and email fields. Since the PDF metadata requires a string, and typst only converts the title to a string (not the authors), we use a small function content-to-string to do this conversion. Background: https://github.com/typst/typst/issues/2196
2024-05-12Add subtitle to Typst template (#9747)Mickaël Canouil
2024-04-28Typst writer: add blank line in definition lists with multiple definitions.John MacFarlane
See discussion #9704.
2024-03-20Typst writer: support Typst 0.11 table features. (#9593)John MacFarlane
* Typst writer: support Typst 0.11 table features. - colspans - rowspans - cell alignment overrides - relative column widths - header and footer - multiple table bodies with intermediate headers Row heads are not yet supported. The default typst template has been modified so that tables don't have lines by default. As is standard with pandoc, we only add a line under a header or over a footer. However, a different default stroke pattern can easily be added in a template. Closes #9588.
2024-03-17Typst writer: only use explicit figure 'kind' for tables.John MacFarlane
The rest of the time the autodetection should work fine.
2024-03-17Typst writer: use `kind: image` for image figures.John MacFarlane
2024-03-17Typst writer: avoid unnecessary box around image in figure.John MacFarlane
See #9236.
2024-03-17Typst writer: omit width/height in images unless explicitly specified.John MacFarlane
Previously we computed width/heigth for images that didn't have size information, because otherwise typst would expand the image to fit page width. This typst behavior has changed in 0.11. This change fixes a bug in which images would sometimes overflow page margins, depending on their intrinsic size. Closes #9236.
2024-03-16Typst template: set table inset globally.John MacFarlane
2024-03-14Typst writer: add 'kind' parameter to figures.John MacFarlane
This helps to distinguish tables from other figures for purposes of labeling and numbering. Closes #9574.
2024-01-29Typst writer escaping improvements.John MacFarlane
We no longer escape `(`. The reason we did this before (#9137) has been addressed in another way (#9252). We only escape `=`, `+`, `-` at the beginning of a line. We now also escape `/` at the beginning of a line. This should reduce unnecessary escapes. Closes #9386.
2023-12-14Typst writer: emit `;` after typst code...John MacFarlane
unless followed by space. Otherwise there's the potential that the typst code will swallow up a following character. Closes #9252.
2023-12-12Depend on texmath 0.12.8.6.John MacFarlane
This gives us less verbose typst math output.
2023-12-11Typst template fixes.John MacFarlane
2023-12-09Typst writer: use quote for block quotes.John MacFarlane
Remove custom definitiion of blockquote in default template.
2023-12-08Update typst-hs commit and typst writer test.John MacFarlane
2023-10-20Typst writer: add `#box` around image to make it inline. (#9149)John MacFarlane
An `#image` by itself in typst is a block-level element. To force images to be inline (as they are in pandoc), we need to add a box with an explicit width. When a width is not given in image attributes, we compute one from the image itself, when possible. Closes #9104, supersedes #9105.
2023-10-16Typst writer: escape `(`.John MacFarlane
If it occurs in certain contexts, it can be parsed as function application. Simplest thing to do is to escape it always. Closes #9137.
2023-08-21Typst writer: use `~` for nonbreaking space.John MacFarlane
And escape literal `~`. Closes #9010.
2023-08-09Typst writer: put the label in right place for Div, use `#block`.John MacFarlane
Closes #8991. Previously we were putting the label at the beginning of the Div's contents, but according to the documentation such a label gets attached to the *preceding* element. We now use an explicit `#block` and add the label at the end.
2023-06-30Typst writer: improve handling of autolinks.John MacFarlane
Closes #8931.
2023-06-05Typst writer: use `#footnote` for notes.John MacFarlane
Closes #8893.
2023-04-05Typst writer: use `<..>` for labels, create internal links.John MacFarlane
Internal links to labels are now supported.
2023-03-27Typst writer: fix alignment issue in lists.John MacFarlane
It's an aesthetic issue only; the first line had an extra space indent after the list marker.
2023-03-27Typst: Use customized term instead of custom macro for def lists.John MacFarlane
2023-03-26More Typst writer improvements.John MacFarlane
+ Update manual with variables for Typst. + Split `lang` metadata into separate `lang` and `region` for Typst. + Fix label positioning in Divs. + Fix text customizations (lang, region, font, size) so they actually work. + Update tests and man page.
2023-03-26Typst writer improvements.John MacFarlane
+ Fix non-decimal enumerated lists. + Fix endnotes ending with code blocks. + Improve default template to use a typst template. + Factor out definitions and typst template into partials. + Properly escape backslash and quote inside double quotes. + Update tests.
2023-03-25Add typst writer.John MacFarlane
See #8713.