982 Commits

Author SHA1 Message Date
luginf c645e57dc8 Add Txt2Tags writer (#11699).
`t2t` is now supported as an output format, producing Txt2Tags
markup (<https://txt2tags.org>). The writer covers headers, lists
(bullet, ordered, definition), tables, links, images, code blocks,
inline formatting, and raw txt2tags/HTML passthrough.

[API change]
Adds a new module Text.Pandoc.Writers.Txt2Tags, exporting
`writeTxt2Tags`. Also exported from Text.Pandoc.Writers.

Co-authored-by: luginf <alan@luginf>
2026-07-12 12:50:54 +02:00
John MacFarlane 3ecd95bf00 LaTeX writer: Provide a way to use table instead of longtable.
When the `float` class is attached to a table, a standard
floating `table` will be generated instead of a `longtable`.
Placement can be specified via the `latex-placement` attribute.
This will help, especially, those who use two-column layouts,
since `longtable` is incompatible with these.

Small change to the default LaTeX template: the `caption`
package is included and a default spacing set between the caption
and the table.

Closes #1023.
2026-07-10 16:38:03 +02:00
John MacFarlane d982f9f5ec Typst template: polyfill divider for typst < 0.15. 2026-07-09 01:28:43 +02:00
John MacFarlane d2f33e5b53 Typst reader/writer: use divider() for horizontal rule.
Remove old `horizontalRule` definition from default template.

Modify tests to use non-deprecated symbols.

Closes #11540.
2026-07-09 01:12:18 +02:00
John MacFarlane 1d6f33b897 Typst: further tight term list improvements.
Modified default template to remove custom show rule for
terms. Instead, we use a set rule to set hanging-indent.

For tight list items consisting of just one Plain block,
we no longer create a `#block` for the definition; this allows
it to remain on the same line as the term.
2026-07-08 11:18:31 +02:00
John MacFarlane 9a94445b6a epub.css: get rid of obsolete #TOC rules.
We don't generate anything with the TOC id in epubs.
A table of contents is in nav#toc and we have rules for
that.

Closes #11747.
2026-07-05 17:50:28 +02:00
John MacFarlane 4f5226df4f epub.css: Put clause for all headings before individual h1, h2, ...
This is more logical, since the individual clauses are meant to
override. Closes #11742.
2026-07-01 17:11:57 +02:00
John MacFarlane d8ea25c10e HTML styles: remove hard-coded font-size for print CSS.
Print CSS now uses the inherited font-size.
2026-07-01 13:54:24 +02:00
Albert Krewinkel c568a0e665 Typst template: allow multiword keywords (#11730)
Typst expects single words as keywords, so keywords consisting of
multiple words must be quoted (and should not be wrapped).
2026-06-23 19:06:58 +02:00
John MacFarlane 656a6704a5 RTF writer: emit real RTF lists with a list table.
Lists were written as plain paragraphs with a literal marker and a
hanging indent, carrying none of the `\ls`/`\ilvl` references or the
`\listtable`/`\listoverridetable` that the RTF list model (and pandoc's
own reader) expect, so lists could not round-trip.

Walk the document tagging each list with a unique id and nesting level
(`prepareLists`), build a `\listtable`/`\listoverridetable` describing
each list (`listTableRTF`, exposed via the `listtable` template
variable), and render every list paragraph with its `\ls`/`\ilvl`
reference.  The first paragraph of each item gets a `{\listtext}`
marker; continuation paragraphs keep the reference but omit it, so
multi-paragraph items round-trip.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-09 00:17:57 +02:00
John MacFarlane 3385981157 ODT reference doc: demonstrate predefined styles.
Previously data/odt/content.xml contained only "Hello World!", so the
reference.odt produced by `--print-default-data-file reference.odt` gave
users no visual indication of which styles pandoc uses or how their
customizations would render.

Populate content.xml with example content exercising the predefined
paragraph and text styles shipped in data/odt/styles.xml: Author, Date,
Abstract, Heading_20_1..6, First_20_paragraph, Text_20_body (with
Emphasis, Strong_20_Emphasis, Strikeout, Superscript, Subscript,
Source_20_Text, Highlighted, hyperlink, and footnote), Quotations,
Preformatted_20_Text, List_20_Bullet, List_20_Number, TableCaption,
a two-column table using Table_20_Heading and Table_20_Contents,
FigureCaption, Definition_20_Term, and Definition_20_Definition.

This mirrors the demonstration content already present in
data/docx/word/document.xml.

Closes #10327.
2026-05-29 11:17:16 +02:00
John MacFarlane 1c7cfb2a2a OpenDocument/ODT writer: use predefined styles. (#11672)
Previously the OpenDocument writer emitted a fresh automatic style
(L1..Ln, P1..Pn, T1..Tn) for nearly every list, list-item paragraph,
block quote, preformatted block, and inline text style.  This produced
large ODT files, made `--reference-doc` customization ineffective (the
user's predefined styles were never referenced), and gave each list its
own indentation independent of any containing block quote.

This commit teaches the writer to reference the predefined styles that
LibreOffice ships and that pandoc's reference.odt now exports:

- Bullet lists use `List_20_1`; ordered lists with default start and
  decimal format use `Numbering_20_1`.  Non-default ordered lists
  generate a single named override style (`Pandoc_Numbering_N`)
  memoised by (ListNumberStyle, ListNumberDelim); a non-default start
  value with the default format is expressed via `text:start-value`
  on the `text:list` element instead of a new style.
- List-item paragraphs use `List_20_Bullet[_Tight]` and
  `List_20_Number[_Tight]`.  The Tight variants are pandoc-specific
  (zero top/bottom margin) and are injected into the user's
  reference.odt if missing, just like the Skylighting token styles.
- Block quotes use the predefined `Quotations` paragraph style
  directly.  Nested block quotes use a single automatic style that
  inherits from Quotations and only adds extra margin-left, so a list
  inside a block quote now inherits its container's indent (#2747).
- Preformatted blocks use `Preformatted_20_Text` directly.
- Emphasis, Strong, Strikeout, Subscript, Superscript and Code spans
  use the predefined `Emphasis`, `Strong_20_Emphasis`, `Strikeout`,
  `Subscript`, `Superscript` and `Source_20_Text` text styles.
- `paraStyle`/`paraStyleFromParent` no longer emit a wrapper automatic
  style when its only attribute would be `parent-style-name`; the
  parent name is returned directly.

Closes #9136.
Closes #5086.
Closes #2747.
Closes #3426.
Closes #7336.

Co-authored by: Claude Opus 4.7.
2026-05-27 17:35:39 +02:00
John MacFarlane 859f62685a HTML templates: include pandoc-version in generator meta tag.
Closes #11624.
2026-05-07 12:39:06 +02:00
Keenan Brock 2b5600fd0c HTML styles: make screen-only CSS conditional (#11606)
Styles unconditionally emits css that uses screen-only properties.
Paged-media engines (weasyprint, prince, pagedjs) have no viewport
and issue warnings. Fix it to hide these properties from the engines.

Closes #11524.
2026-05-02 12:43:40 +02:00
John MacFarlane e5b785aeb4 Add dir attribute to html tag in epub templates.
This brings them into agreement with the html templates.
See #11554.
2026-03-27 23:40:19 -04:00
John MacFarlane 9c45e58123 bash_completion.tpl: add groff to pdf-engine completions.
See #11555.
2026-03-27 23:18:12 -04:00
John MacFarlane 397fef7900 LaTeX template: Define \xmpquote if not defined.
`\xmpquote` is defined by the hyperref driver hyperxmp; we need a
fallback for those who aren't using that.

Closes #11528.
2026-03-22 10:36:15 +01:00
John MacFarlane 3769d0cbf4 Typst template: fix regression introduced in 3.9.0.1.
This introduced a bug that will produce the error message
`the character `#` is not valid in code`.

Closes #11538.
2026-03-19 09:17:46 +01:00
John MacFarlane dc4bcd23cc typst template: put title block in a conditional.
This avoids an empty block for documents that lack metadata
information.  The empty block causes problems if `#set page`
is used, as it will cause a page break.

Closes #11529.
2026-03-17 09:58:29 +01:00
John MacFarlane 5f245367d9 LaTeX template: properly handle keywords with commas.
These need to be put in an `\xmpquote{..}` command.
Closes #11528.
2026-03-16 17:34:01 +01:00
massifrg 15ddf4124c ICML writer support for image object styles (#11498)
This change allows users to style images in InDesign bysetting the
`object-style` attribute in a pandoc Image, which is mapped to the
AppliedObjectStyle attribute in the Rectangle element around
an Image element in the resulting ICML.
2026-03-03 22:31:55 +01:00
Christophe Dervieux 7bd9dbecdc Revealjs writer: default scrollProgress to 'auto'.
RevealJS defaults scrollProgress to 'auto', but the writer was
setting it to true.  Use lookupMeta to distinguish between
MetaBool True, MetaBool False, and unset (defaulting to 'auto').
The template uses a helper variable scrollProgressAuto since
pandoc templates cannot distinguish a MetaString "auto" from
MetaBool True in a single variable.
2026-02-25 11:45:30 +01:00
Christophe Dervieux bf96353c48 Revealjs template: fix type rendering of scroll-view options.
Remove quotes from scrollActivationWidth (should be a number,
not a string).  Use $if/$else$ guard for scrollSnap so that
`false` renders as a boolean literal rather than the string
'false'.  Add /nowrap to scrollSnap and scrollLayout.
2026-02-25 11:45:30 +01:00
John MacFarlane a56d98f9c4 HTML styles template: avoid duplicate code selector.
Consolidate two clauses. Closes #11484.
2026-02-23 17:36:50 +01:00
Gordon Woodhull e427b7795e typst: use both place and block for title
otherwise the title will be confined to the left column
2026-02-16 23:36:50 +01:00
Jan Tojnar 598b77517c Odt writer: Modernize Preformatted Text & Source Text styles
Presumably, `font-family-generic` and `font-pitch` will allow to find
a replacement on systems that do not have `Courier New`.
2026-02-16 13:54:34 +01:00
Jan Tojnar c8a64cadb3 Odt writer: Remove font size from inline source class
This matches what LibreOffice Writer is doing.

Also fixes literals inside headings being too small.

Fixes https://github.com/jgm/pandoc/issues/3390#issuecomment-595677619
2026-02-16 13:54:34 +01:00
Jan Tojnar edd6865f1c Odt writer: Rename inline source class to match LibreOffice
Rename the text style we use to represent `Code` inlines from
`Source_20_Text` to `Source_Text`.

This is the same name LibreOffice Writer uses so it will be recognized
by the Character Styles section of the Styles menu.

Closes #3390.
2026-02-16 13:54:34 +01:00
Sidney Mau ddf25d83ca Beamer template: add logooption variable (#11456).
Closes #11452.
2026-02-12 08:51:43 +01:00
Mickaël Canouil 65f0b491c9 Typst template: improve accessibility of definition lists (#11436).
The show rule we used for definition lists created problems when
typst was run with `--pdf-standard=ua-1`.  This patch fixes things,
and also prevents definition list items from breaking across pages.
2026-02-03 21:58:28 +01:00
John MacFarlane f0991cfcbb Reveal.js writer: add idiomatic highlight.js support.
Closes #11420.

When using `--syntax-highlighting=idiomatic` with reveal.js output,
pandoc now generates HTML compatible with reveal.js's built-in
highlight.js plugin:

- Code blocks use `<pre><code class="language-X">` format
- The template loads highlight.js CSS, JS, and RevealHighlight plugin
- Theme defaults to "monokai", configurable via `highlightjs-theme`
   variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 13:53:38 +00:00
Gordon Woodhull e07a3f3454 LaTeX writer: Add PDF standard support via DocumentMetadata (#11407)
Add `pdfstandard` metadata variable for specifying PDF standards
(PDF/A, PDF/X, PDF/UA) in LaTeX output. Uses LaTeX's \DocumentMetadata
command which requires LuaLaTeX.

- PDF version requirements are automatically inferred, but can be explicitly
  overridden.
- Automatic tagging for standards that require it (ua-1, ua-2, a-2a, a-3a).
- Warning for unsupported standards
- Documentation in MANUAL.txt (Variables for LaTeX, Accessible PDFs)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 20:00:57 +01:00
Christophe Dervieux 81f33bdaff Fix author prefix placeholder in JATS template (#11381)
Follow up on https://github.com/jgm/pandoc/pull/10622 that fix typo in other file
2026-01-06 16:29:03 +01:00
John MacFarlane 12ad483674 Typst template: disable hyphenation for title, subtitle.
Closes #11375.
2026-01-03 11:32:22 -05:00
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