Commit graph

1177 commits

Author SHA1 Message Date
John MacFarlane
10615420de Include trailing {}s in raw latex commands.
Change is in rawLaTeXInline in LaTeX reader, but
it affects the markdown reader and other readers
that allow raw LaTeX.

Previously, trailing `{}` would be included for
unknown commands, but not for known commands.
However, they are sometimes used to avoid a trailing
space after the command.  The chances that a `{}`
after a LaTeX command is not part of the command
are very small.

Closes #5439.
2019-06-04 21:20:11 -07:00
John MacFarlane
f82d91eb49 Markdown reader: don't create implicit reference for empty header.
Closes #5549.
2019-06-04 08:39:54 -07:00
John MacFarlane
928681ca04 Avoid unwanted interpretation of def list term as other kind of block,
e.g. ordered list item, in Markdown writer.

Closes #554.
2019-06-03 09:51:19 -07:00
Albert Krewinkel
7db3d9ab04
Textile writer: fix closing tag for math output
Opening and closing tag for math output match now.
2019-06-01 10:16:00 +02:00
Albert Krewinkel
f7222370af
Lua modules: test pandoc.mediabag 2019-05-30 08:44:40 +02:00
Albert Krewinkel
3c3e9a12cd
Lua Version type: shorten "version too old" message 2019-05-29 22:59:45 +02:00
John MacFarlane
e871d65b67
Merge pull request #5526 from tarleb/richer-version-type
Lua: add Version type to simplify comparisons
2019-05-29 12:05:04 -04:00
John MacFarlane
1de7b20ebb
Merge pull request #5497 from mb21/html-writer-video-audio
Output HTML5 video and audio elements
2019-05-29 12:01:12 -04:00
John MacFarlane
970b820f47 HTML reader: misc. epub related fixes.
- With epub extensions, check for epub:type in addition to type.
- Fix problem with noteref parsing which caused block-level
  content to be eaten with the noteref.
- Rename pAnyTag to pAny.
- Refactor note resolution.
2019-05-29 08:15:50 -07:00
Albert Krewinkel
505f5bf5d9
Lua: add Version type to simplify comparisons
Version specifiers like `PANDOC_VERSION` and `PANDOC_API_VERSION` are
turned into `Version` objects. The objects simplify version-appropriate
comparisons while maintaining backward-compatibility.

A function `pandoc.types.Version` is added as part of the newly
introduced module `pandoc.types`, allowing users to create version
objects in scripts.
2019-05-29 10:07:43 +02:00
mb21
a58304e00e HTML writer: output video and audio elements
depending on file extension of the image path
2019-05-29 09:43:50 +02:00
John MacFarlane
2ad5dacf87 Remove command test for #5517.
We need a better test that works cross-platform.
Until then, removing this.

