Commit Graph
8528 Commits
Author SHA1 Message Date
John MacFarlane 6fdebc4afd T.P.Shared: export combineAttr.
[API change]
2023-11-05 21:26:37 -08:00
John MacFarlane 9400f75506 JATS writer: handle case where there is material after refs div.
Previously in such cases the references were not being moved to
back matter. Closes #9166.
2023-11-04 09:46:46 -07:00
John MacFarlane bb36f127e2 LaTeX template: include bookmark package unconditionally.
This package produces better PDF bookmarks than hyperref
and does it on the first pass.

As a consequence, we now default to running LaTeX only
once in producing a PDF (instead of twice). If a table
of contents is present, we still have to run three times
to get the page numbers.
2023-11-03 10:40:38 -07:00
John MacFarlane 5132f1ef33 T.P.RoffChar: escape - as \-.
The groff_man (7)` man page indicates that `-` characters will be
treated as typographic hyphens and are not appropriate for cases
where the output should be copy-pasteable as an ASCII
hyphen-minus character.  (E.g. in command line options.)

However, until a recent update groff man did not actually do this;
it treated `-` and `\-` the same.  With the new update (1.23.0)
the two are distinguished (see https://lwn.net/Articles/947941/
for background), so now it is important that pandoc escape `-`.

This reverts ee60ba5252.
That change was motivated by a problem with backslash-escaping
`-` in a filename for .PSPIC. That's simply a separate issue;
we shouldn't do the normal escapes in such a context. It has
been addressed in the previous commit.
2023-11-02 19:36:25 -07:00
John MacFarlane 051fa7d574 Ms writer: don't do normal escapes in filename arguments...
for PSPIC etc.

Note: I haven't been able to figure out how to make it
work if the filename contains a `"` character.
2023-11-02 19:35:34 -07:00
John MacFarlane db92f61f1e Citeproc: don't link citations if suppress-bibliography specified.
For there will be nothing to link to. Closes #9163.
2023-11-02 11:03:54 -07:00
John MacFarlane 0f3211c339 Shared: improve isTightList...
so that it recognizes an item containing only a list which is
itself tight as potentially an item in a tight list.

