Commit Graph
2527 Commits
Author SHA1 Message Date
John MacFarlane 01257ef6eb T.P.Writers.Shared: New version of gridTable.
This handles row and colspans. Partially addresses #6344.

It also ensures that cells won't wrap text in places where it
wouldn't normally wrap, even if this means making the cells wider
than requested by the colspec. (Closes #9001.  Closes 7641.)

Parameters are different, so this is a breaking [API change].

Markdown, RST, and Muse writers have been adjusted to
use the new `gridTable`.
2025-05-14 14:31:39 -07:00
John MacFarlane d3d5366e51 Use texmath-0.12.10.1 2025-05-12 11:03:27 -07:00
John MacFarlane ddcc4e0c65 Remove some redundant code in test. 2025-05-11 18:17:21 -07:00
John MacFarlane bfcff3eb99 Org reader: change handling of inline TeX.
Previously inline TeX was handled in a way that was different
from org's own export, and that could lead to information loss.
This was particularly noticeable for inline math environments
such as `equation`.  Previously, an `equation` environment
starting at the beginning of a line would create a raw block,
splitting up the paragraph containing it (see #10836).
On the other hand, an `equation` environment not at the beginning
of a line would be turned into regular inline elements
representing the math. (This would cause the equation number to
go missing and in some cases degrade the math formatting.)

Now, we parse all of these as raw "latex" inlines, which will be
omitted when converting to formats other than LaTeX (and other
formats like pandoc's Markdown that allow raw LaTex).

Closes #10836.
2025-05-11 17:38:18 -07:00
R. N. West (Nat) f66481f96e Powerpoint writer: use reference-doc font for captions. (#10835)
Closes #9896.
2025-05-10 16:03:56 -07:00
John MacFarlane 60b4011902 DocBook reader: improve handling of literallayout.
This is now only made a CodeBlock when there is a `monospaced`
class.

Otherwise it is made a LineBlock.

Closes #10825.
2025-05-08 11:19:54 -07:00
Manolis Stamatogiannakis 7f9c776b97 Plain writer: Support the four_space_rule extension. (#10813)
Allows using `-t plain+four_space_rule` to emulate the output of pandoc
before #7172. This is useful for users that use pandoc e.g. to
autoformat commit messages.
2025-04-28 16:06:31 -07:00
John MacFarlane 8e9d90504c Typst writer: handle equation labels with spaces.
Closes #10805.
2025-04-26 17:32:45 -07:00
John MacFarlane fb5499d7af Typst writer: add equation label if math contains \label{..}.
Closes #10805.
2025-04-25 22:39:56 -07:00
John MacFarlane ec08f03782 OpenDocument writer: fix character styles in footnotes.
Character styles governing the position of the footnote
reference should not be imposed on the footnote text.
Closes #10791.
2025-04-18 10:47:47 -07:00
John MacFarlane 47610fe3de LaTeX reader: disable ligatures inside \texttt.
Closes #10781.
2025-04-14 10:23:26 -07:00
John MacFarlane c2482b9107 LaTeX writer: make alignment work within multirow in tables.
Closes #10772.
2025-04-09 22:38:43 -07:00
John MacFarlane af57648e58 Docx writer: preserve Relationships for images from reference docx.
This should allow one to include an image in a reference.docx and
reference it in an openxml template.

Closes #10759.
2025-04-05 13:48:46 -07:00
John MacFarlane 0d2114ee4e Markdown writer: improve use of implicit figures when possible.
Closes #10758.

When the alt differs from the caption, but only as regards
formatting, we still use an implicit figure.
2025-04-05 11:32:29 -07:00
John MacFarlane 2155b5f9bc Markdown writer: render a figure with Para caption as implicit figure.
Also, when falling back to a Div with class `figure` for a figure
that can't be represented any other way, include a Div with class
`caption` containing the caption.

Closes #10755.
2025-04-04 10:16:23 -07:00
John MacFarlane 82668ff9aa Typst writer: support mark class on spans.
Closes #10747.
2025-04-01 15:35:22 -07:00
John MacFarlane 3a3fc66726 Use pdf-engine variable instead of extensions...
...to determine what to do about `.pdfhref` macros in `ms`
output.

When no PDF engine is specified, we don't use the `.pdfhref`
macros at all. This gives better results for links in formats
other than PDF, since the link text would simply disappear if
it exists only in a `.pdfhref` macro.

When a PDF engine is specified,  escape the argument of
`.pdfhref O` in a way that is appropriate.

Remove `groff` extension.

Text.Pandoc.Extensions: remove `Ext_groff` constructor.

See #10738.  This revises the earlier commit
3adcb4bd80.
2025-03-29 22:42:22 -07:00
John MacFarlane 021b9cee8d ms template: put PDF-specific things under a conditional.
Don't inculde them if `pdf-engine` isn't set.
2025-03-29 22:39:38 -07:00
John MacFarlane 64cde1a038 ms template: use T rather than P as default font family.
This is more reliable; see #10738.
2025-03-29 18:42:44 -07:00
John MacFarlane 3a0743e815 Org reader: don't include newlines in inine code/verbatim.
Convert newlines to spaces as we do in other formats.
Closes #10730.
2025-03-29 18:36:18 -07:00
John MacFarlane 3bbca20240 Use the most compatible form for roff escapes.
This affects T.P.RoffChar, T.P.Writers.Roff,
and the Man and Ms writers.

That is, `\(xy` instead of `\[xy]`. This was the original AT&T troff
form and is the most widely supported.  The bracketed form causes
problem for some tools, e.g. `makewhatis` on macOS.

Closes #10716.
2025-03-23 10:29:17 -07:00
John MacFarlane 4ab4c62de3 Commonmark Reader: handle GFM math irregularity with braces.
In GFM, you need to use `\\{` rather than `\{` for a literal brace.
Closes #10631.
2025-03-22 10:30:16 -07:00
John MacFarlane 59fb9c40de MediaWiki reader/writer: allow definition on same line as term.
Closes #10708.
2025-03-21 21:54:47 -07:00
silby 0f71b9e8c4 Skip at most one argument to LaTeX tabular newline (#10707)
In LaTeX's tabular environment, the tabular newline takes an optional
argument that we skip. But it only takes a single optional argument, and
any further square-bracketed text that follows shouldn't be skipped.

Fixes #7512, and also adds a test for the original problem raised in
that issue which was already fixed at some point.
2025-03-19 16:33:19 -07:00
John MacFarlane f717d1bccc Markdown writer: avoid spaces after/before open/close delimiters.
E.g. instead of rendering `x<em> space </em>y` as `x* space *y`
we render it as `x *space* y`.

Closes #10696.
2025-03-17 09:56:49 -07:00
John MacFarlane 2b11ce9bab Update tests for previous commit (protecting phantomsection). 2025-03-15 11:14:36 -07:00
John MacFarlane 4bf3a735f5 LaTeX writer: use * for multirow width when no colwidth specified.
Otherwise the multirow will be excessively wide.

Closes #10685.
2025-03-14 18:42:59 -07:00
John MacFarlane 28eca1e41e Markdown reader: remove some misguided list fanciness.
Previously we tried to handle things like commented out list
items:

    - one
    <!--
    - two
    -->
    - three

and also things like:

    - one `and
    - two` and

But the code we added to handle these cases caused problems with
other, more straightforward things, like:

    - one
    - ```
      code
      ```
    - three

So we are rolling back all the fanciness, so that the markdown
parser now behaves more like the commonmark parser, in which
indicators of block-level structure always take priority over
indicators of inline structure.

Closes #9865. Closes #7778. See also #5628.
2025-03-14 15:07:16 -07:00
John MacFarlane b7d2c4815f Markdown reader: fixed escapedChar' parser.
It should not accept escaped newlines.
See #10672.
2025-03-07 14:28:10 -08:00
John MacFarlane 45fdd1de10 Fix invalid OOXML in definition_list.docx test.
Closes #10394.
2025-03-05 21:41:30 -08:00
John MacFarlane e73b9ee1d8 Disable citations extension in writers if --citeproc is used.
Otherwise we get undesirable results, as the format's native
citation mechanism is used instead of (or in addition to) the
citeproc-generated citations. Closes #10662.
2025-03-05 13:24:05 -08:00
John MacFarlane 6c3e43dc57 LaTeX reader: better handle comments/whitespace in option lists and includes.
Closes #10659.
2025-03-04 15:00:37 -08:00
John MacFarlane 4ba0bac5c1 Update JATS tests for mathml rendering changes. 2025-03-01 22:14:40 -08:00
John MacFarlane 97ec88a16c Update typst test. 2025-02-28 22:55:39 -08:00
John MacFarlane ac79938043 Typst writer: better heuristics for escaping potential list markers.
Closes #10650.
2025-02-27 13:37:25 -08:00
John MacFarlane e2a0cc9dda Use latest dev texmath. 2025-02-25 22:49:50 -08:00
John MacFarlane 3caf2b1e3a Revert "Docx reader and writer: support row heads."
This reverts commit cbe67b9602.

Word sets `w:firstColumn="1"` by default for tables.  You have to find
the Table Design tab and explicitly uncheck "First Column" to make this
go away.  In most cases, I don't think writers intend to designate
the first column as a row head, so this commit is going to produce
unexpected results.  In addition, because of the table normalization
done by pandoc-type's `tableWith`, any table containing a colspanned
cell in the left-hand column will get broken if the first column is
designated a row head.  For these reasons it seems best to revert this
change, which was made in response to #9495.

Closes #10627.
2025-02-19 10:02:50 -08:00
John MacFarlane bf1c17c883 Markdown reader: allow line break between URL and title of link.
Closes #10621.
2025-02-14 10:17:26 -08:00
John MacFarlane f5d41a0c3f Powerpoint writer: avoid extra blank lines before author.
(In the case where there is no subtitle.)

Closes #10619.
2025-02-13 14:35:08 -08:00
John MacFarlane 54039e392d Update pandoc-citeproc-320a test.
See #10610.
2025-02-13 14:19:58 -08:00
John MacFarlane c21177b113 Smart quote parsing: ignore curly quotes.
Previously we tried to match curly quotes as well as straight
quotes, producing Quoted inlines.  But it seems better just to
assume that those who use curly quotes want them passed through
verbatim.

This also fixes an (unintended) bug whereby curly single left
quotes would sometimes be changed to single right quotes.

Closes #10610.
2025-02-13 13:58:53 -08:00
John MacFarlane 0fe6254535 Markdown writer: omit extra space after bullets.
We used to insert extra spaces to ensure that the content respected
the four-space rule.  That is not really necessary now, since pandoc's
markdown and most markdowns don't follow the four-space rule.

Those who want the old behavior can obtain it by using
`-t markdown+four_space_rule`.

Closes #7172.
2025-02-12 09:41:20 -08:00
John MacFarlane 49d154c769 Use babel options shorthands=off.
This has been fixed now in Babel for some time.  So we can now
get rid of the ugly code that disabled language-specific shorthands
(see e26d31d).

Closes #6817.
2025-02-10 13:22:33 -08:00
John MacFarlane 4948d27fee Remove selnolig-langs.
We now specify the language as a global option again, so we
no longer need to specify it when invoking selnolig.

See #9863.
2025-02-10 13:02:58 -08:00
John MacFarlane 64a4f60c02 TWiki reader: use "wikilink" class, instead of title. 2025-02-09 11:43:38 -08:00
John MacFarlane 9be0963327 LaTeX writer/template: Improve babel support.
Previously we used the `.ini` files for every language, but
for European languages these tend to provide inferior results
to the `.ldf` files used by classic Babel. Currently Babel
documentation recommends using the classic system for European
languages written in Latin and Cyrillic scripts and Vietnamese.
So the LaTeX writer and template now follow this guidance.

Main languages in the list of languages with good "classic" support
are added to global documentclass options and will be automatically
handled by Babel using the `.ldf` files.

If the main language is not in this list, the `babeloptions` variable
will be set to `provide=*`, which will cause support to be loaded from
the `.ini` file rather than an `.ldf`. So, for example, setting
`-V babeloptions=''` with a polytonic Greek document will cause the
`.ldf` support to be used instead of the `.ini`.

The default setting of this variable can be overwritten, but in most
cases the default should give good results.

Closes #8283.
2025-02-08 10:45:11 -08:00
Evan Silberman 97b36ecb77 Track wikilinks with a class instead of a title
Once upon a time the only metadata element for links in Pandoc's AST was
a title, and it was hijacked to track certain links as having originated
in the wikilink syntax. Now we have Attrs and we can use a class to
handle wikilinks instead.

Requires coordinated changes to commonmark-hs.
2025-02-07 14:04:12 -08:00
Charles Tapley HoytandJez Cope 1eed55f391 Add CRediT roles to JATS
Enable annotating author roles using the Contribution Role Taxonomy
(CRediT) and export this information in conformant JATS

Closes #10152.

Co-Authored-By: Jez Cope <457628+jezcope@users.noreply.github.com>
2025-02-05 21:28:56 -08:00
John MacFarlane f72548a7c2 DocBook reader: Handle title inside orderedlist.
Also some other elements that allow title: blockquote,
calloutlist, etc.
Closes #10594.
2025-02-03 12:33:39 -08:00
John MacFarlane 1470b3a573 DocBook reader: better handle formalpara, example, and sidebar.
Include identifiers and titles in each case.

The code should be credited to @tombolano.

Closes #8666.
2025-02-01 17:04:38 -08:00