Commit Graph

948 Commits

Author SHA1 Message Date
John MacFarlane 7ced712014 HTML5 template: conditionally include lang attribute.
Previously we included it unconditionally, even if this
meant giving it an empty value.  This seems at best redundant,
since the empty value is the default. At worst, it adds clutter
and according to some sources may prevent the use of browser defaults.

I believe that the justification for including these attributes
even with empty values is not a good one; see commit 07d51d9
for the original change.  On my reading, the HTML spec does not
require the presence of the attribute on the html element; it
only says that if the attribute is present, it must have an
empty string or valid BCP 47 language tag as its value.

See also #11324.
2025-12-06 11:51:09 +01:00
har7an bbedaadc4d Typst template: Fix keywords usage. (#11317)
Previously the template turned any `keywords` defined in Pandoc metadata
into empty objects due to a misnomer in a loop variable. This in turn
was rejected by the Typst compiler as invalid syntax, making document
generation with keywords impossible.
2025-12-02 09:56:10 +01:00
Asliddinbek Azizovich 094061d946 Add reveal.js scroll view option to HTML writer (#11305)
* Add revealjs `scroll` view option to HTML writer
* Add `scrollSnap` option into default.revealjs

Closes #10052
2025-11-30 13:45:36 +01:00
reptee c660bd3419 Add BBCode writer (#11242)
`bbcode` is now supported as an output format, as well as variants
`bbcode_fluxbb` (FluxBB), `bbcode_phpbb` (phpBB), `bbcode_steam` (Hubzilla),
`bbcode_hubzilla` (Hubzilla), and `bbcode_xenforo` (xenForo).

[API change]
Adds a new module Text.Pandoc.Writers.BBCode, exporting a number of functions.
Also exports `writeBBCode`,  `writeBBCodeSteam`, `writeBBCodeFluxBB`,
`writeBBCodePhpBB`, `writeBBCodeHubzilla`, `writeBBCodeXenforo` from
Text.Pandoc.Writers.
2025-11-05 12:49:46 +01:00
John MacFarlane cfc5ac447b Re-add columns to typst template.
This is a regression since 3.8.

Closes #11259.
2025-10-30 11:15:09 +01:00
John MacFarlane 8b4e72e969 Typst template: fix font for compatibility with typst 0.14.
Typst 0.14 doesn't permit an empty array for `font`.
Closes #11238.
2025-10-26 19:43:03 +01:00
Mickaël Canouil ba64240f2c Typst template: fix syntax for bibliography inclusion (#11233)
Previously the syntax was wrong when multiple bibliography files were
specified.  Typst expects an array.
2025-10-23 11:31:57 +02:00
John MacFarlane 36cea7c978 Typst template: ensure that title block is properly centered.
Closes #11221.
2025-10-18 15:41:07 +02:00
John MacFarlane d8354618c4 LaTeX writer/template: small fix for unnumbered tables.
This improves on commit e13aa5c015,
which worked only for recent versions of longtable.

For older versions, we need to define a dummy counter `none`.

Closes #11201.  Thanks to @priiduonu for the solution.
2025-10-06 23:04:40 +02:00
John MacFarlane 9d452f801d Typst template: fix 3.8 regression in which links disappear.
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-10-04 19:26:59 +02:00
John MacFarlane 237b7a1a84 Remove coloring for a, a:visiting in epub.css.
This was causing links in iOS books app not to be distinguished in
any way (since underlining is not used there).

Closes #11174.
2025-09-28 15:57:28 +02:00
TuongNM b62f2505b3 LaTeX writer: Fix strikeouts in beamer title (#11169)
beamer uses pdfstring for the pdfinfo which can't handle soul strikeouts.
Therefore, the title, subtitle and author contents need to be put inside
texorpdfstring to deal with both the pdfinfo as well as the formatting.

Fixes #11168.
2025-09-28 15:52:33 +02:00
John MacFarlane 3ffd47af68 Typst writer: Fix syntax highlighting.
See #11171.  Previously the native typst highlighting was
always used, regardless of the setting of `--syntax-highlighting`.
With this change, `--syntax-highlighting=none` and
`--syntax-highlighting=<style name>` (with skylighting) will work.

Completes #10525.
2025-09-28 15:36:21 +02:00
John MacFarlane 95326e21e6 Add shorthands variable for LaTeX output.
If true, pandoc will allow language-specific shorthands
when loading babel.

Closes #11160.
2025-09-24 22:25:07 +02:00
reptee a0cfb3fd31 Vimdoc writer (#11132)
Support for vimdoc, documentation format used by vim in its help pages.
Relies heavily on definition lists and precise text alignment to generate tags.
2025-09-15 12:45:28 +02:00
John MacFarlane f3c7a931b4 Update default.csl from new chicago-author-date.csl. 2025-09-02 12:42:16 +02:00
John MacFarlane 0cdb430110 LaTeX template: don't emit empty linkcolor= in hypersetup.
Closes #11098.
2025-09-02 09:39:39 +02:00
Christopher T. Kenny 6070ad29cd Add features to typst base template (take 2).
New template variables supported: `thanks`, `abstract-title`, `linestretch`, `mathfont`, 
`codefont`, `linkcolor`, `filecolor`, `citecolor`.

Closes #9956, #11076.

(This is a new version of f000fa168b which
was reverted.)
2025-09-02 09:25:39 +02:00
John MacFarlane 27851bbe9d LaTeX writer: include cancel package only if needed.
That is, only if there is math that contains `\cancel`,
`\bcancel`, or `\xcancel`.
2025-08-27 13:09:07 +02:00
Reuben Thomas 5e92187c88 common.latex: add RTL support for LuaTeX engine 2025-08-24 09:59:48 +02:00
John MacFarlane 4c69f288d9 Revert "Add features to typst base template."
This reverts commit f000fa168b.
2025-08-24 09:47:44 +02:00
Albert Krewinkel 7639e800c5 Org template: add #+options lines if necessary
The default template now adds `#+options` lines if non-default settings
are used for the `smart_quotes` and `special_strings` extensions.
2025-08-06 12:54:12 -07:00
Albert Krewinkel 3a185fb5d0 LaTeX writer: set pdf-trailer-id if SOURCE_DATE_EPOCH envvar is set
The `SOURCE_DATE_EPOCH` environment variable is used to trigger
reproducible PDF compilation, i.e., PDFs that are identical down to the
byte level for repeated runs.

Closes: #6539
2025-08-06 12:48:59 -07:00
n.west 96fe83ecf1 reference.docx: don't left-align table header row
See #11019. Previously, centering tables in `reference.docx` would leave
the header row left-aligned. Why the OOXML 'standard' would allow table
elements to be aligned differently from the rest of the table in the
first place is anyone's guess.
2025-08-04 15:07:58 -07:00
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