Commit graph

1925 commits

Author SHA1 Message Date
Brian Leung
67daf96bdd
Org reader: allow attrs for Org tables. (#8049)
Tables with attributes are no longer wrapped in Div elements;
attributes are added directly to the table element.
2022-05-02 17:25:57 +02:00
John MacFarlane
c1105e6b06 HTML writer: avoid doubled style attribute...
when height and width are added to style because of an image,
but the image already has a style attribute.

Closes #8047.
2022-04-28 15:49:20 -07:00
John MacFarlane
50c9848c34 HTML writer: Add 'footnotes' identifier to footnotes section.
Closes #8043.
2022-04-26 13:03:02 -07:00
Albert Krewinkel
8689d9c0d6
Fix tests after changes to JATS template 2022-04-26 19:32:31 +02:00
John MacFarlane
f9b2ca7465 HTML writer: do not include the deprecated doc-endnote role.
doc-endnote was deprecated in DPUB-ARIA 1.1.
Closes #8030.
2022-04-21 08:07:37 -07:00
John MacFarlane
f3cfeba3ef Don't parse inline notes with blank lines inside.
Previously we parsed them but discarded part of the content.
Closes #8028.
2022-04-20 13:34:41 -07:00
John MacFarlane
356ece29cb Commonmark/markua/gfm writers: avoid excessive indentation...
on bullet lists.  They are now nested by 2 spaces instead of 4.

See #8011.
2022-04-08 20:52:37 -07:00
John MacFarlane
813f3d5dd4 Shared.taskListItemToAscii: handle asciidoctor's characters.
Asciidoctor uses different unicode characters for task
lists; we should recognize them too and be able to convert
them to ascii task lists in formats like gfm.

Closes #8011.
2022-04-08 18:20:56 -07:00
John MacFarlane
1b97846be2 Fix regression with ascii_identifiers and Turkish undotted i.
Closes #8003.
2022-04-01 10:41:33 -07:00
John MacFarlane
5f0bfd41a8 LaTeX writer: add () after booktabs rules.
These commands take optional arguments with () and [],
which can lead to problems if the content of the table
cell begins with these characters.

Closes #8001.
2022-03-30 10:07:09 -07:00
John MacFarlane
a9498a1568 LaTeX writer: support page,trim,clip attributes on images.
These are actually supported by `\includegraphics`, though
this is not well documented. See
https://tex.stackexchange.com/questions/7938/pdflatex-includegraphics-and-multi-page-pdf-files

Partially addresses #7181.
2022-03-29 09:03:28 -07:00
Albert Krewinkel
7a7e1b2b70
RST reader: wrap math in Span to preserve attributes (#7998)
Math elements with a name, classes, or other fields are wrapped in a
`Span` with these attributes.
2022-03-29 08:50:55 -07:00
John MacFarlane
6217fd0976 JATS writer: Fix handling of CSL variable 'page'.
Not 'pages' as we had before.  It should go to 'lpage' and 'rpage',
not 'page-range'.  See
https://jats.nlm.nih.gov/archiving/tag-library/1.1/element/page-range.html

Fixed some mistakes in test #7042.
2022-03-28 17:04:10 -07:00
John MacFarlane
35350fac85 JATS writer: avoid doubled ref-list element.
Previously when generating JATS with the `element_citations`
extension enabled, the references were put in a doubly-nested
ref-list element (`<ref-list><ref-list>...`).  This is now fixed.

Closes #7990.
2022-03-27 09:32:55 -07:00
Albert Krewinkel
4394fdf59c
JATS writer: encode author "others" as <etal/>
Citeproc adopted the BibTeX convention to use the author name "others"
when there are additional authors that are not named. JATS uses the
`<etal>` element for this.
2022-03-22 15:09:14 +01:00
John MacFarlane
9053214fba LaTeX template: Move urlstyle and xurl commands to after hyperref.
Closes #7978.
2022-03-21 10:42:18 -07:00
John MacFarlane
54f6e1be9b Remove native_divs from allowed gfm extensions.
This allows `<div>` to be suppressed using `-raw_html`.
Previously `native_divs` was enabled but could
not be suppressed, because it was not in the list of
available extensions for commonmark-based formats.

Closes #7965.
2022-03-14 12:45:45 -07:00
John MacFarlane
c9cf8568bf LaTeX template: Fix regression with code in footnotes...
...due to moving hyperref later in the template.

Closes #7964.
2022-03-14 12:28:56 -07:00
John MacFarlane
8d3959ea29 Remove special redefinition of \sout.
This used to be necessary to avoid problems with hyperref,
when headings contain strikeout text, but it does not seem to be
necessary any more (tested).
2022-03-13 17:18:31 -07:00
John MacFarlane
6328ac5097 LaTeX template: Move \sout correction after hyperref.
This fixes the previous change the default.latex.
2022-03-13 15:25:32 -07:00
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
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
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
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
c3cf339f1d RST writer: support all standard metadata ("bibliographic") fields. 2022-03-01 13:20:31 -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
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
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
d6916e2a40
Tests: improve location reporting of failing tests 2022-02-23 09:20:06 +01: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
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
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
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
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
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
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
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
John MacFarlane
d40d94ebd9 EndNote reader: add nocite as the other bib format readers do. 2022-02-04 23:51:12 -08:00
John MacFarlane
b7f1c97b6a Docx zotero/mendeley/endnote: add comma before locator in suffix. 2022-02-04 23:28:46 -08:00
John MacFarlane
75c6389e9d Add endnotexml reader test. 2022-02-04 10:36:58 -08:00
John MacFarlane
697aea3717 Add mendeley citation tests. 2022-02-04 10:14:21 -08:00
John MacFarlane
60caa0a1e1 Docx reader: add bibliographic entries for zotero ADDIN.
Bibliographic data embedded in citation items is added
to the `references` metadata field.

Closes #7840.
2022-02-03 22:08:46 -08:00