Commit graph

8003 commits

Author SHA1 Message Date
John MacFarlane
a7d94dba43 Org reader: allow multiple #+bibliography:. 2022-03-10 13:31:02 -08:00
John MacFarlane
18c432024b Org reader: parse #+print_bibliography: as Div with id refs. 2022-03-10 13:15:52 -08:00
John MacFarlane
581c94913f LaTeX reader: allow inline groups starting with \bgroup.
Closes #7953.
2022-03-09 17:53:00 -08:00
John MacFarlane
9b5ec100e5 Markdown writer: update escaping rules for \.
We now escape `\` only if `raw_tex` is enabled or
it is followed by a non-alphanumeric.
2022-03-07 10:46:07 -08:00
John MacFarlane
abffe63274 Remove raw_tex extension from list of commonmark...
extensions, and from the `commonmark_x` defaults.
commonmark doesn't parse raw TeX, and it doesn't
make sense to write it if we don't parse it.
2022-03-07 10:45:03 -08:00
John MacFarlane
0124e8b095 Org reader: handle #+bibliography: as metadata...
so that it can work with citeproc.
2022-03-04 22:50:17 -08:00
John MacFarlane
326a00ab1a DocBook reader: handle address and coyright in metadata.
See #7747.
2022-02-28 10:22:09 -08:00
John MacFarlane
b94ad5b2ed DocBook reader: improve info parsing.
Simplify metadata parsing code.
Handle abstract as block-level content.
Report skipped info elements with `--verbose`.

See #7747.
2022-02-28 10:19:04 -08:00
John MacFarlane
dc0fdb2709 DocBook reader: handle abstract in info section.
See #7747.
2022-02-28 08:38:03 -08:00
John MacFarlane
97c4f3f237 LaTeX reader: rudimentary support for vbox.
Closes #7939.
2022-02-27 23:24:30 -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
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
Albert Krewinkel
cfa473e9cd
Remove trailing whitespace in Writers.Markdown. 2022-02-23 09:21:25 +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
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
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
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
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
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
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
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
Lucas V. R
61f4771c55 Org reader: allow ":" in property drawer keys
Any non-space character is allowed as property drawer key, including ":"
itself (so it is not really a delimiter). The real delimiter is a space
character, so in a drawer like

:PROPERTIES:
::k:ey:: value
:END:

":k:ey:" is a key with value "value".

This usage can be seen in the Org Manual at
https://orgmode.org/manual/Using-Header-Arguments.html,
where the Org snippet

* Heading
  :PROPERTIES:
  :header-args:clojure:    :session *clojure-1*
  :header-args:R:          :session *R*
  :END:

is listed as an example.
2022-02-06 23:08:27 +01:00
Jan Tojnar
876859f9e9
Docbook writer: Interpret links without contents as cross-references (#7360)
Links without text contents are converted to `<xref>` elements. DocBook
processors will generate appropriate cross-reference text when presented
with an xref element.
2022-02-06 23:05:20 +01:00
John MacFarlane
677f2ca26e Allow use of a RIS bibliography with citeproc. 2022-02-05 23:48:55 -08:00
John MacFarlane
6cc253aab6 RIS reader: support ID and DO fields. 2022-02-05 23:34:44 -08:00
John MacFarlane
3da5440858 Add RIS bibliography format reader.
New module, Text.Pandoc.Readers.RIS, exporting readRIS.

New input format `ris`.

Closes #7894.
2022-02-05 23:25:03 -08:00
Albert Krewinkel
c962cef309
Lua: set module name before pushing
Using the correct module name is relevant when auto-generating
documentation.
2022-02-05 13:32:02 +01:00