aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2021-01-22Merge pull request #7042 from tarleb/jats-element-citationsJohn MacFarlane3-7/+178
JATS writer: use element citations
2021-01-22JATS writer: allow to use element-citationAlbert Krewinkel3-7/+178
2021-01-22Add biblatex, bibtex as output formats (closes #7040).John MacFarlane1-0/+48
* `biblatex` and `bibtex` are now supported as output as well as input formats. * New module Text.Pandoc.Writers.BibTeX, exporting writeBibTeX and writeBibLaTeX. [API change] * New unexported function `writeBibtexString` in Text.Pandoc.Citeproc.BibTeX.
2021-01-19JATS writer: Ensure that disp-quote is always wrapped in p.John MacFarlane1-1/+3
Closes #7041.
2021-01-18RST writer: fix #7039.John MacFarlane1-2/+2
We were losing content from inside spans with a class, due to logic that is meant to avoid nested inline structures that can't be represented in RST. The logic was a bit stricter than necessary. This commit fixes the issue.
2021-01-12Markdown writer: cleaned up raw formats.John MacFarlane1-34/+35
We now react appropriately to gfm, commonmark, and commonmark_x as raw formats.
2021-01-12Docx writer: handle table header using styles.John MacFarlane1-17/+20
Instead of hard-coding the border and header cell vertical alignment, we now let this be determined by the Table style, making use of Word's "conditional formatting" for the table's first row. For headerless tables, we use the tblLook element to tell Word not to apply conditional first-row formatting. Closes #7008.
2021-01-10JATS writer: fix citations (#7018)Albert Krewinkel1-12/+21
* JATS writer: keep code lines at 80 chars or below * JATS writer: fix citations
2021-01-10Fix infinite HTTP requests when writing epubs from URL source.John MacFarlane1-5/+9
Due to a bug in code added to avoid overwriting the cover image if it had the form `fileX.YYY`, pandoc made an endless sequence of HTTP requests when writing epub with input from a URL. Closes #7013.
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel38-39/+39
2021-01-07gfm/commonmark writer: implement start number on ordered lists.John MacFarlane1-1/+4
Previously they always started at 1, but according to the spec the start number is respected. Closes #7009.
2021-01-05HTML writer: fix implicit_figure at end of footnotes.John MacFarlane1-3/+7
Closes #7006.
2021-01-04EPUB writer: adjust internal links to identifiers...John MacFarlane1-0/+20
defined in raw HTML sections after splitting into chapters. Closes #7000.
2021-01-03EPUB writer: recognize `Format "html4"`, `Format "html5"` as raw HTML.John MacFarlane1-2/+8
2021-01-03EPUB writer: adjust internal links to images, links, and tables...John MacFarlane1-0/+6
after splitting into chapters. Previously we only did this for Div and Span and Header elements. See #7000.
2021-01-02LaTeX writer: revert table line height increase in 2.11.3.John MacFarlane1-1/+1
In 2.11.3 we started adding `\addlinespace`, which produced less dense tables. This wasn't an intentional change; I misunderstood a comment in the discussion leading up to the change. This commit restores the earlier default table appearance. Note that if you want a less dense table, you can use something like `\def\arraystretch{1.5}` in your header. Closes #6996.
2020-12-30Undo the "Use fromRight" hlint hint.John MacFarlane1-2/+1
2020-12-30Hlint fixesJohn MacFarlane1-1/+2
2020-12-30Ms writer: don't justify inside table cells.John MacFarlane1-1/+3
2020-12-29Improve fix to #6983.John MacFarlane1-1/+3
If we have a paragraph then a bookmarkEnd, we don't need to insert the empty paragraph (and in fact it alters the spacing). Closes #6983.
2020-12-28Docx writer: fix nested tables with captions.John MacFarlane1-4/+6
Previously we got unreadable content, because docx seems to want a `<w:p>` element (even an empty one) at the end of every table cell. Closes #6983.
2020-12-27Use meta-description instead of description in templates.John MacFarlane1-0/+3
Since this is an attribute value, we need to prepare it in the writer.
2020-12-27Add support for writing nested tables to asciidoc (#6972)timo-a1-7/+32
Added field to WriterState that denotes the current nesting level for traversing tables. Depending on the value of that field nested tables are recognized and written. Asciidoc supports one level of nesting. If deeper tables are to be written, they are omitted and a warning is issued.
2020-12-27Powerpoint writer: allow arbitrary OOXML in raw inline elementsAlbert Krewinkel1-22/+27
The raw text is now included verbatim in the output. Previously is was parsed into XML elements, which prevented the inclusion of partial XML snippets.
2020-12-20HTML writer: don't include p tags in CSL bibliography entries.John MacFarlane1-2/+7
Fixes a regression in 2.11.3. Closes #6966
2020-12-20LaTeX writer: support colspans and rowspans in tables. (#6950)Albert Krewinkel4-96/+236
Note that the multirow package is needed for rowspans. It is included in the latex template under a variable, so that it won't be used unless needed for a table.
2020-12-15Properly handle boolean values in writing YAML metadata.John MacFarlane2-2/+3
(Markdown writer.) This requires doctemplates >= 0.9. Closes #6388.
2020-12-13RST writer: better image handling.John MacFarlane1-9/+21
- An image alone in its paragraph (but not a figure) is now rendered as an independent image, with an `alt` attribute if a description is supplied. - An inline image that is not alone in its paragraph will be rendered, as before, using a substitution. Such an image cannot have a "center", "left", or "right" alignment, so the classes `align-center`, `align-left`, or `align-right` are ignored. However, `align-top`, `align-middle`, `align-bottom` will generate a corresponding `align` attribute. Closes #6948.
2020-12-13Docx writer: keep raw openxml strings verbatim.Albert Krewinkel1-2/+5
Closes: #6933
2020-12-13Docx writer: use Content instead of Element.Albert Krewinkel1-59/+75
2020-12-12Merge pull request #6946 from mb21/icml-image-fitJohn MacFarlane1-1/+6
ICML writer: fix image bounding box for custom widths/heights
2020-12-12LaTeX writer: extract table handling into separate module.Albert Krewinkel5-237/+355
2020-12-12ICML writer: fix image bounding box for custom widths/heightsmb211-1/+6
fixes #6936
2020-12-07Merge pull request #6922 from jtojnar/db-writer-admonitionsJohn MacFarlane1-19/+45
Docbook writer: handle admonitions
2020-12-07Docbook writer: Handle admonition titles from Markdown readerJan Tojnar1-0/+2
Docbook reader produces a `Div` with `title` class for `<title>` element within an “admonition” element. Markdown writer then turns this into a fenced div with `title` class attribute. Since fenced divs are block elements, their content is recognized as a paragraph by the Markdown reader. This is an issue for Docbook writer because it would produce an invalid DocBook document from such AST – the `<title>` element can only contain “inline” elements. Let’s handle this invalid special case separately by unwrapping the paragraph before creating the `<title>` element.
2020-12-07Docbook writer: Use correct id attribute consistentlyJan Tojnar1-10/+16
DocBook5 should always use xml:id instead of id so let’s use it everywhere.
2020-12-07Docbook writer: handle admonitionsJan Tojnar1-12/+30
Similarly to https://github.com/jgm/pandoc/commit/d6fdfe6f2bba2a8ed25d6c9f11861774001f7a91, we should handle admonitions.
2020-12-05OpenDocument writer: Allow references for internal links (#6774)Nils Carlson1-18/+73
This commit adds two extensions to the OpenDocument writer, `xrefs_name` and `xrefs_number`. Links to headings, figures and tables inside the document are substituted with cross-references that will use the name or caption of the referenced item for `xrefs_name` or the number for `xrefs_number`. For the `xrefs_number` to be useful heading numbers must be enabled in the generated document and table and figure captions must be enabled using for example the `native_numbering` extension. In order for numbers and reference text to be updated the generated document must be refreshed. Co-authored-by: Nils Carlson <nils.carlson@ludd.ltu.se>
2020-12-04Docbook writer: add XML namespaces to top-level elements (#6923)Jan Tojnar1-8/+20
Previously, we only added xmlns attributes to chapter elements, even when running with --top-level-division=section. Let’s add the namespaces to part and section elements too, when they are the selected top-level divisions. We do not need to add namespaces to documents produced with --standalone flag, since those will already have xmlns attribute on the root element in the template.
2020-12-04Markdown writer: ensure that a new csl-block begins on a new line.John MacFarlane1-1/+6
This just looks better and doesn't affect the semantics. See #6921.
2020-12-04LaTeX writer: Fix bug with nested csl- display Spans.John MacFarlane1-36/+32
See #6921.
2020-12-04HTML writer: Fix handling of nested csl- display spans.John MacFarlane1-20/+12
Previously inner Spans used to represent CSL display attributes were not rendered as div tags. See #6921.
2020-12-03EPUB writer: include title page in landmarks.John MacFarlane1-2/+7
Closes #6919. Note that the toc is also included if `--toc` is specified.
2020-12-03EPUB writer: add frontmatter type on body element for nav.xhtml.John MacFarlane1-1/+3
Closes #6918.
2020-12-03Docx writer: Support bold and italic in "complex script."John MacFarlane1-2/+6
Previously bold and italics didn't work properly in LTR text. This commit causes the w:bCs and w:iCs attributes to be used, in addition to w:b and w:i, for bold and italics respectively. Closes #6911.
2020-11-26Docx writer: Fix bullets/lists indentationcholonam1-3/+3
Fix appearance of bullets/numbered lists (the first level is slightly indented to the right instead of right on the margin). New golden files have been tested using Word 2010 on Windows 10.
2020-11-25LaTeX writer: improve longtable output.John MacFarlane1-40/+60
- Don't create minipages for regular paragraphs. - Put width and alignment information in the longtable column descriptors. - Closes #6883.
2020-11-25LaTeX tables: Fix calculation of column spacing.John MacFarlane1-1/+1
See #6883.
2020-11-22OpenDocument Writer: Implement Div and Span ident support (#6755)Nils Carlson1-10/+33
Spans and Divs containing an ident in the Attr will become bookmarks or sections with idents in OpenDocument format.
2020-11-22LaTeX writer: Improve table spacing.John MacFarlane1-2/+2
+ Remove the `\strut` that was added at the end of minipage environments in cells. + Replace `\tabularnewline` with `\\ \addlinespace`. Closes #6842, closes #6860.