In transforming pandoc Cite to citeproc Citation,
extract a `citationSuffix` and `citationPrefix` from the
last item's suffix and first item's prefix, respectively, if
they contain a `|` character which separates the item's suffix
or prefix from the whole Citation's.
for example:
[for example, see |@C1; @A3; @B4|, and others]
Here "for example, see" acts as a prefix for the whole
group and will remain at the beginning even if the citation
items are reordered by citeproc. Similarly, ", and others"
will be a suffix for the whole group.
Closes#10894.
Notes:
1. The org reader now adds global prefixes and suffixes the
same way as the Markdown reader: as affixes to the first item's
prefix or the last item's suffix, separated by a pipe (`|`).
2. The org writer will also convert this `|` to a `;`, as
required by org-cite syntax.
3. This change doesn't currently do what one would expect, because
of changes that were made to citeproc to prevent citation items
with prefixes and suffixes from being sorted. Hence in
`test/command/10894.md`, we have test output
```
(Doe, 2020; Smith, 2021)
```
without affixes, but
```
(see Smith, 2021; Doe, 2020, and others)
```
with affixes. To make this work well, we'd need to remove the citeproc
code that prevented bad results before we had proper global
prefixes and suffixes. However, removing this code would mean that
existing documents would render differently, unless the new pipe
syntax for citation affixes were used. That may be something we want
to avoid.
4. The use of pipes to separate out global affixes from item-level
affixes is a kludge that could be avoided if we added additional
fields to Cite in the pandoc AST. However, AST changes are disruptive,
so perhaps it's not worth doing that. On the other hand, without
an AST change it is difficult to know if we've handled all the
cases we need to.
Text.Pandoc.Citeproc: Export `extractCiteAffixes` [API change].
When calling `fetchItem` in `getTemplate`, we temporarily
reset the `stSourceURL` in CommonState so that the template
is sought locally. Previously, an exception in `fetchItem`
would prevent `stSourceURL` from being set back to its original
value. This could result in a local file being fetched instead
of a remote one. Note that an exception is triggered when one
uses e.g. `--template default.html5`; in that case `getTemplate`
handles the exception by looking for the file in the user
data directory.
This patch fixes the bug so that the `stSourceURL` is reset
regardless of whether `fetchItem` raises an exception.
Thanks to Yingjie Su for identifying the problem.
This replaces (now deprecated but still functional) options
`--mathml`, `--mathjax`, `--gladtex`, `--katex`, `--webtex`.
The `plain` style can now be specified explicitly.
In defaults files, `html-math-method` is now
`math-method` (though `html-math-method` will still work).
Text.Pandoc.App.Opt:
- In unexported type CompletionKind, add MathMethods.
- In Opt, change `optHTMLMathMethod` to `optMathMethod`. [API change]
Text.Pandoc.Options:
- Rename HTMLMathMethod type to MathMethod. [API change]
- Rename `writerHTMLMathMethod` field of WriterOptions to
`writerMathMethod`. [API change]
Text.Pandoc.App.Completion:
- Clean up code.
- Add support for `--math-method`.
RTL is now properly handled in these cases:
- `dir: rtl` (or `ltr`) in document metadata
- an RTL `lang` in metadata (e.g. `he`, `ar`), unless overridden
by `dir`
- a `dir` attribute on a Div
The OpenDocument writer tracks the active writing mode and, when it
is RTL, emits automatic paragraph styles with
`style:writing-mode="rl-tb"` derived from the usual named styles
(deduplicated per parent style). `fo:text-align` is also used
to get the matching text alignment.
Code blocks remain ltr regardless.
Closes#11301.
With some help from Claude Fable.
In 3.8, we added DefaultHighlighting as a HighlightStyle.
However, not all writers were updated to match on it, with
the result that we have lost highlighting in Ms, ConTeXt,
ODT, and OpenDocument.
(This was compounded by a bug in the change that was made
to the ConTeXt writer at the time.)
This commit fixes these things.
Closes#11829.
Co-authored by Claude Fable 5.
* Add FindRelatedProducts action to Install buttons
* Disabled the preliminary FindRelatedProducts until the install mode is set
Previously, registry records of previous versions were not being removed.
Closes#11825.
This ensures that setting `lang` will affect the whole document.
Previously, setting `lang` to `he` was not sufficient to make
the document RTL.
See #11301.
Make `--bash-completion` an alias of `--completion=bash`.
Reorganize option parsing code using a new data structure OptionSpec,
which can encode the type of completion needed by each option.
Add new unexported module Text.Pandoc.Completion.
Unexported module Text.Pandoc.CommandLineOptions: export OptionSpec.
Closes#8542.
See 185c29b4b2 which claims that
`block` can occur in inline contexts. I can no longer confirm
this and suspect that it may have been an unintended behavior
of earlier versions of typst, now fixed.
Closes#11814.
* epub.css: add optional dark-mode (light-dark) support
The default EPUB stylesheet hardcodes a single dark text color
(#1a1a1a) on top of the reading system's own background. This wraps
that color — and the <hr> rule and table borders that use it — with
CSS light-dark(), so readers supporting `color-scheme` get an
inverted dark theme.
Each light-dark() declaration is preceded by a plain #1a1a1a
fallback, so readers that do not support light-dark() simply drop
the new declaration and keep the unchanged original appearance
(graceful degradation). No change to pandoc's conversion logic.
Align dark-mode values with bundled breezedark palette
If this attribute is set, the writer will output a label.
(This overrides labels based on identifiers, when identifiers
are present.)
Note that labels in typst need not be unique and may be used to
style elements using show rules. For example, one can attach
an `excerpt` label to all Divs that are excerpts, and style this
using a show rule like `#show <excerpt>: set text(blue)`.
See discussion at #11794.
This reverts commit 49853607e6.
The option `-wasm-use-legacy-eh=false` does not seem to be
recognized in the version of the compiler we are now using.
Reopens#11787.