`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>
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.
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.
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>
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>
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>
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.
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.
`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.
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.
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.
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.
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.
Support for vimdoc, documentation format used by vim in its help pages.
Relies heavily on definition lists and precise text alignment to generate tags.