Commit Graph
18397 Commits
Author SHA1 Message Date
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 3551e21206 makePDF: automatically embed resources from media bag in HTML...
before trying to convert it with weasyprint, etc. This will give
better results when converting from formats like .docx.

Closes #11099.
2025-09-02 09:08:47 +02:00
John MacFarlane 4d545b69fe Change latex-pos to latex-placement. 2025-09-02 08:39:47 +02:00
Sean Soon 5424d3eca0 LaTeX writer: control figure placement with attribute (#11094)
If a `latex-pos` attribute is present on a figure, it will be used as the
optional positioning hint in LaTeX (e.g. `ht`).

With implicit figures, `latex-pos` will be added to the figure (and
removed from the image)  if it is present on the image.

Closes #10369.
2025-09-01 20:41:14 +02:00
John MacFarlane c74f2b8588 Use dev typst-hs. 2025-08-30 12:59:56 +02:00
John MacFarlane 8d7aed2355 Typst reader: fix addition of image path prefix to use posix separator. 2025-08-30 10:58:19 +02:00
John MacFarlane f865b3bc4b Typst reader: properly resolve image paths in included files.
Closes #11090.
2025-08-30 00:04:23 +02:00
Repetitive 729c12394c fix: recognize binary signatures and fail early
Fail early when receiving binary input with recognized signature:
- zip[-based]: including OpenDocument and Microsoft formats
- PDF
- CFBF-based: old Microsoft formats including .doc and .xls
- DjVu
2025-08-28 21:15:36 +02:00
John MacFarlane 1bf2564b5c Raise unknown reader error for ods, odp, odf, xls, xslx, zip extensions 2025-08-27 14:27:01 +02:00
John MacFarlane 73b5908825 Add TODO comment. 2025-08-27 13:26:33 +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
John MacFarlane 1882f0088a Use latest dev texmath. 2025-08-27 13:09:07 +02:00
Albert Krewinkel 01721c0960 Org reader: improve sub- and superscript parsing.
Sub- and superscript must be preceded by a string in Org mode. Some text
preceded by space or at the start of a paragraph was previously parsed
incorrectly as sub- or superscript.
2025-08-27 13:03:46 +02:00
John MacFarlane 6cff8dfc8a HTML reader: don't drop the initial newline in a pre element.
Closes #11064.
2025-08-26 18:57:14 +02:00
Tuong Nguyen Manh 01f97ed55d Typst Writer: Check XID_Continue in identifiers
Add unicode-data dependency for isXIDContinue for this to match the
rust implementation.
Also apply hlint suggestions for redundant $, literal pattern and
moving brackets to avoid $.
2025-08-26 18:25:08 +02:00
Sean Soon 1bee23683d Support header and footer in MAN reader 2025-08-26 18:22:16 +02:00
John MacFarlane 10404ca6d5 Add dev doclayout to stack.yaml. 2025-08-26 12:41:19 +02:00
Castedo Ellerman fce2ae101d doc page: add Baseprinter pandoc wrapper to extras 2025-08-26 12:23:36 +02:00
John MacFarlane 7e4ef3c54a Markdown reader: don't confuse a span after...
an author-in-text citation with a locator.  E.g. `@foo [test]{.bar}`.

See https://github.com/jgm/pandoc/issues/9080#issuecomment-3221689892.
2025-08-26 11:24:02 +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
John MacFarlane 93f8145fa4 Make -t chunkedhtml -o - output to stdout (as documented)...
rather than creating a directory called `-`.

Closes #11068.
2025-08-21 23:24:52 +02:00
dependabot[bot] 072efe81f8 Bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 05:04:54 -07:00
John MacFarlane 1ac4030c1a Rename command test for 10047 -> 11047.
Commit 2c857d3 closed #11047 but was mislabeled as closing #10047.
2025-08-17 17:53:32 +02:00
John MacFarlane 5e50e4e605 Citeproc: don't move footnotes around em-dashes.
Closes #11046.
2025-08-17 17:45:36 +02:00
John MacFarlane 2c857d379b Typst writer: add escapes to prevent inadvertent lists...
due to automatic wrapping.

Also simplify existing code that was meant to do this.

Closes #10047.
2025-08-17 17:45:36 +02:00
John MacFarlane f1404e2d2f LaTeX writer: add braces around comments in title-meta.
This is needed to prevent PDFs from interpreting this as a
sequence of titles.

See #10501.
2025-08-17 17:45:36 +02:00
R. N. West e0160fbc23 MANUAL.txt: fix broken ConTeXt links
Close #11055.
2025-08-16 08:05:19 +02:00
R. N. West 42f0280854 ImageSize: Fix JPEG file signature detection.
The previous implementation didn't include all possible JPEG file
signatures. All signatures in the range of ff d8 ff e0 and ff d8 ff ef
should be valid, in addition to ff d8 ff db (no application segment).
See <https://gist.github.com/leommoore/f9e57ba2aa4bf197ebc5?permalink_comment_id=3863054#gistcomment-3863054>
and p. 32 of <https://www.w3.org/Graphics/JPEG/itu-t81.pdf>.
2025-08-15 22:27:04 -07:00
Albert Krewinkel 4b01fd700a MANUAL.txt: fix minor capitalization typo
Fixes: #11052
2025-08-15 20:05:36 +02:00
John MacFarlane bb6c58c851 ImageSize: Handle jpgs with signature FF D8 FF EE.
Closes #11049.
2025-08-14 22:13:34 -07:00
Albert Krewinkel 2234a6b08f Org reader: allow "greater block" names to contain any non-space char
Closes: #4287
2025-08-14 23:09:46 +02:00
Albert Krewinkel de31a9f130 Org reader: accept quoted values as argument values.
Fixes: #8869
2025-08-14 19:35:37 +02:00
John MacFarlane a6a5be132a Typst writer: add parens around typst-native year-only citations.
Closes #11044.
2025-08-12 22:43:27 -07:00
Albert Krewinkel a36654b222 Lua: add function pandoc.structure.unique_identifier.
The function generates element identifiers based on inlines content.
It's primary use case is the programmatic generation of ID, similar to
what the `auto_identifiers` extension provides for many formats.
2025-08-12 21:37:35 +02:00
Albert Krewinkel 68d80cc9d9 Lua: add functions pandoc.text.superscript and subscript.
The functions convert numbers and parentheses to superscript and
subscript, respectively.
2025-08-12 08:47:49 +02:00
John MacFarlane 511ddc3223 Create directory of output file if it doesn't exist.
Closes #11040.
2025-08-11 22:47:52 -07:00
Albert Krewinkel 529b6d1667 Docx writer: ensure that documents don't start with a section separator
Any leading section separator is removed from the result.

Closes: #10578
2025-08-11 18:08:53 -07:00
John MacFarlane 0bbbdbcdb6 LaTeX reader/writer: change handling of math environments.
Certain environments in LaTeX will trigger math mode and can't
occur within math mode: e.g., `align` or `equation`.  Previously
we "downshifted" these, parsing an `align` environment as a
Math element with `aligned`, and an `equation` environment as a
regular display math element.  With this shift, we put these in
Math inlines but retain the original environments.

This works because:

1) texmath handles these environments just fine,
2) and so does MathJax;
3) when writing LaTeX we detect these environments in Math elements
   and emit them verbatim instead of putting them in `$..$` or
   `$$..$$`.

Closes #9711. Closes #9296.
2025-08-11 17:40:41 -07:00
John MacFarlane 6b2f66507a Use latest dev texmath. 2025-08-11 16:05:42 -07:00
Albert Krewinkel a5312c0828 LaTeX reader: parse \minisec as unlisted level 6 headings.
Closes: #10635
2025-08-10 18:36:52 -07:00
Albert Krewinkel 550fe44f95 T.P.Writers.Shared: amend docs of lookupMeta... functions.
Add notes to the Haddock docs that certain meta values lead to empty
return values.

Closes: #10634
2025-08-10 10:53:10 +02:00
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