Commit Graph
15332 Commits
Author SHA1 Message Date
John MacFarlane f3fcdd52c8 LaTeX template: move hyperref near end of preamble.
It now comes after header-includes and right before title, author, date,
abstract.

The hyperref documentation says: “Make sure it comes last of your loaded
packages”. The reason is that it redefines many LaTeX commands.

For example, loading it after titlesec (which might be loaded in
header-includes) causes links in the table of contents to point to
the wrong page (#7960).

Closes #5811.

Note:  Users who presuppose hyperref in their header-includes
will now have to add `\usepackage{hyperref}` to their header-includes
to make it available there.  (The redundant `\usepackage` will
do no harm in this case.)
2022-03-13 10:48:09 -07:00
John MacFarlane 6b79e944bb Use ghc4pandoc:9.2.2 docker image for linux build 2022-03-13 10:39:38 -07:00
Albert Krewinkel 1aeeba9ecb Shared: define ordNub as alias for nubOrd from containers package (#7963)
This requires at least containers 0.6.0.1, which ships with the oldest
GHC version currently supported by pandoc (GHC 8.6).
2022-03-13 08:42:30 -07:00
Albert Krewinkel edfe34c86c Document more functions in T.P.Parsing and T.P.Shared. 2022-03-12 23:16:31 +01:00
John MacFarlane 699336cf5b LaTeX reader: better handling of \usepackage.
If the package is local but causes parse errors, parse
everything up to the error and skip the rest.  Issue a
CouldNotParseIncludeFile warning indicating that parsing
failed at that point.

T.P.Logging: add CouldNotParseIncludeFile constructor.
2022-03-12 12:18:51 -08:00
John MacFarlane d128f5ee15 Depend on latest dev texmath. 2022-03-12 10:23:55 -08:00
John MacFarlane f9a4e049c5 T.P.Readers.LaTeX.Parsing: Monoid and Semigroup instances for TokStream. 2022-03-12 10:23:25 -08:00
John MacFarlane 6abcde0bf7 LaTeX reader: further optimizations for inline parsing. 2022-03-11 21:59:26 -08:00
John MacFarlane b423c17100 LaTeX reader: use custom TokStream...
that keeps track of whether macros are expanded. This allows
us to improve performance a bit by avoiding unnecessary
runs of the macro expansion code (e.g. from 24 ms to 20 ms on
our standard benchmark).
2022-03-11 19:51:59 -08:00
John MacFarlane d523eca3d3 Use dev version of pandoc-types.
This allows toJSONFilter to work with Meta and MetaValue.
2022-03-11 10:23:06 -08:00
Albert Krewinkel 517bceeba8 Parsing: partition module into (internal) submodules (#7962) 2022-03-11 09:21:59 -08:00
Albert Krewinkel 168529f0a4 Org writer: stop indenting property drawers, quote blocks
This follows the current default org-mode behavior.

Closes: #3245
2022-03-11 12:12:04 +01:00
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 82d9f5eb8b Add tests for idempotency of makeSections.
See #7950.
2022-03-08 09:53:57 -08:00
Guriy Samarin 0adfc6e58e add reference to install via winget (#7951) 2022-03-08 09:01:18 -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 697c814286 Note in manual that smart works for html input. 2022-03-04 10:00:49 -08:00
John MacFarlane bc7f74968e LaTeX template: skip \babelprovide if babel-lang is empty.
This avoids an error.  See #7945.
2022-03-02 08:52:13 -08:00
John MacFarlane c3cf339f1d RST writer: support all standard metadata ("bibliographic") fields. 2022-03-01 13:20:31 -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
Tony bff49852a5 add armhf support (#7944) 2022-02-28 09:03:25 -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 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