Commit graph

15404 commits

Author SHA1 Message Date
John MacFarlane
f387d9bcd6 Use latest dev commonmark-extensions.
Closes #7942.
2022-02-27 22:42:38 -08:00
John MacFarlane
7f6021d7b2 Markdown writer: don't produce redundant header identifier...
when the `gfm_auto_identifiers` extension is set.

Closes #7941.
2022-02-26 11:37:46 -08:00
John MacFarlane
5375bd1446 DocBook reader: handle complete set of entities...
as specified at <https://www.w3.org/2003/entities/2007doc/byalpha.html>.

Closes #7938.
2022-02-24 15:50:53 -08:00
John MacFarlane
7dea81f992 Text.Pandoc.XML.Light: add versions of the parsers...
that allow specifying a custom entity map.

Exports new functions `parseXMLElementWithEntities`,
`parseXMLContentsWithEntities` [API change].
2022-02-24 14:47:35 -08:00
John MacFarlane
0ae7b1e1f8 Update texmath version to build against. 2022-02-24 08:54:16 -08:00
John MacFarlane
2b05ce6a81 Ensure that valid XML identifiers are used in...
Docbook, EPUB, FB2, HTML4, S5, Slidy, Slideous,
ICML, ODT, TEI writers.

Thus, if you convert `[anchor]{#1} and [link to](#1)`,
`id_1` will be used instead of `1` for the identifier.
2022-02-23 16:54:37 -08:00
John MacFarlane
9dc5e31416 T.P.Writers.Shared: export ensureValidXmlIdentifiers.
This function changes identifiers that don't start
with letters, and internal links to these identifiers,
making them compatible with XML standards.  The change
is simple: we add `id_` to the front.  There is potential
for duplication if there are already `id_...` identifiers
defined, but this seems rare enough not to worry too much
about.
2022-02-23 16:53:01 -08:00
John MacFarlane
8ceea05c75 Markdown reader: remove restriction on identifiers...
so they no longer need to begin with a letter. Closes #7920.
2022-02-23 10:04:15 -08:00
John MacFarlane
ba337866e4 Use latest dev texmath. 2022-02-23 10:00:38 -08:00
Albert Krewinkel
cfa473e9cd
Remove trailing whitespace in Writers.Markdown. 2022-02-23 09:21:25 +01:00
Albert Krewinkel
d6916e2a40
Tests: improve location reporting of failing tests 2022-02-23 09:20:06 +01:00
John MacFarlane
3d7eb129bd --version: print hslua version.
This will help us determine which version of Lua pandoc
is compiled against. See #7929.
2022-02-22 14:00:15 -08:00
ivardb
91b391e5a6
Add scrreport to the latex writer chaptersClasses. Fixed #6168 (#7935)
If scrreport is now chosen as the latex documentclass chapters will be used instead of sections. This behaviour is intended as scrreport is an alias for scrreprt which already created chapters
2022-02-22 13:20:16 -08:00
John MacFarlane
aa90302284 LaTeX writer: avoid extra space before \CSLRightInline.
Closes #7932.
2022-02-22 13:19:16 -08:00
John MacFarlane
1abf2bcd5f Update MANUAL.txt, since now --self-contained...
seems to work with `--mathjax`.  See #682.
2022-02-22 12:54:04 -08:00
Dimitris Apostolou
2f521081ad
Fix typos (#7934) 2022-02-22 09:05:39 -08:00
Lucas V. R
3bc3e96837 Org reader: More flexible LaTeX environments
Looking at the definition of `org-element-latex-environment-parser`, one
sees that Org allows arbitrary arguments to LaTeX environments. In fact,
it parses every char just after `\begin{xxx}` until `\end{xxx}` as
content for the environment, so all the following examples are valid
environments:

```org
\begin{equation} e = mc^2 \end{equations}
```
```org
\begin{tikzcd}[ampersand replacement=\&]
	A \& B \\
	C \& D
	\arrow[from=1-1, to=1-2]
	\arrow["f", from=2-1, to=2-2]
\end{tikzcd}
```
2022-02-21 16:04:14 +01:00
John MacFarlane
6fe8014a2c LaTeX reader: Handle \label and \ref for footnotes.
Closes #7930.
2022-02-19 11:55:46 -08:00
Albert Krewinkel
a3117bc142
Relax upper bound for hslua, allow hslua-2.2. (#7929)
Lua 5.4 is used by default after this is merged. Packagers may still include Lua 5.3
instead by building pandoc with `--constraint='hslua <2.2'`.

Differences between 5.3 and 5.4 should not generally affect pandoc Lua filters.
See list of incompatible changes here  <https://www.lua.org/manual/5.4/manual.html#8.1>
2022-02-19 11:26:18 -08:00
John MacFarlane
fb465070eb Ipynb writer: handle metadata better.
Previously we used the markdown writer to render metadata.
This had some undesirable consequences (e.g. en dash expanded
to `--` when `smart` enabled), so now we use the plain writer.

This addresses #7928, but I think a more elegant fix is possible.
2022-02-18 17:46:36 -08:00
John MacFarlane
2a70d9c3c5 Require skylighting 0.12.3. 2022-02-18 12:00:39 -08:00
John MacFarlane
4f2e126d62 Add faq on converting from latex + bibtex. 2022-02-18 10:05:27 -08:00
John MacFarlane
5b84c0f09d Change --metadata-file parsing...
...so that, when the input format is not markdown or a markdown
variant, pandoc's markdown is used.  When the input format is
a markdown variant, the same format is used.  Reason for the change:
it doesn't make sense to run the markdown parser with a set of
extensions designed for a non-markdown format, and this dramatically
limits what people can do in metadata files.

Refines #6832.  Closes #7926.

Perhaps this can be reconsidered if we come up with a way
of specifying an arbitrary format for the metadata file (#5914).
2022-02-18 09:35:38 -08:00
Albert Krewinkel
910296b745
Lua: Use pandoc-lua-marshal 0.1.5.
-   Allow any type of callable object as argument to List
    functions `filter`, `map`, and `find_if`. These previously
    required the argument to be of type `function`, which was too
    restrictive.

-   Inline: the type of Image captions is now `Inlines` instead
    of `List`.
2022-02-17 16:00:20 +01:00
John MacFarlane
dc534caf7a Add tests for #7919.
Together with the update in commonmark-hs and previous changes,
this closes #7919.
2022-02-13 17:43:30 -08:00
John MacFarlane
139bcb9614 Use latest dev commonmark-extensions. 2022-02-13 13:33:54 -08:00
John MacFarlane
85136b064f Markdown reader: allow one-column pipe tables with pipe on right.
See #7919.

We still need to implement this for gfm (commonmark).
This must be done via changes in commonmark-hs.
2022-02-13 13:06:49 -08:00
John MacFarlane
495ae605e3 Use latest dev commonmark, commonmark-extensions. 2022-02-13 12:47:51 -08:00
John MacFarlane
f3b0f19d7a Ensure that you don't get PDF output to terminal.
`-t pdf` should behave like `-t docx` and give an error
unless the output is redirected.
2022-02-13 00:26:54 -08:00
Albert Krewinkel
e1b7f3a63d
JATS reader: improve handling of fn-group elements (#7914)
Footnotes in `<fn-group>` elements are collected and re-inserted into
the document as proper footnotes in the place where they are referenced.

Fixes: #6348
2022-02-12 17:39:02 -08:00
John MacFarlane
4b1cddd292 Depend on latest commonmark.
This resolves an issue with commonmark_x's support of
strikeout.
2022-02-12 15:31:06 -08:00
John MacFarlane
3fa827ecf2 Document way to get list in block quote in slide shows.
This works around the convention that a list in a block
quote is incremental.

Closes #7916.
2022-02-12 13:55:24 -08:00
damon-sava-stanley
01ec1ac43a
Put id attributes on TOC entries #7907 (#7913)
Naming scheme of id is "toc-" + id of linked to header/section.
In Shared, will effect HTML, Markdown, Powerpoint, and RTF.
2022-02-11 21:37:00 -08:00
John MacFarlane
899feec4d3 RST reader: fix treatment of headerless simple tables.
We were producing a header with blank cells rather than no
header.  Closes #7902.
2022-02-11 09:42:24 -08:00
John MacFarlane
e8c1c6adb1 Clean up import list. 2022-02-11 09:29:55 -08:00
damon-sava-stanley
d3716eaeb6
Add DokuWiki table alignment for #5202 (#7908)
Closes #5202.

Within each cell, determine the cell alignment as per
https://www.dokuwiki.org/wiki:syntax#tables. The current approach, as
per the issue treats the first row's alignment as determining
that of the entire column. Given this, it wastes some work in
determining an alignment for every cell.
2022-02-11 08:58:29 -08:00
John MacFarlane
61996682ff --self-contained: issue warning rather than failing...
with an error, if a resource can't be found.
Closes #7904.
2022-02-10 21:39:15 -08:00
John MacFarlane
97d83e383a LaTeX reader: support \today.
Closes #7905.
2022-02-10 19:17:20 -08:00
John MacFarlane
03c6025379 Add command test for #7884. 2022-02-09 12:31:18 -08:00
John MacFarlane
7a888e8603 Fix parsing of epub footnotes.
Closes #7884.
2022-02-09 11:47:34 -08:00
Albert Krewinkel
7dc59aa26a
PDF: allow custom writer as format if engine is explicitly specified (#7901)
Closes #7898.
Note that it may be necessary to explicitly specify a template on the command line.
2022-02-09 10:16:41 -08:00
mjfs
63deba49d4
Docx: single numbering ID for examples - fixes #7895 (#7900)
This change ensures that example list items all belong to a single
number sequence, so that if items are added or deleted in a word
processor, the other items will renumber automatically.
2022-02-09 10:15:01 -08:00
John MacFarlane
93b1dbfdac HTML reader: give warnings and emit empty note...
when parsing `<a epub:type="noteref">` and the identifier
doesn't correspond to anything in the note table.

Previously we just silently skipped these cases.

See #7884.
2022-02-07 09:22:05 -08:00
Albert Krewinkel
4864761ad8
Custom writer: produce stacktrace if Writer function fails 2022-02-07 09:45:32 +01:00
Albert Krewinkel
7d3db1dd2d
Lua docs: fix typos, missing links 2022-02-07 09:30:12 +01:00
John MacFarlane
2b3433404e Remove sample RIS custom reader (since we now have a native one). 2022-02-06 19:13:34 -08:00
Albert Krewinkel
0f0b042139 Custom writer: support new-style Writer function. 2022-02-06 16:37:39 -08:00
Albert Krewinkel
f738c451d7 Lua: move custom writer code into Lua hierarchy. 2022-02-06 16:37:39 -08:00
Albert Krewinkel
49f1e7608e Lua: add module pandoc.layout to format and layout text 2022-02-06 16:01:24 -08:00
Lucas V. R
ae846381c3 Org reader: allow comments above property drawer
The Org Manual page at https://orgmode.org/manual/Property-Syntax.html
says (as of 2022-02-03):

"Property blocks defined before first headline needs to be located at
the top of the buffer, allowing only comments above."

This commit allows comments above.
2022-02-06 23:08:27 +01:00