Commit graph

15514 commits

Author SHA1 Message Date
Castedo Ellerman
e7269beeb6
Follow JATS4R recommendation and PudMed Central (#8041)
Using the default jats template of pandoc 2.18, the https://jats4r.org/jats4r-validator/ warns: "The license URI is given in `@xlink:href`. For JATS 1.1d3 and later, if the license is defined by a canonical URI, then it should be specified in the `<ali:license_ref>` child element."

I can confirm that what JATS4R recommends here is consistent with the JATS article packages found on the FTP site for the
PubMed Central Open Access Subset <https://www.ncbi.nlm.nih.gov/pmc/tools/openftlist/> (at least with the eLife article I looked at).

This proposed change follows the JATS4R recommendation and an example eLife article on the PubMed Central FTP site.
2022-06-22 10:17:24 -07:00
John MacFarlane
8fc370bcec Document docx writer's use of Source Code style. 2022-06-21 12:33:15 -07:00
Albert Krewinkel
f49bee5c31
ConTeXt writer: support complex table structures. (#8116)
The following table feature are now supported in ConTeXt:

- colspans,
- rowspans,
- multiple bodies,
- row headers, and
- multi-row table head and foot.

The wrapping `placetable` environment is also given a `reference` option
with the table identifier, enabling referencing of the table from within
the document.
2022-06-21 10:22:34 -07:00
Gabriel Lewertowski
ab712246f0
Update fonts MIME following IANA recommendation (#8127) 2022-06-21 10:21:34 -07:00
Elliot Bobrow
f317ec41a1
LaTeX: Handle formatted text inside code inline (#8129)
Add `formatCode` function to Text.Pandoc.Shared [API change].

Use this in the LaTeX reader so that e.g.
`\texttt{\textbf{bold code}}` is parsed as `Strong [Code ("",[],[]) "bold code"]`.
2022-06-20 12:18:05 -07:00
Georgi Lyubenov
a21d6e9fa6
Future compat against liftA2 export from Prelude (#8132) 2022-06-19 12:36:21 -07:00
Amir Dekel
5fe154deb2
Org reader: Fix Post / Pre mixup when setting emphasis chars (#8134) 2022-06-19 19:52:56 +02:00
Albert Krewinkel
f39eeba35f
Lua: do not reset foreign encoding before running Lua
This was a leftover from previous hslua versions that relied heavily on
`Foreign.C.withCString` and the like. However, hslua 2 and later use
bytestring functions to retrieve string values, so this is no longer
needed.
2022-06-19 14:33:33 +02:00
Albert Krewinkel
0f573a5368
Require hslua-2.2.1, unless lua53 flag is set.
This fixes a problem where the encoding used for Lua filenames would
sometimes mismatch the encoding used by the OS. The file wasn't found
when that happened, for example with an umlaut-containing filename on
Windows. The change ensures that all characters of available in the
default locale can be used in the filename.
2022-06-19 14:30:27 +02:00
Albert Krewinkel
a4a0a47a91
Allow aeson 2.1 (#8130) 2022-06-16 11:34:52 -06:00
Albert Krewinkel
37fc412daa
doc/lua-filters.html: add list of common pitfalls
A list with common filtering and Lua pitfalls is added to the
"debugging" section.

Closes: #6077
2022-06-16 17:40:33 +02:00
Albert Krewinkel
0bd8a0e3d1
CI: test with latest GHC minor versions 2022-06-16 12:14:55 +02:00
John MacFarlane
2cc93c87c1 MANUAL: add note to --sandbox about embed_data_files.
See #8128.
2022-06-15 16:07:27 -06:00
John MacFarlane
a6344893b0 Use dev version of citeproc. 2022-06-15 10:52:26 -06:00
John MacFarlane
786a2d4757 Update default.csl from the latest chicago-author-date.csl. 2022-06-14 20:42:49 -06:00
Elliot Bobrow
6ff4972ca9
add --embed-resources flag (#8121)
* Add `--embed-resources` flag for `--self-contained` without implying
  `--standalone`
* Deprecate `--self-contained flag`

Closes #7331
2022-06-14 17:00:18 -06:00
Bastien Dumont
7244821705
Make clear that walk performs a deep copy (#8124)
Relevant discussion here: https://groups.google.com/g/pandoc-discuss/c/-NoL3Ft9AC8

I felt that it could be useful to inform that walk is the only way to get a deep copy of a List. I wrote this where I think that users will likely loop up for this feature, but it may be out of place.
2022-06-14 16:14:19 -06:00
John MacFarlane
b263f38304 LaTeX reader: improve mathEnvWith.
When converting e.g. an align environment to an aligned environment
inside a Math element, we need to include a newline before the
`\end{aligned}`, since the previous line might end in a comment.

Closes #8122.
2022-06-13 23:14:51 -06:00
John MacFarlane
54b20e5733 Use ghc 9.2.3 for linux builds. 2022-06-10 11:13:22 -07:00
Wentao Han
8197ae00b8
LaTeX writer: Extend list of book documentclasses (#8053) 2022-06-10 08:42:14 -07:00
John MacFarlane
30d802fe38 MANUAL: note that custom readers/writers will...
be sought in the readers/writers subdirectory of
the user data directory if not found relative to
the working directory.

Documents #8112.
2022-06-10 08:40:27 -07:00
Albert Krewinkel
42cbc71bbc
Allow placing custom readers and writers in data subdir (#8112)
* PandocMonad: add new function `findFileWithDataFallback` [API Change]
* Custom readers: allow files to be placed in "readers" data dir
* Custom writers: allow files to be placed in "writers" data dir
2022-06-10 08:37:12 -07:00
Albert Krewinkel
2200b9c8ff
TikiWiki: support underlined text 2022-06-10 11:29:00 +02:00
Albert Krewinkel
7e6ccda6d9
Lua: use only old ByteString functions.
The function `takeWhileEnd` was added with bytestring-0.11.3.0, but older
versions should be supported as well.

Fixes the previous commit.
2022-06-09 08:54:06 +02:00
Albert Krewinkel
b3cee8bdb0
Lua: Simplify module loading code.
Modules are now loaded directly; the special pandoc Lua package searcher
is no longer necessary and has been removed.
2022-06-08 22:45:28 +02:00
YI
665d5b0fbd org reader: recognize {webp,jxl} files as images 2022-06-08 12:29:50 +02:00
John MacFarlane
39fdf08fcc Add press.md (formerly press.txt in website). 2022-06-06 10:07:29 -07:00
Albert Krewinkel
b2b21bb4c5
Lua: add function pandoc.mediabag.fill (#8104)
The function allows to fill the mediabag with all images in a given
document. Images that cannot be fetched are replaced with a Span
containing the image description.
2022-06-06 09:25:09 -07:00
Albert Krewinkel
e5c41f11de
ConTeXt writer: use "sectionlevel" environment for headings (#8106)
The document hierarchy is now conveyed using the
`\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy
to include pandoc-generated snippets in documents at arbitrary levels.
The more semantic environments "chapter", "section", "subsection", etc.
are used if the `--top-level-division` command line parameter is set to
a non-default value.

Closes: #5539
2022-06-06 09:24:28 -07:00
Albert Krewinkel
7844300414
Muse tests: do no try to roundtrip strings containing \DEL char
Fixes: #8108
2022-06-06 16:14:07 +02:00
Albert Krewinkel
9d268e56ed
ConTeXt writer: unify link handling (#8096)
Autolinks, i.e. links with content that's the same as the linked URL,
are now marked with the `\url` command. All other links, both internal
and external, are created with the `\goto` command, leading to shorter,
slightly more idiomatic code. As before, autolinks can still be styled
via `\setupurl`, other links via `\setupinteraction`.
2022-06-04 21:49:53 -07:00
Albert Krewinkel
cc2849ccd0
Docx writer: prevent crashing when handling invalid tables
Tables with different numbers of cells per row would sometimes crash
pandoc. This fix prevents this by cutting off overlong rows.

Fixes: #8102
2022-06-05 00:00:51 +02:00
Albert Krewinkel
461566aa80
stack.yaml: fix pandoc-lua-marshal version 2022-06-03 11:20:43 +02:00
Albert Krewinkel
15f91964b3
Require pandoc-lua-marshal 0.1.6
Fixes: #8101
2022-06-03 10:29:01 +02:00
John MacFarlane
ad845c0376 makeSections: don't make a section for a div with class "fragments".
Closes #8098.
2022-06-02 09:01:18 -07:00
John MacFarlane
98a1b921e3 HTML writer: fix bug with --number-offset.
This formerly caused section divs to be produced, even
when `--section-divs` was not specified.  Closes #8097.
2022-06-02 08:46:26 -07:00
John MacFarlane
f53977e295 LaTeX writer: Improve grouping with autocites.
Closes #8088.
2022-06-01 23:24:49 -07:00
John MacFarlane
e8be78f91a Fix treatment of extensions for \input in LaTeX reader.
Previously we required a `.tex` extension, but TeX
allows any extension for `\input` (as opposed to `\include`).

Closes #8092.
2022-06-01 09:07:47 -07:00
Albert Krewinkel
4c2d03e96c
Fix LaTeX tests for tables with colspans 2022-06-01 11:32:55 +02:00
Albert Krewinkel
30b3e0a9d6
LaTeX writer: fix width of multicolumn cells.
Cells spanning multiple columns must be given an explicit width,
calculated from the table properties.

Fixes: #8090
2022-06-01 11:04:31 +02:00
John MacFarlane
9aff86143e Require skylighting 0.12.3.1 and update tests. 2022-05-31 19:49:27 -07:00
John MacFarlane
bd13077ce0 JATS reader: support edition in references.
Closes #8087.
Note: we strip off any non-digits, since CSL wants "4" rather
than "4th ed."
2022-05-31 12:01:15 -07:00
Brian Leung
ae8ed408b0
Org reader: support line selection in INCLUDE directives. (#8060) 2022-05-20 09:46:16 +02:00
John MacFarlane
ed054b4c74 Add tex_math_dollars to gfm default extensions. 2022-05-19 16:36:21 -07:00
John MacFarlane
4cbf4f6489 Beamer: allow containsverbatim as alternative to fragile.
Closes #8080.
2022-05-19 09:56:57 -07:00
John MacFarlane
b8fb79b5c0 ICML writer: support custom-style attribute on Table.
Closes #8079.
2022-05-18 09:55:22 -07:00
Cezary Drożak
6ea83c185c
Remove "m." subdomain from Wikipedia link (#8076) 2022-05-17 08:19:05 -07:00
Albert Krewinkel
9c29d840ff
LaTeX template: fix links-as-notes
The redefinition of `\href` when using `links-as-notes` must happen
after the hyperref package has been loaded.

Fixes: #8077
2022-05-17 16:12:53 +02:00
John MacFarlane
6eb77586b4 Docx writer: add w:lang to rPr for Span and Div with lang attribute.
So that Word can know that "Apfel" is not a spelling error.
Closes #8026.
2022-05-16 17:56:43 -07:00
John MacFarlane
3df55b4a4a AsciiDoc writer: fix commas in link text.
Commas in link text trigger interpretation of attributes.
To block this, we replace them with numeric entities.

Closes #8070.
2022-05-16 16:45:05 -07:00