Commit graph

6355 commits

Author SHA1 Message Date
Jesse Rosenthal
ed73bd28e5 Markdown writer: Handle labels with integer names
Previously if labels had integer names, it could produce a conflict
with auto-labeled reference links. Now we test for a conflict and find
the next available integer.

Note that this involves adding a new state variable `stPrevRefs` to
keep track of refs used in other document parts when using
`--reference-location=block|section`

Closes #5495
2019-05-21 12:19:59 -04:00
John MacFarlane
90141e7b4f Add tex_math_dollars to multimarkdownExtensions.
This form is now supported in multimarkdown,
in addition to `tex_math_double_backslash`.

See #5512.
2019-05-18 10:03:09 -07:00
John MacFarlane
e87b54dcad JATS writer: properly handle footnotes.
"Best Practice: When footnotes are grouped at the end of an article,
wrap them in a `<fn-group>` and use an `<xref>` element in the text, as
usual, to tie each footnote in the list to a particular location in the
text."

Closes #5511.
2019-05-16 21:39:03 -07:00
Alexander Krotov
2e13c0a451 FB2 writer: do not wrap note references into <sup> and brackets
Existing FB2 readers, such as FBReader, already display links with type="note" as a superscript.
2019-05-15 13:31:07 +03:00
Alexander Krotov
f1fbec938f hlint FB2 writer 2019-05-15 13:30:14 +03:00
Albert Krewinkel
8b00bc6029
Org reader: fix planning elements in headers level 3 and higher
Planning info is now always placed before the subtree contents.
Previously, the planning info was placed after the content if the
header's subtree was converted to a list, which happens with headers of
level 3 and higher per default.

Fixes: #5494
2019-05-13 22:55:13 +02:00
Albert Krewinkel
00ef03827e
Org reader: omit, but warn about unknown export options
Unknown export options are properly ignored and omitted from the output.
2019-05-13 22:25:04 +02:00
Albert Krewinkel
da9638e6a3
Org writer: always indent src blocks content by 2 spaces
Emacs always uses two spaces when indenting the content of src blocks,
e.g., when exiting a `C-c '` edit-buffer. Pandoc used to indent contents
by the space-equivalent of one tab, but now always uses two spaces, too.

Closes: #5440
2019-05-12 14:49:52 +02:00
Alexander Krotov
c1d9cf7daf FB2 reader: parse notes
Closes #5493
2019-05-11 12:10:20 +00:00
Alexander Krotov
e9343b96bc FB2 reader: use XML.Light.Input.parseXMLDoc to parse the root element 2019-05-11 10:34:17 +03:00
Alexander Krotov
692f88fd8f Reduce the amount of state in FB2 reader 2019-05-11 10:12:08 +03:00
Alexander Krotov
53874d8bd6 FB2 reader: use Text.XML.Light.unqual where possible 2019-05-11 10:07:52 +03:00
John MacFarlane
98ee6ca289 Asciidoc writer: use ` +...+ ` form for inline code.
The old `` `a__b__c` `` yields emphasis inside code in asciidoc.
To get a pure literal code span, use `` `+a__b__c+` ``.
2019-05-05 21:57:30 -07:00
John MacFarlane
5affa30e8a Asciidoc writer: use proper smart quotes with asciidoctor.
Asciidoctor has a different format for smart quotes.
Closes #5487.
2019-05-05 21:47:15 -07:00
John MacFarlane
548ffa38c3 LaTeX writer: don't produce columns environment unless beamer.
The environment is beamer-only and as far as I'm
aware there's no latex package that provides it
for non-beamer use.

Closes #5485.
2019-05-05 07:26:18 -07:00
Albert Krewinkel
33e2d46dbe
Org reader: prefer plain symbols over math symbols
Symbols like `\alpha` are output plain and unemphasized, not as math.

