Commit graph

157 commits

Author SHA1 Message Date
Albert Krewinkel
da8c153a68
Org reader: support macros
Closes: #3401
2017-05-06 11:00:32 +02:00
Alexander Krotov
430e6be1f4 Muse writer: omit automatic header identifiers (#3633) 2017-05-04 11:36:52 +02:00
Albert Krewinkel
57cba3f1d5
Org reader: support table.el tables
Closes #3314
2017-05-03 22:43:34 +02:00
David A Roberts
79855ef934 Markdown writer: better escaping for links (#3628)
Previously the Markdown writer would sometimes create links where there
were none in the source.  This is now avoided by selectively escaping bracket
characters when they occur in a place where a link might be created.

Closes #3619.
2017-05-03 12:19:45 +02:00
schrieveslaach
6e55e6837a LaTeX reader: Add support for tabularx environment (#3632) 2017-05-03 12:16:48 +02:00
Mauro Bieg
e02cfcdeac Markdown Writer: put space before reference link definitions
Fixes #3630 (#3631).

Previously the attributes in link reference definitions did not have a space preceding.
2017-05-03 12:13:25 +02:00
David A Roberts
c0192132cf Markdown writer: Case-insensitive reference links. (#3616)
Ensure that we do not generate reference links
whose labels differ only by case.

Also allow implicit reference links when the link
text and label are identical up to case.

Closes #3615.
2017-05-02 09:00:37 +02:00
Albert Krewinkel
ae21a8bb2a
Lua filter: fall-back to global filters when none is returned
The implicitly defined global filter (i.e. all element filtering
functions defined in the global lua environment) is used if no filter is
returned from a lua script. This allows to just write top-level
functions in order to define a lua filter. E.g

    function Emph(elem) return pandoc.Strong(elem.content) end
2017-04-30 17:06:54 +02:00
John MacFarlane
730796ee31 LaTeX writer: Fix problem with escaping in lstinline.
Previously the LaTeX writer created invalid LaTeX
when `--listings` was specified and a code span occured
inside emphasis or another construction.

This is because the characters `%{}\` must be escaped
in lstinline when the listinline occurs in another
command, otherwise they must not be escaped.

To deal with this, adoping Michael Kofler's suggestion,
we always wrap lstinline in a dummy command `\passthrough`,
now defined in the default template if `--listings` is
specified.  This way we can consistently escape the
special characters.

Closes #1629.
2017-04-29 11:05:44 +02:00
John MacFarlane
e76b672414 LaTeX writer: don't use lstinline it \item[..].
If you do, the contents of item disappear or are misplaced.
Use `\texttt` instead.

Closes #645.
2017-04-28 12:03:59 +02:00
Albert Krewinkel
24ef672132 Lua module: provide simple read format parser
A single `read` function parsing pandoc-supported formats is added to
the module. This is simpler and more convenient than the previous method
of exposing all reader functions individually.
2017-04-26 23:28:40 +02:00
Albert Krewinkel
9cd20c9b8b Lua filter: allow filtering of meta data only 2017-04-26 23:28:40 +02:00
schrieveslaach
a29fa15a7b LaTeX reader: Add basic support for hyphenat package (#3603) 2017-04-26 12:05:13 +02:00
schrieveslaach
81548960d5 LaTeX reader: Add support for \vdots (#3607) 2017-04-26 12:03:07 +02:00
John MacFarlane
66b08391b3 HTML line block: Use class instead of style attribute.
We now issue `<div class="line-block">` and include a
default definition for `line-block` in the default
templates, instead of hard-coding a `style` on the
div.

Closes #1623.
2017-04-25 23:07:30 +02:00
John MacFarlane
ee160d7c4c LaTeX writer: fix error with line breaks after empty content.
LaTeX requires something before a line break, so we insert a
`~` if no printable content has yet been emitted.

Closes #2874.
2017-04-25 15:00:27 +02:00
John MacFarlane
d17f0dab84 LaTeX reader: better support for subfigure package.
A figure with two subfigures turns into two pandoc
figures; the subcaptions are used and the main caption
ignored, unless there are no subcaptions.

Closes #3577.
2017-04-24 23:39:14 +02:00
Albert Krewinkel
04cb602d79
Org reader: allow multi-word arguments to src block params
The reader now correctly parses src block parameter list even if
parameter arguments contain multiple words.

Closes: #3477
2017-04-23 13:58:16 +02:00
Albert Krewinkel
2e43e27e5c
Org reader: stop adding rundoc prefix to src params
Source block parameter names are no longer prefixed with *rundoc*. This
was intended to simplify working with the rundoc project, a babel
runner. However, the rundoc project is unmaintained, and adding those
markers is not the reader's job anyway.

The original language that is specified for a source element is now
retained as the `data-org-language` attribute and only added if it
differs from the translated language.
2017-04-23 12:56:11 +02:00
Albert Krewinkel
04658c491b
Org reader: handle line numbering switch for src blocks
The line-numbering switch that can be given to source blocks (`-n` with
an start number as an optional parameter) is parsed and translated to a
class/key-value combination used by highlighting and other readers and
writers.
2017-04-23 11:54:36 +02:00
John MacFarlane
51a46b7e31 HTML reader: Revise treatment of li with id attribute.
Previously we always added an empty div before the list
item, but this created problems with spacing in tight
lists.  Now we do this:

If the list item contents begin with a Plain block,
we modify the Plain block by adding a Span around
its contents.

Otherwise, we add a Div around the contents of the
list item (instead of adding an empty Div to the
beginning, as before).

Closes #3596.
2017-04-23 11:03:48 +02:00
schrieveslaach
020dc63e23 Add siunitx Support (#3588)
For example:


```latex
\SI[round-precision=2]{1}{m} is equal to \SI{1000}{mm}.

\SI[round-precision=2]{1}[\$]{} is equal to \SI{0.938094}{\euro}
```
2017-04-22 21:57:21 +02:00
Albert Krewinkel
464db59394
Org reader: allow emphasized text to be followed by [
Closes: #3577
2017-04-16 21:19:35 +02:00
Albert Krewinkel
56dddcc3f5
Org reader: convert markup at beginning of footnotes
Closes: #3576
2017-04-16 17:22:47 +02:00
Albert Krewinkel
e6a536befc
Lua filter: revert to non-destructuring filters
We want to provide an interface familiar to users of other filtering
libraries.
2017-04-15 21:40:48 +02:00
John MacFarlane
bcc848d773 Avoid parsing "Notes:**" as a bare URI.
This avoids parsing bare URIs that start with a scheme
+ colon + `*`, `_`, or `]`.

Closes #3570.
2017-04-15 13:32:28 +02:00
Albert Krewinkel
3aeed816e1
Lua filter: allow shorthand functions for math and quoted
Allow to use functions named `SingleQuoted`, `DoubleQuoted`,
`DisplayMath`, and `InlineMath` in filters.
2017-04-14 23:43:59 +02:00
Albert Krewinkel
07f41a5515
Lua filter: use destructured functions for block filters
Filtering functions take element components as arguments instead of the
whole block elements. This resembles the way elements are handled in
custom writers.
2017-04-14 11:34:44 +02:00
Albert Krewinkel
425df8fff4
Use lua constructors to push meta values 2017-04-13 22:57:50 +02:00
Albert Krewinkel
2761a38e53
Lua filter: use destructured functions for inline filters
Instead of taking the whole inline element, forcing users to destructure it
themselves, the components of the elements are passed to the filtering
functions.
2017-04-12 20:48:44 +02:00
John MacFarlane
31a36cf186 Man writer: Fix handling of nested font commands.
Previously pandoc emitted incorrect markup for bold + italic, for example,
or bold + code.

Closes #3568.
2017-04-12 12:23:29 +02:00
Albert Krewinkel
41ebdee5df
Lua filter: improve doc filter performance
Pandoc elements are pushed and pulled from the lua stack via custom
instances.
2017-04-07 21:04:22 +02:00
Albert Krewinkel
d412c38c71
Ensure correctness of StackValue instances 2017-04-06 21:00:38 +02:00
John MacFarlane
6b0d3d1582 Ms writer: wider indents for lists.
Previously some indents weren't wide enough, leading
the list item to start on a line after the marker.
2017-04-06 12:45:23 +02:00
John MacFarlane
12ae1df5bf Allow raw latex commands starting with \start in Markdown.
Previously these weren't allowed because they were interpreted
as starting ConTeXt environments, even without a corresponding
\stop...

Closes #3558.
2017-04-06 11:30:03 +02:00
John MacFarlane
12a3481632 Ms writer: respect text wrapping options. 2017-04-05 15:17:35 +02:00
John MacFarlane
48729f9715 Ms writer improvements:
- added some variables to the default template.
- cleaner output for images (stringify alt text).
2017-04-04 17:21:02 +02:00
John MacFarlane
1ebb766aff Ms writer: ensure that @ is escaped in URIs.
Otherwise we may get unescaped @s that give eqn fits,
with @ as the delimiter character.
2017-04-04 16:13:24 +02:00
Timm Albers
3e817124fe Add class to footnote back references
The HTML writer now also adds the class footnoteBack to back references
of footnotes. This allows for easier CSS styling.
2017-04-03 17:02:16 +02:00
Albert Krewinkel
e7eb21ecca
Lua module: add readers submodule
Plain text readers are exposed to lua scripts via the `pandoc.reader`
submodule, which is further subdivided by format.  Converting e.g. a
markdown string into a pandoc document is possible from within lua:

    doc = pandoc.reader.markdown.read_doc("Hello, World!")

A `read_block` convenience function is provided for all formats,
although it will still parse the whole string but return only the first
block as the result.

Custom reader options are not supported yet, default options are used
for all parsing operations.
2017-04-02 17:28:07 +02:00
John MacFarlane
1c84a03509 Ms writer: added syntax highlighting.
Closes #3547.

Macro definitions are inserted in the template when there is highlighted
code.

Limitations: background colors and underline currently not
supported.
2017-04-01 22:05:38 +02:00
John MacFarlane
34b9bee5a4 OpenDocument writer: wider labels for lists.
This avoids overly narrow labels for ordered lists with
() delimiters.

However, arguably it creates overly wide labels for bullets.

Also, lists now start flush with the margin, rather than
indented.

Fixes #2421.
2017-04-01 12:27:40 +02:00
John MacFarlane
8a3ef99882 JATS template: always include <back> element even if empty. 2017-03-31 15:15:34 +02:00
John MacFarlane
3217bc192e JATS writer: put references in <back>.
Modified template to include a `<back>` and `<body>` section.
This should give authors more flexibility, e.g. to put
acknowledgements metadata in `<back>`.  References are
automatically extracted and put into `<back>`.
2017-03-31 11:07:09 +02:00
John MacFarlane
e5e2a6e0a5 JATS writer: use both tex and mml alternatives for math when possible. 2017-03-30 16:22:54 +02:00
John MacFarlane
0d06c632b1 JATS writer: Fixed bibliography handling. 2017-03-30 15:39:21 +02:00
John MacFarlane
9575dfc970 Merge branch 'jats' 2017-03-30 01:17:36 +02:00
John MacFarlane
831e1c5edd Added JATS writer.
* New module Text.Pandoc.Writer.JATS exporting writeJATS.
* New output format `jats`.
* Added tests.
* Revised manual.
2017-03-30 01:16:34 +02:00
schrieveslaach
5fe734d452 lstinline with braces can be used (verb cannot be used with braces) (#3535)
* Fix lstinline handling: lstinline with braces can be used (verb cannot be used with braces)

* Use codeWith and determine the language from lstinline

* Improve code

* Add another test: convert lstinline without language option
2017-03-29 14:49:46 +02:00
schrieveslaach
49d72444d7 LaTeX reader: add support for LaTeX subfiles package.
Closes #3530.
2017-03-27 21:20:27 +02:00