Commit Graph
18354 Commits
Author SHA1 Message Date
Tuong Nguyen Manh 816ca8480d ODT Reader: Add table-header-rows 2025-08-10 08:20:49 +02:00
Albert Krewinkel 282fa55421 Lua: require hslua-module-system 1.2.3
This provides List methods to the value returned by
`pandoc.system.list_directory`.

Closes: #11032
2025-08-09 20:59:11 +02:00
Sean Soon 661a0b51a4 T.P.Options: Add and export defaultWebTeXURL WebTeX URL [API change] (#11029)
This fixes the `webtex` option when used without parameter in a defaults file.
2025-08-09 20:40:59 +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 90afbea1db Org writer: disable smart quotes by default 2025-08-06 12:54:12 -07:00
Albert Krewinkel b24bba7a20 Add smart_quotes and special_strings extensions for Org
Org mode makes a distinction between smart parsing of quotes, and smart
parsing of special strings like `...`. The finer grained control over
these features is necessary to truthfully reproduce Emacs Org mode
behavior. Special strings are enabled by default, while smart quotes are
disabled.

The behavior of `special_string` is brought closer to the reference
implementation in that `\-` is now treated as a soft hyphen.
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
Albert Krewinkel 48e59436ec LaTeX reader and writer: add support for soft hypens
The `\-` command is parsed as a soft hyphen character; likewise, the
character is written as that command when outputting LaTeX.
2025-08-06 12:08:29 -07:00
John MacFarlane 0b140a9a98 ImageSize: Unpack compressed object streams in PDFs...
...and look inside for MediaBox information. Closes #10902.
2025-08-06 11:01:13 -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
Joseph Reagle c1a4ae1abb Update 11013.md (#11020)
Original test had a poor/misleading title.
2025-08-04 13:05:16 -07:00
John MacFarlane f2da7933a2 Do not drop fragment/hash for local file paths.
With the previous behavior it was impossible to have an image
file containing `#` or `?`.  For the motivation for the previous
behavior, see commit 1d137fb.

Closes #11021.
2025-08-04 09:53:10 -07:00
Evan Silberman b75c537d87 Fix named entity lookup in POD reader
Translating entities by name ultimately relies on
Commonmark.Entity.lookupEntity, which de facto requires the entity name
to be followed by a semicolon. Paste a semicolon onto the end of the
entity name read from POD to look it up.

Fixes #11015
2025-08-03 22:03:12 -07:00
John MacFarlane bc3a8a663d Typst reader: handle inline-level show rules on block content.
Typst allows things like `smallcaps` to be applied to block-level
content like headings.  This produces a type mismatch in pandoc,
so before processing the output of typst-hs, we transform it,
pulling the block-level elements outside of the inline-level
elements.

Closes #11017.
2025-08-03 15:20:11 -07:00
John MacFarlane c7ec476848 Fix test for #11013. 2025-08-02 11:43:30 -07:00
John MacFarlane bb46c277ca HTML writer: Unwrap "wrapper" divs.
Some of the readers (e.g. djot) add "wrapper" divs to hold attributes
for elements that have no slot for attributes in the pandoc AST. With
this change, the HTML reader "unwraps" these wrappers so that the
attributes go on the intended elements.

Closes #11014.
2025-08-02 10:50:41 -07:00
John MacFarlane 52e28c31ed Use latest dev citeproc.
Add test for #11013. Closes #11013.
2025-08-01 15:33:50 -07:00
John MacFarlane 110ed6a5ef Text.Pandoc.PDF: avoid encoding errors when reading LaTeX logs.
Sometimes they are not all UTF-8, even in a UTF-8 locale.

Closes #10954.
2025-08-01 12:05:58 -07:00
John MacFarlane 8907b0b300 Use latest dev texmath. 2025-08-01 10:04:31 -07:00
Albert Krewinkel 75aee7a23c Lua: use proper interface functions to access the CommonState.
- The `PANDOC_STATE` is no longer a userdata object, but a table that
  behaves like the old object.

- Log messages in `PANDOC_STATE.log` are now in temporal order.
2025-08-01 10:04:14 -07:00
Albert Krewinkel 57e7d895db PandocMonad: add function runSilently [API Change]
The function runs an action in the PandocMonad, but returns all log
messages reported by that action instead of adding them to the main log.
2025-08-01 10:04:14 -07:00
John MacFarlane 8799ad87b7 Make CommonState opaque.
Text.Pandoc.Class now exports CommonState as an opaque object,
without its fields. [API change]

The internal module Text.Pandoc.Class.CommonState still exports
the fields.

Text.Pandoc.Class now exports the following new functions:
`getRequestHeaders`, `setRequestHeaders`, `getSourceURL`,
`getTrace`. [API change]
2025-08-01 10:04:14 -07:00
John MacFarlane c77476b597 Improve org-cite parsing.
Handle global prefix and suffix properly.

Use all and only the styles mentioned in oc-basic.el.
2025-07-31 18:54:03 -07:00
John MacFarlane ce9583840d Improve org citation parsing (allow space after ;). 2025-07-31 15:33:20 -07:00
John MacFarlane 3e5babbb43 Fix mistaken attempt to fix #11006.
Update the test so it reflects the right output, and fix the
solution.

Really closes #11006.
2025-07-30 12:49:18 -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
John MacFarlane 4066a9d483 Asciidoc writer: handle lists with sublists following continuations.
These require an additional blank line in some cases.
Closes #11006.
2025-07-29 18:37:07 -07:00
John MacFarlane f5262d88e4 TikiWiki reader: Use getVerbosity instead of getCommonState. 2025-07-29 17:24:19 -07:00
R. N. West (Nat) 9d56205784 docs: Don't encourage returning tables of filters from Lua filters (#11000)
See #10995. Use the `Pandoc:walk` method instead.
2025-07-29 16:16:38 -07:00
Albert Krewinkel de7f732be8 HTML styles: prefix default styles with informative CSS comment (#11002)
Closes #8819
2025-07-29 14:28:08 -07:00
John MacFarlane e4b6196636 LaTeX writer: be more conservative about using \url.
We only use it when the URL is all ASCII, since the `\url` macro
causes problems when used with some non-ASCII characters.

Closes #8802.
2025-07-29 14:25:23 -07:00
John MacFarlane ce6ef5cad0 ImageSize: Add Point and Pica as constructors of ImageSize.
[API change]

This will prevent unnecessary conversion of units.

Closes #8957.
2025-07-29 10:30:44 -07:00
John MacFarlane 39a2fd4308 Text.Pandoc.Class: Add stManager to CommonState.
[API change]

This allows us to cache the HTTP client manager and reuse it for
many requests, instead of creating it again (an expensive
operation) for each request.  (The documentation for `newManager`
advises sharing a single manager between requests.)

This fixes a memory leak and performance issue in files with
a large number of remote images.  Closes #10997.
2025-07-28 23:17:50 -07:00
Carlos Scheidegger 6893b38a6e Markdown writer: use fenced divs even with empty attributes.
Previously fenced divs were not used in this case, causing the writer to fall back to raw HTML.

Closes #10955.
2025-07-27 11:27:41 -07:00
John MacFarlane bfbf67ca5d Org writer: don't wrap link descriptions.
Org doesn't reliable display these as links if they have hard breaks.

Closes #9000.
2025-07-27 11:17:06 -07:00
John MacFarlane 8735bc03d8 Docx reader: fix stringToInteger.
It previously converted things like `11ccc` to an integer;
now it requires that the whole string be parsable as an integer.

Closes #9184.
2025-07-27 10:43:46 -07:00
John MacFarlane caa2193912 Ensure that the default template for xml is null. 2025-07-26 22:45:11 -07:00
John MacFarlane 9b06dc0075 MANUAL.txt: add xml as input/output format. 2025-07-26 22:45:11 -07:00
John MacFarlane 8f6eed7c72 Associate the .xml extension with the XML reader and writer. 2025-07-26 22:45:11 -07:00
massifrg fe3684632b New xml format exactly representing a Pandoc AST.
This adds a reader and writer for an XML format equivalent to `native`
and `json`.

XML schemas for validation can be found in `tools/pandoc-xml.*`.

The format is documented in `doc/xml.md`.

API changes:

- Add module Text.Pandoc.Readers.XML, exporting `readXML`.
- Add module Text.Pandoc.Writers.XML, exporting `writeXML`.

A new unexported module Text.Pandoc.XMLFormat is also added.
2025-07-26 22:45:11 -07:00
Albert Krewinkel cf11339c1d PDF: Improve error readability when pdf-engine is not supported.
Each supported engine is now printed on a line of its own.
2025-07-25 08:22:25 +02:00
Albert Krewinkel 3dfb25bb6c PDF: allow pdflatex-dev and lualatex-dev as PDF engines
These are the development versions of the LaTeX binaries; installable,
e.g., with `tlmgr install latex-base-dev`.

Closes: #10991
2025-07-25 08:19:27 +02:00
Albert Krewinkel 37b446a54c T.P.PDF: clean up makePDF 2025-07-25 07:53:57 +02:00
John MacFarlane 270fbd54f8 Use latest dev citeproc.
This solves the problem of unwanted capitalization of names
at the beginning of citations in footnotes.

Closes #10983.
2025-07-24 14:51:11 -07:00
John MacFarlane 912f4c7977 Revert a test case that changed due to a reverted citeproc change. 2025-07-24 14:51:11 -07:00
Sean Soon 937e20da0e DocBook reader: Add rowspan support. (#10981) 2025-07-24 23:07:50 +02:00
Ryan Gibb b84fa66fcb Org reader: Recognize "fast access" characters in TODO state definitions (#10990) 2025-07-24 22:40:08 +02: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
John MacFarlane ebf41dd539 Fix stack.yaml. 2025-07-23 23:32:48 -07:00
John MacFarlane a4872aa223 Use dev texmath. 2025-07-23 18:46:12 -07:00