Fixes: #5483
2019-05-05 14:48:37 +02:00
Albert Krewinkel
7e7bc3493e
Org reader: recognize emphasis after TODO/DONE keyword
Fixes: #5484
2019-05-05 13:53:11 +02:00
John MacFarlane
545da6113c HTML writer: don't add variation selector if it's already there.
See f11d0c9dc8
This fixes round-trip failures.
2019-05-04 13:35:44 -07:00
John MacFarlane
fee3258280 Add template variable curdir with working directory
from which pandoc is run.  Closes #5464.
2019-05-04 09:07:50 -07:00
John
2fa8c0dc96 FB2 writer: use genre metadata field (#5478) 2019-05-04 11:56:00 -04:00
John MacFarlane
9dd2eefded JATS writer: fix citations with PMID so they validate.
Closes #5481. This includes an update to data/jats.csl.
2019-05-04 08:45:43 -07:00
John MacFarlane
d73cb5f1a8 Improve c4a81fb941.
We do want to recognize "0" as a number, even though
it has "0" as a prefix.
2019-05-04 08:44:59 -07:00
John MacFarlane
c4a81fb941 metaToJSON: treat digits starting with 0 as a string...
not a number.

Closes #5479.
2019-05-03 22:41:24 -07:00
Albert Krewinkel
786594b23b Lua: add pandoc.system module (#5468)
The `system` Lua module provides utility functions to interact with the
operating- and file system. E.g.

    print(pandoc.system.get_current_directory())

or

    pandoc.system.with_temporary_directory('tikz', function (dir)
      -- write and compile a TikZ file with pdflatex
    end)
2019-05-04 01:06:30 -04:00
John MacFarlane
4f260c96d9 LaTeX reader: Allow newlines in \mintinline. 2019-05-03 10:18:16 -07:00
chinapedia
cfb3726216 MediaWiki reader: handle multiple attributes in table row (#5471) 2019-05-01 20:21:15 -04:00
John MacFarlane
a20323033e Fix footnote in image caption.
Regression!  The fix for #4683 broke this case.
2019-05-01 16:56:37 -07:00
John MacFarlane
f11d0c9dc8 HTML: prevent gratuitious emojification on iOS.
iOS chooses to render a number of Unicode entities,
including '↩', as big colorful emoji.  This can be
defeated by appending Unicode
VARIATION SELECTOR-15'/'VARIATION SELECTOR-16'.
So we now append this character when escaping
strings, for both '↩' and '↔'.

If other characters prove problematic, they can
simply be added to needsVariationSelector.

Closes #5469.
2019-04-30 22:32:52 -07:00
John MacFarlane
66dd2008b0 Fix --self-contained so it works when output format has extensions.
Previously if you used `--self-contained` with `html-smart` or
`html+smart`, it wouldn't work.
2019-04-25 21:56:26 -04:00
John MacFarlane
d88a601642 Allow use of -output-directory in --pdf-engine-opt.
This is currently possible with `mklatex` and `-outdir`, but
was not yet possible with xelatex and `-output-directory`.
Closes #5462.
2019-04-23 10:08:25 -07:00
John MacFarlane
dd344715f6 EPUB writer: Ensure unique ids for styleesheets in content.opf.
Closes #5463.
2019-04-23 09:48:50 -07:00
John MacFarlane
6699471484 HTML writer: Add class="heading" to level 7+ Headers...
rendered as p tags. Closes #5457.
2019-04-20 22:24:24 -07:00
John MacFarlane
e1cc73ed97 Text.Pandoc.PDF: replace </> with literal "/".
We use forward-slash for a directory separator in tmpDir,
even on Windows (because that's what tex likes).  So we
should not put a backslash between the tmpDir and the
filename on Windows.  This is harmless enough in normal
Windows setups, but it breaks on Cygwin.

Closes #5451.  Thanks to @cc2x for noticing and diagnosing
the problem.
2019-04-16 21:12:42 -07:00
John MacFarlane
144b2eabc2 Tigthen up fix to #5446.
We only treat Span as transparent if it has no attributes.
2019-04-16 09:32:19 -07:00
John MacFarlane
e409509a68 RST writer: treat Span as transparent.
Previously an Emph inside a Span was being treated as
nested markup and ignored.  With this patch, the Span
is just ignored.

Closes #5446.
2019-04-15 09:48:11 -07:00
John MacFarlane
8f01044062 LaTeX reader: add braces when resolving \DeclareMathOperator.
These seem to be needed for xelatex but not pdflatex.
Closes #5441.
2019-04-10 21:26:23 -07:00
Mauro Bieg
90dc3a3e13 Asciify.hs: add Turkish undotted-i (#5434)
fixes #5433
2019-04-07 11:01:56 -06:00
John MacFarlane
0c97aceea8 More fixes to beamer table footnotes. 2019-04-05 11:31:18 -07:00
John MacFarlane
708236aa8e LaTeX writer: rename stInMinipage -> stExternalNotes 2019-04-05 11:12:23 -07:00
John MacFarlane
085a893109 Make footnotes work properly in beamer tables.
This fixes a regression in beamer due to the fix to #5367.
We put table footnotes outside the table in beamer, because
footnote/footnotehyper don't work with beamer.
2019-04-05 11:02:24 -07:00
John MacFarlane
4f572ddf69 Vimwiki reader: improve handling of internal links.
1) Don't append `.html`
2) Add `wikilink` title

This mirrors behavior of other wiki readers.  Generally the
`.html` extension is not wanted.  It may be important for
output to HTML in certain circumstances, but it can always
be added using a filter that matches on links with title
`wikilink`.

Note that if you have a workflow that uses pandoc to convert
vimwiki to readable HTML pages, you may need to add such a
filter to reproduce current behavior.

Here is a filter that does the job:

```lua
function Link(el)
    if el.title == 'wikilink' then
      el.target = el.target .. ".html"
    end
    return el
end
```

Save this as `fixlinks.lua` and use with `--lua-filter fixlinks.lua`.

Closes #5414.
2019-04-05 10:04:28 -07:00
Jesse Rosenthal
ba7898bb3d PowerPoint writer code style fix
I had been using record syntax in an ADT, is bad style, since it means
that each record produces a partial function. Fortunately we weren't
using the partial functions anywhere, so this changes it to positional
syntax.
2019-04-05 12:05:08 -04:00
Jesse Rosenthal
ab5c701343 PowerPoint writer: expand builtin reference doc to model all layouts
The previous built-in reference doc had only title and content
layouts. Add in a section-header slide and a two-content slide, so
users can more easily modify it to build their own templates.

Golden files needed to be regenerated. Checked on MS PowerPoint 2013.
2019-04-05 08:50:39 -04:00
Jesse Rosenthal
891ea3112b PowerPoint writer: Always open up in slide view
When editing a template/reference-doc, the user might be in Master
view, but when producing a slide show, it is assumed that slide view
will be desired. This removes the "lastView" attr from the
viewProps.xml slide so that the presentation will always open up in
slide view.

Note this requires creating a new "ppt/viewProps.xml" instead of just
moving over the old one from the viewProps file. Since this produces a
slightly different order of xml files in the content manifest, the
golden files will have to be rebuilt.
2019-04-04 10:46:30 -04:00
John MacFarlane
c4e24c2ccb Add support for go with --listings.
Closes #5427.
2019-04-03 08:02:39 -07:00
John MacFarlane
ef2c970d0e Fix harmless error in file-scope code.
Closes #5422.
2019-04-02 16:33:59 -07:00
Derek Chen-Becker
45944b51a0 Add XWiki Support (#4167)
Add XWiki Support

Closes #1800
2019-04-02 17:27:02 -06:00
Jesse Rosenthal
0abb858a99 PowerPoint writer: Remove handoutsMasterList from template presentation.xml
We don't build it at the moment, so it was causing corruption.
2019-04-01 17:01:07 -04:00
Jesse Rosenthal
9a77da475e PowerPoint writer: Build sp trees correctly
We were previously carrying over too many elements from the layout,
which produced visual artifacts and some corruption. This empties the
sptree (except for properties) after building the shapes, and then
inserts them.

Together with 5e944bf5, fixes #5402

(Note that this addresses the issue and template in that particular
bug report. Other issues will arise no doubt arise with other
templates.)
2019-04-01 15:29:23 -04:00
Jesse Rosenthal
5e944bf5b0 PowerPoint writer: Correct application of reference doc for content
Previously we had applied content shapes based on their index (which
was "1", "2" in MS Word 2013). It turns out that this was a
convention, and could not be relied on. Instead we use a default
type (ie, a ph tag with no "type"). This is more correct, and should
make the application of reference documents in PowerPoint much more
robust.
2019-04-01 14:45:56 -04:00