Commit Graph

924 Commits

Author SHA1 Message Date
Albert Krewinkel 6dae03f719 Typst writer: add native Typst support for nocite.
The `nocite` metadata field can now be used to supply additional
citations that don't appear in the text, just as with citeproc and
LaTeX's bibtex and natbib.

Closes: #10680
2025-07-30 11:59:41 +02:00
Albert Krewinkel de7f732be8 HTML styles: prefix default styles with informative CSS comment (#11002)
Closes #8819
2025-07-29 14:28:08 -07:00
Christopher Kenny f000fa168b Add features to typst base template.
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-07-24 10:45:28 -07:00
Albert Krewinkel f596612abd Typst: add support for custom and/or translated "Abstract" titles
Closes: #9724
2025-07-21 11:11:25 +02:00
John MacFarlane f4eca1f3fb Use latest dev citeproc and update the default CSL...
from the latest chicago-author-date.csl. (Note that this goes
from the 17th to the 18th edition.)

Update tests.
2025-07-20 00:12:15 -07:00
TomBen 0a697c101b Update East Asia font theme in styles.xml to minorEastAsia 2025-06-10 18:08:06 -07:00
TomBen 7b03847ec5 Update language settings in styles.xml for East Asia to Simplified Chinese 2025-06-10 18:08:06 -07:00
John MacFarlane f4c7fccd93 ConTeXt template: add command needed to get tagging working...
...on the most recent context versions.
See #10846.
2025-05-17 10:18:58 -07:00
John MacFarlane cf795b0cf5 Fix context writer/template to produce tagged PDFs.
As before, the `tagging` extension must be enabled.
We now add the command that tells ConTeXt to start tagging.

Closes #10846.
2025-05-15 11:37:50 -07:00
Andrew Dunning 2196609989 Add footnote block text sample 2025-05-13 10:31:14 -07:00
Andrew Dunning 3d9d35a371 Remove extra spaces in default reference docx
The line breaks are interpreted as whitespace, resulting in extra leading and trailing spaces in the reference file.
2025-05-13 10:30:53 -07:00
John MacFarlane 021b9cee8d ms template: put PDF-specific things under a conditional.
Don't inculde them if `pdf-engine` isn't set.
2025-03-29 22:39:38 -07:00
John MacFarlane 64cde1a038 ms template: use T rather than P as default font family.
This is more reliable; see #10738.
2025-03-29 18:42:44 -07:00
John MacFarlane 04476c550f Revert "Default beamer template: only emit \date if set (#10687)"
This reverts commit 3f1f58e96e.

The reason for reverting this change is that it led to an
undesirable behavior change. Documents with no explicit date
specified now have a date printed, because the default
title block will include a date if no `\date` command is used.
The empty `\date{}`, by contrast, suppressed the date, which
is the desirable behavior.

PR #10687 was motivated by the desire to include a custom `\date`
in the frontmatter via header-includes.  I think that aim can
be achieved more simply by simply setting the `date` variable.
In markdown you can even use `date:` in metadata and put some
raw LaTeX there.
2025-03-17 08:48:55 -07:00
josch 3f1f58e96e Default beamer template: only emit \date if set (#10687)
This allows one, for example, to set a custom \date in the
header-includes of the rmarkdown yaml frontmatter. Without this
conditional, the custom \date in the frontmatter would be overridden by
a (potentially empty) date from this template later.
2025-03-14 18:54:06 -07:00
Tiago-Manzato 2d2570881b Update article.jats_publishing template (#10622)
Just a typo for author prefix that was causing authors to have the suffix as
prefix and suffix in the XML.
2025-02-14 13:08:34 -08:00
John MacFarlane 49d154c769 Use babel options shorthands=off.
This has been fixed now in Babel for some time.  So we can now
get rid of the ugly code that disabled language-specific shorthands
(see e26d31d).

Closes #6817.
2025-02-10 13:22:33 -08:00
John MacFarlane 4948d27fee Remove selnolig-langs.
We now specify the language as a global option again, so we
no longer need to specify it when invoking selnolig.

See #9863.
2025-02-10 13:02:58 -08:00
John MacFarlane 9be0963327 LaTeX writer/template: Improve babel support.
Previously we used the `.ini` files for every language, but
for European languages these tend to provide inferior results
to the `.ldf` files used by classic Babel. Currently Babel
documentation recommends using the classic system for European
languages written in Latin and Cyrillic scripts and Vietnamese.
So the LaTeX writer and template now follow this guidance.

Main languages in the list of languages with good "classic" support
are added to global documentclass options and will be automatically
handled by Babel using the `.ldf` files.

If the main language is not in this list, the `babeloptions` variable
will be set to `provide=*`, which will cause support to be loaded from
the `.ini` file rather than an `.ldf`. So, for example, setting
`-V babeloptions=''` with a polytonic Greek document will cause the
`.ldf` support to be used instead of the `.ini`.

The default setting of this variable can be overwritten, but in most
cases the default should give good results.

Closes #8283.
2025-02-08 10:45:11 -08:00
Charles Tapley Hoyt 1eed55f391 Add CRediT roles to JATS
Enable annotating author roles using the Contribution Role Taxonomy
(CRediT) and export this information in conformant JATS

Closes #10152.

Co-Authored-By: Jez Cope <457628+jezcope@users.noreply.github.com>
2025-02-05 21:28:56 -08:00
John MacFarlane 3291605c91 LaTeX template: allow csquotesoptions to be specified.
Obsoletes #7025.
See #8283.
2025-02-04 15:17:39 -08:00
John MacFarlane 6fbb50fc88 Docx writer: repeat reference doc's sectPr for each new section.
Previously we were only carrying over the reference doc's sectPr
at the end of the document, so it wouldn't affect the intermediate
sections that are now added if `--top-level-division` is `chapter`
or `part`. This could lead to bad results (e.g. page numbering
starting only on the last chapter).

Closes #10577.
2025-01-31 11:44:48 -08:00
Andrew Dunning 2aeb09f254 Docx title style corrections (#10581)
Base Author and Date styles on Title; remove condensed spacing.
2025-01-31 09:14:01 -08:00
John MacFarlane ba04a9987d font-settings.latex template: fix indent bugs.
Fixed conditional indentation so that the *output* is
indented properly.
2025-01-19 10:38:28 -08:00
Hendrik Erz 0a2e8dd1d6 HTML styles: fix style of hr so it works when printed (#10535)
Previously `background-color` was used to style the hr, but this gets ignored
when printing.  This commit uses `border-top` instead.
2025-01-14 09:19:42 -08:00
John MacFarlane b6aff21452 Docx writer: restart footnotes by section by default.
This can be overridden by a final sectPr element in the body
of the reference.docx.

It will only change things for `--top-level-division=chapter`,
since only top-level chapters are put in separate sections.
For that use it will mean that footnote numbers start over with
each chapter, which is usually what is wanted.

Closes #2773.
2024-12-22 13:18:27 -08:00
John MacFarlane 86dd2f7d66 Fix default.beamer nocite location.
It must be inside a frame or it is ignored.

Improves on #10465. Obsoletes #10471.

Co-authored-by:  Thomas Hodgson <hello@twshodgson.net>
2024-12-19 14:54:04 -08:00
John MacFarlane 7a66c946e2 Docx writer: use styleIds not styleNames for Title, Subtitle, etc.
This change affects the default openxml template as well as the
OpenXML writer.

Closes #10282 (regression introduced in pandoc 3.5).
2024-12-17 17:33:17 -08:00
Thomas Hodgson 7d1962b617 Move nocites from LaTeX preamble to body (#10465)
Closes #10461.

Putting `\nocite` in the preamble works only with biblatex.
2024-12-17 10:17:13 -08:00
John MacFarlane be734d2543 Remove definitions.typst partial.
Remove unnecessary definition of `endnote`.
Incorporate the one remaining definition into `default.typst`.
2024-11-11 10:23:18 -08:00
John MacFarlane d5d2821a4d Typst writer: make template sensitive to a page-numbering variable.
This can be set to an empty string (or, in metadata, to false) for
no page numbers.

Addresses #10370.
2024-11-09 11:38:08 -08:00
John MacFarlane 39b87d4d28 Adjust test suite for typst template changes.
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-29 14:49:06 -07:00
Luis Rivera e01023c1f4 Issue10294 new code for two column layout on typst 0.12.x (#10324)
Update typst template to be compatible with two-column layout with
typst 0.12.  Layout instructions for two column layout has changed:
see https://github.com/typst/typst/issues/5215.

Closes #10294.
2024-10-29 14:22:49 -07:00
Jens ca30f4930d Update ua.yaml
Fix a typo from
See.: див.
to
See: див.
2024-10-29 14:19:12 -07:00
John MacFarlane 233301bacb Add font-settings.latex partial to the repository.
Fixes th efix to #6160.
2024-10-23 20:46:27 -07:00
John MacFarlane 516931f4b5 LaTeX/Beamer template changes.
- Split fonts.latex partial into two parts: fonts.latex and
  font-settings.latex.
- In beamer template, load beamer theme between fonts.latex and
  font-settings.latex. This allows a theme (such as metropolis)
  to set its own default font, while still allowing the user to
  override it.

This fixes a regression in pandoc 3.5.

Users who have custom templates based on pandoc 3.5 templates will
need to add `font-settings.latex()` after `fonts.latex()` in the
latex template. In a beamer template, the beamer theme-setting
code needs to be moved between these two partials.

Closes #10297.
2024-10-23 19:17:51 -07:00
John MacFarlane 3833a9d27e ConTeXt template: ensure that font names don't wrap.
Closes #10305.
2024-10-21 20:22:58 -07:00
John MacFarlane bdb1172385 Typst writer: make smart extension work.
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-10-08 21:58:25 -07:00
Suraj Patil de034b70f8 epub.css: remove background-color (#10264)
With this greyish background color, epubs look bad on a Kindle.
Closes #10263.
2024-10-07 08:00:52 -07:00
Thomas Hodgson dbc80f9745 Support short title, author, etc. in Beamer (#10244)
+ Add `shorttitle`, `shortsubtitle`, `shortauthor`, `shortinstitute`, `shortdate`
   to default.beamer.
+ Note that the brackets are inside conditionals, because some older beamer
    versions don't allow the empty optional argument.

Closes #10248.
2024-10-01 12:29:44 -07:00
Thomas Hodgson f2b1de5397 Make --number-sections work with beamer (#10245)
+ Remove section numbering code from common.latex
+ Add section numbering to default.latex
+ Add logic for numbering sections in default.beamer. I moved the template setting
   code to where other beamer templates are set. This makes the section-titles and
   numbersections variables independent.

This should make --number-sections work with beamer.
2024-10-01 12:26:28 -07:00
Thomas Hodgson e583ab7970 Support a list of images for titlegraphic (#10246)
Allow a list of title graphics in default.beamer
Title graphic options will be applied to each title graphic.
Images will be separated by `\enspace`.
2024-10-01 11:07:13 -07:00
Thomas Hodgson 3ba968292b Beamer theme options (#10243)
Add theme options to default.beamer: `colorthemeoptions`, `fontthemeoptions`,
`innerthemeoptions`, `outerthemeoptions`.
2024-10-01 11:02:43 -07:00
John MacFarlane 0dc660550d Move beamerarticle code from beamer -> latex template. 2024-10-01 09:06:43 -07:00
John MacFarlane c9c40eee8f Beamer template doesn't need amsmath,amssym.
These are loaded by beamer automatically.
2024-09-29 21:27:01 -07:00
John MacFarlane 2406ec1cdb Remove font-settings.tex partial.
We incorporate this into fonts.tex, and move the beamer theme-setting
commands before both of them.
2024-09-29 21:26:56 -07:00
John MacFarlane 2a6268de67 Refactor latex template using partials.
+ Split out common parts of latex template into partials: common.latex,
  fonts.latex, font-settings.latex, passoptions.latex, hypersetup.latex,
  after-header-includes.latex.
+ Split out old latex template into default.latex and default.beamer.
+ Make default.beamer the default template for beamer.
2024-09-29 14:18:31 -07:00
Akash Patel ca348940e3 Add support for list of figures (lof) and list of tables (lot) (#10029)
Two new command-line options are added:

`--lof[=true|false]`, `--list-of-figures[=true|false]`
`--lot[=true|false]`, `--list-of-tables[=true|false]`

Only docx, latex, and context are supported at this point.

Setting the `lof` and `lot` variables will also work for the formats that are
currently supported.

[API changes]

+ Lua: `list_of_figures` and `list_of_tables` can now be used in writer options.
+ Text.Pandoc.Options:  add `writerListOfFigures` and `writerListOfTables` fields
  to `WriterOptions`.
+ Text.Pandoc.App.Opt: add `optListOfFigures` and `optListOfTables` to `Opt`.

Closes #8245.

Co-authored-by: John MacFarlane <jgm@berkeley.edu>
2024-09-22 11:49:52 -07:00
Albert Krewinkel 5ccf380dad JATS template: support floats-group
The content of the `floats-group` variable is now rendered in a
`<floats-group>` element when using the *publishing* or *archiving* tag
sets.

Discussion: #10196
2024-09-20 17:36:36 +02:00
John MacFarlane a27dad6f68 Add options to change table/figure caption positions.
+ 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-09-08 08:29:09 -07:00