Closes #9161.
2023-10-28 10:07:13 -07:00
John MacFarlane 16fa893ca7 Fix spacing. 2023-10-27 12:56:38 -07:00
John MacFarlane 5ed86e69c4 Make reference-section-title work with jats+element_citations.
Closes #9021.
2023-10-26 17:04:55 -07:00
John MacFarlane 88cb8e699a Add bits as synonym of jats as input format.
Document in MANUAL.txt.
2023-10-26 15:27:00 -07:00
Julia Diaz f2a22e71df Modify JATS reader to handle BITS too (#9138)
Add provision for title-group, book, book-part-wrapper, book-meta,
book-part-meta, book-title, book-title-group, index, toc, legend,
title, collection-meta
2023-10-26 15:18:33 -07:00
John MacFarlane b671e0dfe5 Org writer: escape literal *, |, # at beginning of line with ZWS.
Closes #9159.
2023-10-26 09:18:56 -07:00
John MacFarlane 4457b775d3 ICML writer: prevent doubled attributes.
Closes #9158.
2023-10-24 21:46:03 -07:00
John MacFarlane 6f3ec91a0d CommonMark reader: handle Ext_tex_math_gfm.
Parse GFM-specific math constructions when `tex_math_gfm` enabled.

See <https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions>.

Closes #9121.
2023-10-23 21:08:27 -07:00
John MacFarlane d200cacb5b Extensions: Add Ext_tex_math_gfm constructor to Extension.
[API change]

This handles two GitHub-specific syntaxes for math.

And document in MANUAL.txt.

This is now default for `gfm`, in addition to `tex_math_dollars`.

See #9121.
2023-10-23 21:08:27 -07:00
John MacFarlane 7115edfeb7 Add helpful message on some metadata YAML errors.
Closes #9155.
2023-10-23 10:30:34 -07:00
John MacFarlane 5fa8f292a3 DokuWiki reader: allow autolinks to be avoided...
using e.g. `https:%%//%%...`. Closes #9153.

This is not a fully general fix but it should be enough if
there's a convention of defeating autolinks by putting the
slashes in `%%..%%`.
2023-10-22 17:07:20 -07:00
John MacFarlane fbf9194e34 DokuWiki reader: parse <code> and <file> as block-level code.
Previously we treated them as inline code in some contexts,
but that is not how DokuWiki works.

Closes #9154.
2023-10-22 10:59:07 -07:00
John MacFarlane ad1a745f72 LaTeX reader: better handle spacing commands...
hfill, vfill, hskip, vskip, etc.

Closes #9150.
2023-10-21 18:44:28 -07:00
John MacFarlane a67223c442 Typst writer: add #box around image to make it inline. (#9149)
An `#image` by itself in typst is a block-level element.
To force images to be inline (as they are in pandoc), we need
to add a box with an explicit width. When a width is not given
in image attributes, we compute one from the image itself, when
possible.

Closes #9104, supersedes #9105.
2023-10-20 12:18:46 -07:00
John MacFarlane 5e66811875 Markdown reader: fix blindspot with superscript in links.
Previously `[^super^](#ref)` wasn't parsed as a link, due to
code that was meant to prevent footnote markers from being
recognized as reference links.  This commit tightens up that
code to avoid this bad effect.

We have also added a new restriction on footnote labels: they
cannot contain the characters `^`, `[`, or `]`. Though this is
technically a breaking change, we suspect that the impact will
be minimal, as it's very unlikely people would be using these
characters in their note labels.

Closes #8981.
2023-10-20 10:27:49 -07:00
John MacFarlane 0fdac4984b HTML reader: allow th to close td and vice versa.
Closes #9090.
2023-10-19 11:07:22 -07:00
John MacFarlane 1529ff45e6 Powerpoint writer: fix a corruption error...
caused when the document used both a regular png and a png
in a data URI. (Similarly for any other image format.)
The problem was that duplicate entries in `[Content Types].xml`
were being created, one for the mime type `image/png`, one for
`image/png;base64`.

Closes #9113.
2023-10-18 14:24:59 -07:00
John MacFarlane 992bc86981 LaTeX writer: fix rowspans in tables...
...so they use the width of the column (`=` as the width
parameter). Closes #9140.
2023-10-17 21:22:53 -07:00
John MacFarlane f4baa88f42 LaTeX writer: don't treat table as "simple" if they have col widths.
This should help fix a problem wherein some grid tables with
colspans were overly wide.  See #9140.

The example given there still produces suboptimal
output (overlapping text), so not closing yet.
2023-10-17 21:11:16 -07:00
Julia Diaz fa3513b104 JATS reader: fix handling of alt-text (#9134)
Previously we were looking for an attribute that doesn't exist in
JATS; alt-text is provided by a child element.

Closes #9130.
2023-10-17 09:16:00 -07:00
John MacFarlane 802c610923 Typst writer: escape (.
If it occurs in certain contexts, it can be parsed as function
application.  Simplest thing to do is to escape it always.
Closes #9137.
2023-10-16 22:39:48 -07:00
Tim Stewart 46f7e8a2f2 remove duplicates for Ext_raw_html and Ext_pipe_tables 2023-10-16 21:59:48 -07:00
Sascha Wilde f9dc5b5012 Handle empty cells correctly in creole reader. Fixes #9141 2023-10-16 09:06:56 -07:00
John MacFarlane c76fbe964d Typst writer: don't allow long heading to wrap.
Closes #9132.
2023-10-12 22:26:19 -07:00
Michael McClurg ba07ec0572 Fix incorrect abbreviation for astronomical unit (#9125) 2023-10-08 15:31:30 -07:00
John MacFarlane ddabd85eb8 Man writer: Fix some spacing issues around links.
See #9120.

We need to use `\c` before a `.UR` or `.MT`, to avoid
an extra space, and also after.  To ensure that a space
at the beginning of the following line doesn't get swallowed
up, we escape it with `\`.
2023-10-05 09:38:45 -07:00
John MacFarlane c33b4581c9 T.P.Shared.splitSentences: don't split after initials.
This improves the man and ms writer output, preventing
sentence breaks after initials.
2023-10-05 09:37:35 -07:00
John MacFarlane 5a691e8c3f Man writer: use UR, MT macros for URLs, emails.
Closes #9120.
2023-10-04 22:22:25 -07:00
John MacFarlane d62e5f33db Markdown reader: Don't apply --default-image-extension to data URIs.
Closes #9118.
2023-10-03 09:22:44 -07:00
James J Balamuta 4d11ea7d6c Check if supplied FORMAT matches with an HTML slide deck value. Return True for isRawHtml. 2023-09-29 10:04:08 -07:00
John MacFarlane a19cd39a6f JATS writer: fix 3.1.4 regression in handling block-level metadata.
Closes #9092.
2023-09-21 14:22:30 -07:00
John MacFarlane 26d077fa21 T.P.Shared: add addPandocAttributes function.
[API change]

This is meant to simplify addition of attributes to Pandoc
elements; for elements that don't have a slot for attributes,
an enclosing Div or Span is added to hold the attributes.

Ideally this would live in pandoc-types, but for now we
reuse some code from commonmark-pandoc.
2023-09-20 11:55:59 -07:00
John MacFarlane e57953b9f0 Fix uneven indents in LaTeX line block output.
Closes #9088.
2023-09-18 15:59:26 -07:00
Seth Speaks 0d27947b96 HTML reader: parse task lists using input elements (#9066)
Allow the HTML reader to parse task lists of the sort produced by pandoc.
Closes #9047
2023-09-16 09:21:01 -07:00
John MacFarlane 30bef24924 Markdown reader: More accurate check that a normalCite...
...is not a link, bracketed span, or reference.

See #9080.
2023-09-14 15:25:58 -07:00
John MacFarlane 3ff206cc4b Ms writer: improvements in image handling.
See #4475.

+ PDFPIC is now used for PDF images in figures.
+ Inline images that are postscript or PDF are rendered using
  PSPIC or PDFPIC. This isn't ideal, because they will still be
  rendered as if in a separate paragraph, but it's probably
  better than just printing the image name.
+ Units are included in height.

For further improvement, we might consider in Text.Pandoc.PDF
using something like `convertImages` (which we currently use for
converting to PDF via LaTeX) to convert SVG (and other?) images
to PDF so they can be rendered in this way.
2023-09-14 11:26:46 -07:00
John MacFarlane 1ad99f64fa HTML writer: Fix CSL entry-spacing default.
See #9058.
2023-09-07 09:16:25 -07:00
John MacFarlane db9aa72037 Fix default citeproc entry-spacing.
According to the CSL manual, the default entry spacing is 1.
We were treating it as 0.

T.P.Citeproc:  always include an entry-spacing attribute
in the Div if the bibliography element contains an entry-spacing
attribute (previously we omitted it when it was 0).

LaTeX writer: use entry spacing 1 if no entry-spacing
attribute is present.

Update tests.

See #9058.
2023-09-07 09:06:23 -07:00
John MacFarlane a472567115 Org reader: factor out orgAnchor -> Org.Parsing.
A purely internal change. We will use this both in inline
and block parsing.
2023-09-06 20:08:18 -07:00
John MacFarlane b7e1ce422c Rewrite CSLReferences environment...
...to avoid depending on enumitem, which plays badly with
beamer.  Instead we use a regular list environment.
Thanks to @jpcirrus for the concept.

We also restore the pre-3.1.7 format of the CSLReferences
environment, which again has two parameters. The first
determines whether a hanging indent is used (1 = yes, 0 = no),
and the second is the entry line spacing (0 = none).

Closes #9053.
2023-09-05 20:24:20 -07:00
John MacFarlane aca36563c9 JATS reader: fix conversion of date to ISO 8601 format.
See #8865.
2023-09-04 16:55:47 -07:00
Julia Diaz a267b83bc8 JATS reader: Ignore <processing-meta> element (#9057) 2023-09-04 16:09:38 -07:00
John MacFarlane 632e3c1809 LaTeX writer: Fix regression.
In 3.1.7, pandoc added two labels to LaTeX figure environments,
one with a phantomsection.

Closes #9045.
2023-09-01 12:21:55 -07:00
Benjamin Esham 9190b19fc7 HTML writer: use the ID prefix in the ID for the footnotes section.
In general, the ID prefix makes it possible to combine multiple pieces
of Pandoc-generated HTML with no possibility that IDs will conflict. One
exception to this was that the footnotes were always put into an element
like

    <aside id="foonotes" ...>

This commit applies the ID prefix to this ID as well.
2023-09-01 11:42:48 -07:00