Commit graph

11966 commits

Author SHA1 Message Date
John MacFarlane
395ea03069 Support ipynb (Jupyter notebook) as input and output format.
[API change]

* Depend on ipynb library.

* Add `ipynb` as input and output format.

* Added Text.Pandoc.Readers.Ipynb (supports both nbformat v3 and v4).

* Added Text.Pandoc.Writers.Ipynb (supports nbformat v4).

* Added ipynb readers and writers to T.P.Readers,
  T.P.Writers, and T.P.Extensions.  Register the
  file extension .ipynb for this format.

* Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error.

* Note: there is no template for ipynb.
2019-01-22 21:45:59 -08:00
John MacFarlane
5ddd7b121e LaTeX reader: support \endinput. Closes #5233. 2019-01-22 21:39:26 -08:00
Andrew Dunning
3707bed4c1 LaTeX template: Use footnotehyper if available (#5234)
Use the [`footnotehyper`](https://ctan.org/pkg/footnotehyper/) package if available.
This is a rewrite of `footnote` that is compatible with `hyperref` and `babel-frenchb`.

This patch also addresses the incompatibility with `xcolor` noted in #4861, but the
new package has only been available since 2016, so this template still loads `xcolor`
earlier for compatibility with older distributions. Note that the `footnote` package 
is part of `collection-latexrecommended` in TeX Live, so there shouldn't be any
problem loading it unconditionally as we now do if `footnotehyper` is not available.
2019-01-22 21:13:09 -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
Lev E. Givon
690193e4e5 Clarify that $ must come right before $. (#5243) 2019-01-22 20:58:18 -08:00
Brian Leung
509336d866 Man reader: fix typo. (#5245) 2019-01-22 20:50:25 -08:00
Andrew Dunning
3560b02f8b LaTeX template: Fix subtitle spacing (#5244)
The `\large` command does not reset the spacing without adding `\par` to the end, which caused `\subtitle` to use the same line spacing as `\title`.
2019-01-22 15:00:27 -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
John MacFarlane
847ff4f83d Mention raw_attribute in documentation for raw_html and raw_tex.
Thanks to @eiro.  Closes #5240.
2019-01-21 20:42:46 -08:00
John MacFarlane
11810edb2f LaTeX reader: allow includes with dots like cc_by_4.0.
Previously the `.0` was interpreted as a file extension,
leading pandoc not to add `.tex` (and thus not to find the
file).

The new behavior matches tex more closely.
2019-01-20 18:22:19 -08:00
John MacFarlane
26dfab2e61 LaTeX reader: cleaned up 'input' code. 2019-01-20 17:35:51 -08:00
Agustín Martín Barbero
fb1f76ddee odt writer: fix typo in custom properties (#5231)
fixes #2839
2019-01-17 16:09:25 -08:00
Albert Krewinkel
bbf37dee8e Fix tests for sample custom writer tables 2019-01-16 13:30:16 +01:00
MichaWiedenmann
02a21117fb sample.lua: Add a missing '>' 2019-01-16 12:34:17 +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
Mauro Bieg
9ac5b9d710
changelog: clarify and fix task_lists description 2019-01-13 15:19:57 +01:00
John MacFarlane
0b99056272 Update changelog, AUTHORS.md. 2019-01-12 23:03:28 -08: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
fd222b811b LaTeX template: Render \subtitle (#5213)
Addresses closed issues #4675, #3896, #1327.

This renders `\subtitle` using the `etoolbox` package if `\subtitle` is not already
defined by the documentclass (as it is in beamer, KOMA, memoir classes).

 Based on an example from Enrico Gregorio, <https://tex.stackexchange.com/a/50186>.

Update list of LaTeX packages.

Note that `etoolbox` must be loaded outside the command definition.
Putting it inside causes an error if `\title` is placed after `\begin{document}`.
It's already loaded on LuaLaTeX/XeLaTeX in any case.
2019-01-11 11:17:53 -08:00
John MacFarlane
24a0d613a8 Make raw content marked beamer work in beamer output.
See pandoc/lua-filters#40.
2019-01-10 12:00:34 -08:00
John MacFarlane
dfd1796cf2 Make 'plain' RawBlocks work for 'plain' output. 2019-01-10 11:55:21 -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
483012552a Allow http-client 0.6. 2019-01-09 08:43:41 -08:00
John MacFarlane
7e481d73cf Beamer writer: avoid duplicated fragile property in some cases.
Closes #5208.
2019-01-09 08:36:24 -08:00
John MacFarlane
253f342a80 EPUB writer: ensure that picture transforms are done on metadata too. 2019-01-08 16:19:54 -08:00
John MacFarlane
b42afe6333 Add zoomKey config to default.revealjs.
Closes #4249. Thanks to @reagle.
2019-01-08 11:43:07 -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
230e07ddfc RST reader: handle sourcecode directive as synonynm for code.
Closes #5204.
2019-01-08 11:11:48 -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
John MacFarlane
c1d058aeb1 revealjs writer: fix some section nesting corner cases.
* Ensure that we don't get > 2 levels of section nesting,
  even with slide level > 2.
* If slide level == N but there is no N-level header, make
  sure the next header with level > N gets treated as a slide
  and put in a section, rather than remaining loose.

Closes #5168.
2019-01-07 21:54:14 -08:00
John MacFarlane
710a22e5ac Org reader: allow for case of :minlevel == 0.
See #5190.
2019-01-07 20:39:40 -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
John MacFarlane
f9d9880325 TWiki reader: fix performance issue with underscores.
Underscore emphasis can't cross table cell boundaries,
but the parser wasn't respecting this, leading to exponential
behavior in documents with table cells containing underscores.

This fixes the original sample; it's possible that there
are other performance issues involving underscores.

Closes #3921.
2019-01-07 20:24:22 -08:00
John MacFarlane
20bce07dd8 Clarified automatic identifiers.
We remove non-alphanumerics.  This includes, e.g., emojis.

Closes #5201.
2019-01-07 15:05:49 -08:00
John MacFarlane
94b24042a3 appveyor - use ghc 8.6.2, cabal 2.4.1.0.
See #5037.
2019-01-07 14:48:43 -08:00
Alexander Krotov
c0e4f66eb3 tools/changelog-helper.sh: use %aN instead of %an to respect .mailmap 2019-01-07 09:18:11 +03:00
Alexander Krotov
a92d6fa5be tools/changelog-helper.sh: remove [[ bashism 2019-01-07 09:17:21 +03:00
Alexander Krotov
ea2e25fd93 Add .mailmap 2019-01-07 08:44:40 +03:00
Alexander
40c30a9d88 Add DokuWiki reader (#5108)
Closes #1792
2019-01-06 15:06:32 -08:00
John MacFarlane
a5f5002eef Use toTableOfContents in Powerpoint writer....
instead of duplicating code.
2019-01-04 21:47:24 -08:00
John MacFarlane
571fede732 RTF writer: use toTableOfContents from T.P.W.Shared. 2019-01-04 21:27:49 -08:00
John MacFarlane
c4c3fca500 Implement --toc in commonmark/gfm writers.
Closes #5172.
2019-01-04 21:20:21 -08:00
John MacFarlane
0d609a72fd T.P.Writers.Shared - add toTableOfContents (API change).
This is refactored out from the Markdown writer.
IT can be used in other writers to create a generic TOC.
2019-01-04 21:09:49 -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
577ad44350 MANUAL: Update list of latex packages used. 2019-01-03 10:53:48 -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