Closes #5528.
2019-05-28 12:45:31 -07:00
Mauro Bieg
3f57f49033 HTML writer: emit empty alt tag in figures (#5518)
The same text is already in the <figcaption> and
screen-readers would read it twice, see #4737
2019-05-28 12:31:41 -04:00
John MacFarlane
8a5b9ac868 Add test for relative file: URI to #5517. 2019-05-28 09:05:28 -07:00
Mauro Bieg
214da7217b Fix handling of file: URL scheme in downloadOrRead (#5522)
Move up the pattern match to be reachable, closes #5517.

Previously `file:/` URLs were handled wrongly and pandoc attempted
to make HTTP requests, which failed.
2019-05-28 11:51:21 -04:00
John MacFarlane
3593dcda61 Use skylighting 0.8. 2019-05-27 12:15:43 -07:00
Mauro Bieg
d07ed83d70 consolidate simple-table detection (#5524)
add `onlySimpleTableCells` to `Text.Pandoc.Shared`

[API change]

This fixes an inconsistency in the HTML reader, which did not treat tables with `<p>` inside cells as simple.
2019-05-27 13:53:19 -04:00
Alexander Krotov
f807f5b383 Muse reader: allow images inside link descriptions 2019-05-25 19:17:16 +03:00
Alexander Krotov
7514277454 HTML reader: trim definition list terms 2019-05-25 18:36:56 +03:00
Alexander Krotov
19f9eed0bb Muse writer: do not escape empty line after <br> 2019-05-25 17:54:31 +03:00
John MacFarlane
aef71894ce Markdown writer: Ensure the code fence is long enough.
Previously too few backticks were used when the code block
contained an indented line of backticks.  (Ditto tildes.)

Cloess #5519.
2019-05-22 15:21:15 -07:00
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
Albert Krewinkel
6208d4e7fc Improve output of Lua tests (#5499)
This makes use of tasty-lua, a package to write tests in Lua
and integrate the results into Tasty output. Test output becomes
more informative: individual tests and test groups become visible
in test output. Failures are reported with helpful error messages.
2019-05-20 12:52:28 -04: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
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
Mauro Bieg
1d033a2691 add test/tables.xwiki to git and pandoc.cabal (#5498) 2019-05-12 10:37:37 -04: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
5c7ad59ffe FB2 reader: add notes parsing test 2019-05-11 12:10:20 +00: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
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
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
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
Alexander Krotov
2b2d9baaa8 Muse writer tests: compare Text without converting to [Char] 2019-04-28 03:21:14 +03: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
6d19c08e9f LaTeX template: Add pdflang to hypersetup if lang is set.
Closes #5443.
2019-04-11 16:58:36 -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
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
7ac860be74 PowerPoint tests: Regenerate golden files
Due to viewProps change in 61dc0f9f.

Golden files checked on PowerPoint 2013 (Win 10 on virtualbox).
2019-04-04 10:46:30 -04:00
John MacFarlane
23df94e30a Update command test #5416 to make it windows friendly 2019-04-02 17:59:47 -07:00
Andrew Dunning
3d1409347a LaTeX template: Ensure correct heading/table order (#5421)
Improve the workaround for #1658, adapting a solution by @u-fischer in
<https://github.com/latex3/latex2e/issues/131> that works whether or not
the `indent` variable is enabled.

Remove `subparagraph` variable in LaTeX template.  The default is now
to use run-in style for level 4 and 5 headings (`\paragraph` and `\subparagraph`).
To get the previous default behavior (where these were formatted as blocks,
like `\subsubsection`), set the `block-headings` variable.

An example is given in the manual of reformatting the appearance of headings
more thoroughly using KOMA-Script.

Closes #5365.
2019-04-02 18:18:36 -06:00
John MacFarlane
40b60a911c Actually run the xwiki writer tests. 2019-04-02 17:11:35 -07:00
Derek Chen-Becker
45944b51a0 Add XWiki Support (#4167)
Add XWiki Support

Closes #1800
2019-04-02 17:27:02 -06:00
Mauro Bieg
0fa6951dc1 Dokuwiki Reader fix: parse single curly brace (#5417)
fixes #5416
2019-04-01 11:36:47 -06:00
Jesse Rosenthal
0d1fc7dfff PowerPoint writer: add test for speaker notes after metadata. 2019-03-31 17:09:00 -04:00
Jesse Rosenthal
efa6304eee Pptx writer: test for speaker notes after breaking header. 2019-03-30 22:52:31 -04:00
John MacFarlane
93ee73e1dc LaTeX writer: Avoid inadvertently creating ? or ! ligatures.
These are upside down ? and !, resp.

Closes #5407.
2019-03-29 10:04:22 -07:00
John MacFarlane
40865958ce Markdown reader: fenced div takes priority over setext header.
For

    ::: {.cell}
    ---
    :::
2019-03-28 17:39:22 -07:00
Andrew Dunning
c21db81efd LaTeX template: Add pandoc to PDF metadata (#5388)
Credits pandoc in content creator metadata (the default is 'LaTeX with hyperref').
2019-03-25 22:36:14 -06:00
John MacFarlane
052684712b HTML reader: read data-foo attribute into foo.
The HTML writer adds the `data-` prefix for HTML5
for nonstandard attributes.  But the attributes are
represented in the AST without the `data-` prefix,
so we should strip this when reading HTML.

Closes #5392.
2019-03-25 08:43:59 -07:00
Andrew Dunning
e91af0a8a3 LaTeX template: Group graphics-related code (#5389)
* LaTeX template: Group graphics-related code

The default figure placement was added in <f3ab4bc2b9>; there does not appear to have been a reason for placing it at the end of the preamble.

* Update tests
2019-03-22 22:35:55 -06:00
John MacFarlane
1e60776226 LaTeX writer: Fix footnotes in table caption and cells.
This fixes a bug wherein footnotes appeared in the wrong
order, and with duplicate numbers, when in table captions
and cells.

We now use regular `\footnote` commands, even in the table
caption and the minipages containing cells. Apparently
longtable knows how to handle this.

Closes #5367.
2019-03-22 11:55:41 -07:00
John MacFarlane
66e5f0ff8d Docx writer: Use w:br without attributes for line breaks.
We previously added the attribute `type="textWrapping"`, but
this causes problems on Word Online.

Closes #5377.
2019-03-21 09:28:16 -07:00
John MacFarlane
6be8f4e953 Improved fix to #5340 and added test. 2019-03-18 16:53:36 -07:00
John MacFarlane
3880a23de9 Properly escape attributes in Markdown writer.
Closes #5369.
2019-03-17 18:15:47 -07:00
John MacFarlane
ebd7035a2a Add test case for #5368. 2019-03-17 18:02:59 -07:00
John MacFarlane
5b385d2e66 Tests.Old: specify --data-dir=../data.
Remove old pandoc_datadir environment variable, which
doesn't do anything.
2019-03-13 17:44:07 -07:00
Andrew Dunning
bbe2da390e LaTeX template: Improve readability (#5363)
+ LaTeX template: Improve template readability
  Use `hidelinks` option for hyperref, which has the same effect as `pdfborder={0 0 0}`,
  but its purpose is clearer. Use a simpler conditional for Polyglossia/Babel. Format
  comments more consistently.
+ Update tests
+ Remove hyperref breaklinks option.  According to the documentation, hyperref
  sets this automatically as appropriate to the driver.
2019-03-13 18:22:28 -06:00
Andrew Dunning
8d58c61702 LaTeX reader test: Allow compilation of file (#5364)
The test could not compile in LaTeX due to missing `setspace` package. Remove redundant packages.
2019-03-13 18:21:00 -06:00
John MacFarlane
b7cbd7b8c9 docx writer: avoid extra copy of abstractNum and num elements...
...in numbering.xml.  This caused pandoc-produced docx files to
be uneditable using Word Online.

The problem was that recent versions of reference.docx include
samples of various kinds of text, including lists.  The
numering elements for these were getting copied over to
the new docx, where they clashed with the autogenerated
elements produced by pandoc.  This didn't confuse Desktop
Word, but it did confuse Word Online.

Closes #5358.
2019-03-11 22:09:21 -07:00
John MacFarlane
e405d7b532 Include execution output in ipynb test. 2019-03-09 16:53:53 -08:00
John MacFarlane
873f342f11 Ipynb reader/writer: better handling of cell metadata.
We now handle even complex cell metadata in the Div's attributes.
Simple metadata fields are rendered as a plain string, and complex ones
as JSON.
2019-03-09 14:27:34 -08:00
Andrew Dunning
d7f56f8189 LaTeX template: Robust section numbering removal (#5351)
Ensures that section numbering does not reappear with custom section levels. See <https://tex.stackexchange.com/questions/473653/>.

Update tests
2019-03-04 16:58:20 -07:00
John MacFarlane
0bed0ab5a3 Use XDG data directory for user data directory.
Instead of `$HOME/.pandoc`, the default user data directory is
now `$XDG_DATA_HOME/pandoc`, where `XDG_DATA_HOME` defaults to
`$HOME/.local/share` but can be overridden by setting the environment
variable.

If this directory is missing, then `$HOME/.pandoc` is searched
instead, for backwards compatibility.  However, we recommend
moving local pandoc data files from `$HOME/.pandoc` to
`$HOME/.local/share/pandoc`.

On Windows the default user data directory remains the same.

Closes #3582.
2019-03-02 15:03:59 -08:00
Jesse Rosenthal
a908129d93 Powerpoint writer: add tests for underline. 2019-02-27 09:30:50 -05:00
John MacFarlane
ba05e1ea02 Shared.compactify: Avoid mixed lists.
This improves on the original fix to #5285 by preventing
other mixed lists (lists with a mix of Plain and Para
elements) that were allowed given the original fix.
2019-02-25 17:33:54 -08:00
John MacFarlane
38c028bd50 JATS reader: fix parsing of figures.
This ensures that a figure containing a single image
is parsed as a pandoc "implicit figure" (i.e., a
Para with a single Image whose title attribute begins
with `fig:`).  More complex figures will still be parsed
as divs.

Closes #5321.
2019-02-23 15:40:06 -07:00
John
c75b558cbc Add section identifiers support for FB2 writer (#5315)
Closes #5229.
2019-02-22 00:43:43 -07:00
Jesse Rosenthal
83d2a5131d Docx reader tests: fix test file with trailing space.
This failed due to the fix of #5273.
2019-02-18 15:49:36 -05:00
Jesse Rosenthal
9a1a3fe482 Docx reader: add tests for trimming last inline. 2019-02-18 15:49:00 -05:00
Alexander Krotov
c4814ea965 Muse reader: add secondary note support 2019-02-18 15:21:32 +03:00
Alexander Krotov
2c7c8a6f40 Muse writer: escape secondary notes 2019-02-18 15:21:32 +03:00
John MacFarlane
d7d1c9c8e4 Markdown reader: fix bug parsing fenced code blocks.
Previously parsing would break if the code block
contained a string of backticks of sufficient length
followed by something other than end of line.

Closes #5304.
2019-02-15 22:34:32 -08:00
Jesse Rosenthal
332e2ba5b6 Docx reader: Add test for reading sdts in footnotes. 2019-02-12 17:26:37 -05:00
John MacFarlane
b6cf490efd Use latest skylighting. 2019-02-10 08:06:53 -08:00
Mauro Bieg
d0a5f2aded JATS writer: wrap figure caption in <p> to fix validation (#5292)
closes #5290
2019-02-10 07:22:12 -08:00
John MacFarlane
1cdbb896f6 Added simple ipynb reader/writer tests.
Closes #5274.
2019-02-09 14:53:30 -08:00
John MacFarlane
4543543063 Fixed asciidoc display math in list contexts. 2019-02-09 11:02:19 -08:00
TG
8c2e2435f9 Asciidoctor writer sets the stem attribute if it contains latexmath 2019-02-09 08:21:53 -08:00
TG
568b25d33a Adds Asciidoctor sprcific writer and tests 2019-02-09 08:21:53 -08:00
TG
8fdeae2872 AsciiDoc Writer: DisplayMath as asciidoc latexmath block 2019-02-09 08:20:56 -08:00
John MacFarlane
47537d26db Improve tight/loose list handling.
Closes #5285. Previously the algorithm allowed list items
with a mix of Para and Plain, which is never wanted.

compactify in T.P.Shared has been modified so that, if
a list's items contain (at the top level) Para elements
(aside from perhaps at the very end), ALL Plains are
converted to Paras.
2019-02-08 23:16:01 -08:00
Jesse Rosenthal
1847bdbb83 Docx reader: Tests for alternate document.xml 2019-02-06 21:14:46 -05:00
Alexander Krotov
59fa4eb17e Muse reader: test that block level markup does not break <verbatim> 2019-02-06 02:25:24 +03:00
Albert Krewinkel
37a82b0b11 Add missing copyright notices and remove license boilerplate (#5112)
Quite a few modules were missing copyright notices.

This commit adds copyright notices everywhere via haddock module
headers.  The old license boilerplate comment is redundant with this and has
been removed.

Update copyright years to 2019.

Closes #4592.
2019-02-04 13:52:31 -08:00
John MacFarlane
ccf4e23ee1 Markdown reader: add newline when parsing blocks in YAML.
Otherwise last block gets parsed as a Plain rather than
a Para.

This is a regression in pandoc 2.x.  This patch restores
pandoc 1.19 behavior.

Closes #5271.
2019-02-04 10:22:02 -08:00
John MacFarlane
b74267406b Update test for last commit. 2019-02-02 16:20:06 -08:00
John MacFarlane
b062117ef4 HTML5 writer: implement WAI-ARIA roles for (end)notes.
See #4213.
2019-02-02 16:14:58 -08:00
John MacFarlane
633a9ecfec LaTeX writer: avoid {} after control sequences when escaping.
`\ldots{}.` doesn't behave as well as `\ldots.` with the latex
ellipsis package.  This patch causes pandoc to avoid emitting
the `{}` when it is not necessary.  Now `\ldots` and other
control sequences used in escaping will be followed by either
a `{}`, a space, or nothing, depending on context.

Thanks to Elliott Slaughter for the suggestion.
2019-02-01 21:17:46 -08:00
John MacFarlane
e752669e50 LaTeX reader: don't let \egroup match {.
`braced` now actually requires nested braces.
Otherwise some legitimate command and environment
definitions can break (see test/command/tex-group.md).
2019-01-31 22:50:51 -08:00
John MacFarlane
7c424b315c Tests: avoid calling findPandoc multiple times. 2019-01-31 20:56:20 -08:00
John MacFarlane
fdf7f07f62 Old tests: remove need for temp files by using pipeProcess. 2019-01-31 17:25:36 -08:00
leungbk
ac83b9c37c Org reader: add support for #+SELECT_TAGS. 2019-01-30 18:27:38 +01:00
Agustín Martín Barbero
9894d05fe3 Improve writing metadata for docx, pptx and odt (#5252)
* docx writer: support custom properties.  Solves the writer part of #3024.
  Also supports additional core properties:  `subject`, `lang`, `category`,
  `description`.

* odt writer: improve standard properties, including the following core properties:
  `generator` (Pandoc/VERSION), `description`, `subject`, `keywords`,
  `initial-creator` (from authors), `creation-date` (actual creation date).
  Also fix date.

* pptx writer: support custom properties.  Also supports additional core
  properties: `subject`, `category`, `description`.

* Includes golden tests.

* MANUAL: document metadata support for docx, odt, pptx writers
2019-01-26 16:14:35 -08:00
John MacFarlane
a5ac58f82f MediaWiki reader: use _ instead of - in auto-identifiers.
Partially addresses #4731.
We may not still be exactly matching mediawiki's algorithm
for identifiers.
2019-01-25 17:10:49 -08:00
John MacFarlane
7ccaa77797 LaTeX template: Set default listings language for lua, assembler.
Otherwise we get an error when trying to compile code
with lua or assembler code.

To change the default dialect (currenty 5.3 for lua
and x86masm for assembler), you can use `--include-in-header`
to inject something like

    \lstset{defaultdialect=[5.2]Lua}

Closes #5227.
2019-01-25 16:22:56 -08:00
John MacFarlane
5ddd7b121e LaTeX reader: support \endinput. Closes #5233. 2019-01-22 21:39:26 -08:00
Andrew Dunning
3ad2255717 LaTeX template: Respect numbersections for books (#5235)
Ensure that `\part` and `\chapter` are only numbered if `numbersections` is set. To return to the previous behaviour, use `-V numbersections -V secnumdepth=0`.

Notes on secnumdepth:

1 = Number `\section`
0 = Number `\chapter`
-1 = Number `\part`
-2 = No numbering
2019-01-22 21:11:13 -08:00
John MacFarlane
f86ac89383 HTML and markdown: treat textarea as a verbatim environment.
We don't want to parse its contents as Markdown or HTML.

Closes #5241.
2019-01-21 20:54:12 -08:00
Albert Krewinkel
bbf37dee8e Fix tests for sample custom writer tables 2019-01-16 13:30:16 +01:00
Albert Krewinkel
42a7b80c04
data/pandoc.lua: auto-fix nested constructor arguments
Incorrect types to pandoc element constructors are automatically
converted to the correct types when possible. This was already done for
most constructors, but conversions are now also done for nested
types (like lists of lists).
2019-01-13 17:14:10 +01:00
Andrew Dunning
96892ea8d7 LaTeX template: Simplify fontspec usage (#5218)
Simplify the approach of #5212, ensuring that `mainfont` is used as the base font for scaling and that LuaLaTeX does not display the mono font with TeX ligatures (as it does not use the `Mapping=tex-ansi` option).

With a modified version of `\defaultfontfeatures`, fontspec will continue to report scaling against the old default font in the log, but it nonetheless displays main font at the specified size. Using this rather than setting `Scale=MatchLowercase` for each family individually means that users will not lose scaling when upgrading to the new template if they were using other font options. Scaling can be disabled for an individual family by adding the option `Scale=1` to `sansfontoptions`, `monofontoptions`, etc.

Remove the `\setromanfont` command added in #4665, as this is not documented in the fontspec manual and appears to be a deprecated alias for `\setmainfont`.

For the release notes, I should also add that one can imitate the previous appearance with `-V mainfontoptions="Scale=MatchLowercase"`.
2019-01-12 17:39:47 -08:00
Andrew Dunning
666bf8ac5c LaTeX template: Prevent scaling of main font (#5212)
When `Scale=MatchLowercase` is set as a default font option, this scales `mainfont` against the old default, meaning that it resizes whatever is set as the main font to match the metrics of Latin Modern. This can result, for example, in a document set to 12pt appearing in 11pt or 13pt. Setting this option for individual families allows everything to scale against the main font, and permits the user to override the setting if desired. Note that it is not necessary to specify `Ligatures=TeX`, as this is already set by default for the appropriate families. See the `fontspec` manual: <https://ctan.org/pkg/fontspec>.

Those who specify font-options in metadata may need to add `Scale=MatchLowercase`, which will now only be provided if `(roman|sans|math|mono)fontoptions` aren't given explicitly.
2019-01-10 11:24:27 -08:00
Brian Leung
35971495ab RST reader: change treatment of number-lines directives. (#5207)
Directives of this type without numeric inputs should not have a
`startFrom` attribute; with a blank value, the writers can produce
extra whitespace.
2019-01-09 22:19:26 -08:00
John MacFarlane
8673eb079b Removed superfluous sourceCode class on code blocks.
* These were added by the RST reader and, for literate Haskell,
  by the Markdown and LaTeX readers.  There is no point to
  this class, and it is not applied consistently by all readers.
  See #5047.

* Reverse order of `literate` and `haskell` classes on code blocks
  when parsing literate Haskell. Better if `haskell` comes first.
2019-01-08 11:36:33 -08:00
John MacFarlane
599327bee1 Asciidoc writer: shorter delimiters for tables, blockquotes.
This matches asciidoctor reference docs.

Closes #4364.
2019-01-07 22:10:34 -08:00
Brian Leung
9dbcf16161 Org reader: handle minlevel option differently. (#5190)
When `minlevel` exceeds the original minimum level observed in the
file to be included, every heading should be shifted rightward.
2019-01-07 20:28:47 -08:00
Alexander
40c30a9d88 Add DokuWiki reader (#5108)
Closes #1792
2019-01-06 15:06:32 -08:00
John MacFarlane
4ac036fe13 Cleaned up findPandoc. 2019-01-04 20:14:24 -08:00
John MacFarlane
fc87925b77 Tests: Fix findPandoc to work with Windows. 2019-01-04 18:36:15 -08:00
John MacFarlane
ae4a5f4858 Fix findPandoc so it works with cabalv2. 2019-01-04 17:44:26 -08:00
John MacFarlane
9746938d06
LaTeX Template: Improve package selections (#5193)
* Use Babel for LuaTeX.  There are a number of bugs in Polyglossia under LuaLaTeX with common languages, e.g. <https://github.com/reutenauer/polyglossia/issues/182>.

* Load xcolor. The `xcolor` package must be loaded before the `footnote` package, which we load to fix foonotes in tables. Closes #4861.

* Load xurl if available. This breaks URLs in more locations. Only available with TeX Live 2018 and later.

* Remove obsolete fixltx2e package

* Reindent. Use two spaces to be consistent internally and with other templates.

* Use `bookmark` if available. The `bookmark` package can sometimes correct the levels of headings where `hyperref` cannot: see <https://komascript.de/release3.26>.

* Update LaTeX tests
2019-01-03 10:47:48 -08:00
Andrew Dunning
f3709ccba3 LaTeX template: Require xcolor 2019-01-02 22:34:17 -05:00
Mauro Bieg
f1d83aea12 Implement task lists (#5139)
Closes #3051
2019-01-02 11:36:37 -08:00
John MacFarlane
ea8af33dab Commonmark writer: fix handling of SoftBreak with hard_line_breaks.
This should be rendered as a space.
Closes #5195.
2019-01-02 10:31:13 -08:00
Andrew Dunning
2c0af6e3a3 Update LaTeX tests 2019-01-01 17:47:02 -05:00
damien clochard
4ab2a46bdc Zimwiki writer: remove automatic colon prefix before internal images (#5183)
* FIX #5183 : zimwiki : remove automatic colon prefix before internal images

![](foo.png) should be converted to {{foo.png}} (relative path)
![](/foo.png] should be converted to {{/foo.png}} (absolute path)

Therefore the ':' prefix is useless and must be removed.

I never used the zimwiki, but i submitted the similar dokuwiki fix.

1. The zimwiki syntax is inspired by dokuwiki
2. The zimwiki documentation does not mention the colon character for images
3. The pandoc zimwiki writer seems to be a copy-paste for the dokuwiki writer

If the PR #5184 is applied, I think this one should be applied too.
2019-01-01 14:08:38 -08:00
damien clochard
814e97df92 Dokuwiki writer: remove automatic ':' prefix before internal image links (#5183)
* FIX #5183 : remove automatic ':' prefix before internal image links

`![](foo.png)` should be converted to `{{foo.png}}` (relative path)
`![](/foo.png]` should be converted to `{{/foo.png}}` (absolute path)

Therefore the ':' prefix is useless and must be removed.
It blocks users from making relative image links.

Update tests for DokuWiki Writer : external images
2019-01-01 14:07:26 -08:00
Albert Krewinkel
2f92261d87
Org reader: fix self-link parsing regression
Fixes a regression introduced by the previous commit.
2019-01-01 22:06:44 +01:00
Albert Krewinkel
c0caaaeabb
Org reader: fix treatment of links to images
Links with descriptions which are pointing to images are no longer read
as inline images, but as proper links.

Fixes: #5191
2019-01-01 21:03:38 +01:00
John MacFarlane
ffc2192caf Simplify/fix reading of --metadata values on command line.
Previously we used HsYAML's decodeStrict to recognize
boolean values (treating everything else as a string).
This caused problems relating to hvr/HsYAML#7.

We now just check for the recognized boolean values
`true|True|TRUE|false|False|FALSE`, and avoid using
HsYAML.

Closes #5177.
2018-12-31 21:20:56 -08:00
leungbk
c998b937c1 Org writer: preserve line-numbering for example and code blocks. 2018-12-28 15:07:05 +01:00
Alexander Krotov
5101f4324b Muse reader tests: test #cover directive 2018-12-25 15:23:02 +03:00
John MacFarlane
9fe6d91a1a Remove unnecessary type="text/css" on style and link for HTML5.
Closes #5146.
2018-12-14 11:29:35 -08:00
John MacFarlane
ee60ba5252 Man/Ms writers: don't escape - as \-.
For discussion see
https://groups.google.com/forum/#!msg/pandoc-discuss/B-oiCXcQOVo/WO-BXVpICAAJ

The `\-` gets rendered in HTML and PDF as a unicode minus sign.
2018-12-13 11:24:51 -08:00
Enno
dc8caf10df template:latex: make @ letter before using it (#5145)
This fixes the previous commit for parskip and KOMA classes.
2018-12-11 16:21:45 -05:00
Enno
84147eeff1 Let KOMA document class handle parskip when applicable (#5143)
This is just a change to the default latex template.
2018-12-11 13:22:31 -05:00
Jesse Rosenthal
0f736d778f Docx: add test for lists with level overrides. 2018-12-10 19:24:56 -05:00
John MacFarlane
d5e68d43be RST writer: don't wrap simple table header lines.
Closes #5128.
2018-12-05 17:10:33 -08:00
John MacFarlane
38200c0291 Strip out illegal XML characters in escapeXMLString.
Closes #5119.
2018-12-04 09:24:15 -08:00
John MacFarlane
4060df6891 Markdown writer: include needed whitespace after HTML figure.
We use HTML for a figure in markdown dialects that can't
represent it natively.

Closes #5121.
2018-12-03 15:10:13 -08:00
John MacFarlane
049a773b5b Fix custom tests. 2018-11-29 11:04:08 -08:00
John MacFarlane
77a40d6f34 MediaWiki writer: fix caption, use 'thumb' instead of 'frame'.
Captions used to have the word 'caption' prepended; this
has been removed.

Also, 'thumb' is used instead of 'frame' to allow images
to be resized.

Closes #5105.
2018-11-27 14:45:39 -08:00
John MacFarlane
83c0789205 Added test for #5053.
Note that the fix for #5099 also fixes #5053, a pandoc 2.4
regression in parsing underscore emphasis after symbols.
2018-11-25 22:50:16 -08:00
John MacFarlane
edc651059e Fix parsing of citations and quotes after parentheses.
Starting with pandoc 2.4, citations and quoted inlines
were no longer recognized after parentheses.  This is
because of commit 9b0bd4ec6f,
which is reverted here.

The point of that commit was to allow relocation of
soft line breaks to before an abbreviation, so that
a nonbreaking space could be added after the
abbreviation.  Now we simply leave the soft line
break in place, even though this means that
we won't get a nonbreaking space after "Mr."
at the end of a line (and in LaTeX this may
result in a longer intersentential space).
Those who care about this issue should take care
not to end lines with an abbreviation, or to
insert nonbreaking spaces manually.

Closes #5099.
2018-11-25 22:29:54 -08:00
John MacFarlane
c9691b91df OpenDocument writer: small amendment to #5095.
Level one lists should start at 0.5in rather than 0.75in.
(At least this is how LibreOffice behaves for me with a new
document.)
2018-11-22 22:02:08 -05:00
Nils Carlson
eb82fd6b5e ODT writer: Fix list indentation
Previously lists were indented by half an inch on the first line
for each level of nesting. This resulted in lists that looked like
this:

1.      The first line of the list point text
the second line of the same list point.

Fix this and bring style into line with libreoffice standards:

    1.  The first line of the list point text
        the second line of the list point text.
2018-11-22 17:18:09 +00:00
John MacFarlane
191141f27f Fix markdown-citations test for new abbreviations changes. 2018-11-20 23:56:13 -05:00
John MacFarlane
d333c283cc Docx writer: Fix bookmarks to headers with long titles.
Word has a 40 character limit for bookmark names.  In
addition, bookmarks must begin with a letter.  Since
pandoc's auto-generated identifiers may not respect
these constraints, some internal links did not work.

With this change, pandoc uses a bookmark name based
on the SHA1 hash of the identifier when the identifier
isn't a legal bookmark name.

Closes #5091.
2018-11-20 23:43:21 -05:00
John MacFarlane
a5910c0a31 AsciiDoc writer: improve ordered lists.
Use `.`+ as list markers to support nested ordered lists.  Closes #5087.
Support list number styles.  Closes #5089.
2018-11-19 13:17:33 -08:00
John MacFarlane
d532eb14eb HTML reader: allow tfoot before body rows.
Closes #5079.
2018-11-16 11:29:15 -08:00
John MacFarlane
e61f632531 HTML reader: parse <small> as a Span with class "small".
Closes #5080.
2018-11-15 22:36:01 -08:00
John MacFarlane
e61d1d0da9 Asciidoc writer: Render Spans using [#id .class]#contents#.
See #5080.
2018-11-15 22:29:15 -08:00
Alexander Krotov
367e8cac18 Muse reader: trim whitespace before parsing grid table cells 2018-11-14 19:17:05 +03:00
Alexander Krotov
c61b67410a Muse reader: add grid tables support 2018-11-14 17:58:44 +03:00
Alexander Krotov
195b3af8b6 Muse writer: indent simple tables only on the top level 2018-11-14 15:10:38 +03:00