Commit graph

738 commits

Author SHA1 Message Date
Albert Krewinkel
11bb862767 Lua: add a clone() method to all AST elements (#5572)
Closes: #5568
2019-06-12 09:58:38 -07:00
John MacFarlane
9725522a7f Revert "JATS template: don't include journal-meta unless 'journal'..."
This reverts commit 193b5cceba.

journal-meta is required.  Better to include it even if it
doesn't validate through lack of required fields.
2019-06-11 17:31:52 -07:00
John MacFarlane
193b5cceba JATS template: don't include journal-meta unless 'journal'...
...is set in metadata.

Otherwise we get validation errors.
2019-06-11 17:08:40 -07:00
John MacFarlane
5bbaedac57 JATS writer: ensure validity of pub-date.
We try to parse the date and convert to year, month, day,
as expected in pub-date.  We also add an iso-8601-date attribute
if possible.
2019-06-11 17:01:36 -07:00
John MacFarlane
bb68c183b3 JATS writer: don't embed string-name in string.
That's illegal with this DTD.
2019-06-11 16:16:05 -07:00
Albert Krewinkel
7f9b32e36a
data/pandoc.lua: fix deletion of nonexistent attributes
Fixes: #5569
2019-06-11 19:48:00 +02:00
Albert Krewinkel
1c36857465 Add jira writer (#5548)
This adds support for Atlassian's jira markup.

Closes #2497
2019-06-05 17:52:23 -04:00
Daniel Maslowski
d286363f97 Fix using Beamer with geometry (#5505)
Beamer already loads geometry, so we need to use the `\geometry`
command to set geometry options.
2019-05-15 00:18:52 -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
8478997980 EPUB2/3 templates: Move inline styles to default epub.css.
Those who use a custom CSS stylesheet with EPUB should
add these lines:

```css
code{ white-space: pre-wrap; }
span.smallcaps{ font-variant: small-caps; }
span.underline{ text-decoration: underline; }
q { quotes: "“" "”" "‘" "’"; }
div.column{ display: inline-block; vertical-align: top; width: 50%; }
```

See #5466.
2019-05-03 22:25:46 -07:00
Eric Schrijver
63254ae958 Epub3 stylesheet link compatible with kindlegen (#5466)
daamien@411119b removes `type="text/css"` from both `<style>` and `<rel="stylesheet">` elements in all templates. However, Amazon’s kindlegen software relies on this attribute on `<link>` elements when detecting stylesheets to include.
2019-05-04 01:11:10 -04: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
Winnie Hellmann
4a7f5b6d13 Remove reference to head.min.js (#5448)
This file has been removed in 3.8.0: 29b0e86089

Add a note in the changelog that users will need to update reveal.js to at least 3.8.0
for their presentations generated with this version of pandoc to work correctly.
2019-05-01 19:08:12 -04:00
John MacFarlane
6d19c08e9f LaTeX template: Add pdflang to hypersetup if lang is set.
Closes #5443.
2019-04-11 16:58:36 -07:00
ebiiim
bb5e079536 update: default.revealjs follow revealjs 3.8.0 (#5435) 2019-04-07 11:02:50 -06: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
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
Derek Chen-Becker
45944b51a0 Add XWiki Support (#4167)
Add XWiki Support

Closes #1800
2019-04-02 17:27:02 -06:00
John MacFarlane
5fa4ea8eb1 Update data/jats.csl to avoid commas between name-part elements.
Closes #5397.
2019-03-28 21:21:05 -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
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
Andrew Dunning
b3473df417 LaTeX template: Move \setstretch after front matter (#5378)
Ensures that `\maketitle`, `\tableofcontents`, and so forth are not affected by changes to line spacing. Closes #5179 by partially working around <https://github.com/reutenauer/polyglossia/issues/218>.
2019-03-21 23:32:52 -06: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
Cormac Relf
d638873433 Add tectonic as an option for --pdf-engine. (#5346)
Closes #5345

Runs tectonic on STDIN instead of a temporary .tex file, so that it
looks in the working directory for `\include` and `\input` like the rest
of the engines.

Allows overriding the output directory without messing up the args
with `--pdf-engine-opt=--outdir --pdf-engine-opt="$DIR"`.
2019-03-07 10:16:40 -07: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
ebdcf75276 LaTeX writer/template: better handling of front/main/backmatter.
In pandoc 2.7 we assumed that every class with chapters would
accept `\frontmatter`, `\mainmatter`, and `\backmatter`.
This is not so (e.g. report does not).  So pandoc 2.7
breaks on report class by including an unsupported command.

So we replace the book-class variable in the template with
two variables, has-chapters and has-frontmatter, and set
these intelligently in the writer.

Closes #5348.
2019-03-04 11:29:41 -08:00
John MacFarlane
7895e2386d Update bash completion template.
Added `--ipynb-output` and `latexmk` pdf-engine.
2019-03-03 09:15:46 -08:00
John MacFarlane
c26d7f1e36 LaTeX template: Add \frontmatter, \mainmatter, \backmatter for book classes.
Closes #5306.
2019-03-01 16:23:05 -08:00
Mauro Bieg
b72b395127 Translations: reorder alphabetically (#5335)
remove `Author`, closes #5334
2019-02-27 11:11:50 -07:00
John MacFarlane
5afde8dc76 Add titlepage class to section in epub3 template.
Closes #5269.
2019-02-09 14:12:30 -08:00
Albert Krewinkel
75c791b4fe Lua filters: load module pandoc before calling init.lua (#5287)
The file `init.lua` in pandoc's data directory is run as part of
pandoc's Lua initialization process. Previously, the `pandoc` module was
loaded in `init.lua`, and the structure for marshaling was set-up after.
This allowed simple patching of element marshaling, but made using
`init.lua` more difficult:

  - it encouraged mixing essential initialization with user-defined
    customization;

  - upstream changes to init.lua had to be merged manually;

  - accidentally breaking marshaling by removing required modules was
    possible;

Instead, all required modules are now loaded before calling `init.lua`.
The file can be used entirely for user customization. Patching
marshaling functions, while discouraged, is still possible via the
`debug` module.
2019-02-09 13:56:49 -08:00
Pascal Wagler
66ed198fff Added support for the subject metadata variable to PDF. (#5289) 2019-02-09 13:54:19 -08:00
Albert Krewinkel
9a9c138d9c
data/pandoc.lua: re-export all bundled modules
All Lua modules bundled with pandoc, i.e., `pandoc.List`,
`pandoc.mediabag`, `pandoc.utils`, and `text` are re-exported from the
`pandoc` module. They are assigned to the fields `List`, `mediabag`,
`utils`, and `text`, respectively.
2019-02-09 20:12:33 +01: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
Albert Krewinkel
713ed7c0c5
data/pandoc.lua: re-export List and utils module 2019-02-07 10:10:55 +01: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
d50cb029fd HTML5 template: Add role with ARIA doc-toc for table of contents.
See #4213.
2019-02-02 16:20:19 -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
Andrew Dunning
673d545016 LaTeX template: Restrict institute to Beamer (#5219)
The `\institute` command is only standard in the Beamer class.
Use a conditional to restrict this to Beamer output rather than
output an empty command. To add this information to a LaTeX
class providing an `\institute` command, use `header-includes`.
2019-01-23 10:31: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
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
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
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
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
John MacFarlane
b42afe6333 Add zoomKey config to default.revealjs.
Closes #4249. Thanks to @reagle.
2019-01-08 11:43:07 -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
John MacFarlane
9097ec41a9 EPUB writer: small fixes to nav.xhtml.
* Add 'landmarks' id attribute to the landmarks nav.
* Replace old default CSS removing numbers from ol.toc li
  with new rules that match `nav#toc ol, nav#landmarks ol`.
* We keep the `toc` class on `ol` for backwards compatibility.
2019-01-02 11:24:53 -08:00
Andrew Dunning
fc9ac7993a LaTeX template: Supply missing for
Partially addresses #5179
2019-01-01 19:23:52 -05:00
Andrew Dunning
8feda269b0 LaTeX template: Use bookmark if available
The `bookmark` package can sometimes correct the levels of headings where `hyperref` cannot: see <https://komascript.de/release3.26>.
2019-01-01 17:31:39 -05:00
Andrew Dunning
6a71997fcb LaTeX template: Reindent
Use two spaces to be consistent internally and with other templates.
2019-01-01 14:59:19 -05:00
Andrew Dunning
3160836983 LaTeX template: Remove obsolete fixltx2e package 2019-01-01 14:57:19 -05:00
Andrew Dunning
b6d13467f6 LaTeX template: Load xurl if available
This breaks URLs in more locations. Only available with TeX Live 2018 and later.
2019-01-01 14:47:20 -05:00
Andrew Dunning
275cedc59c LaTeX template: Load xcolor if available
The `xcolor` package must be loaded before the `footnote` package, which we load to fix foonotes in tables. Closes #4861.
2019-01-01 14:45:20 -05:00
Andrew Dunning
d410554f46
LaTeX Template: 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>.
2019-01-01 14:37:42 -05: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
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
John MacFarlane
642c022d81 sample.lua: add SingleQuoted, DoubleQuoted.
Closes #5104.
2018-11-29 10:42:05 -08:00
Andrew Dunning
514af101ef
Additional abbreviations
Many of these borrowed from the Chicago Manual of Style 10.42, 'Scholarly abbreviations', <https://www.chicagomanualofstyle.org/book/ed17/part2/ch10/psec042.html>.
2018-11-20 15:42:24 -05:00
Albert Krewinkel
c0d8b0abcb
Lua filters: test AST object equality via Haskell
Equality of Lua objects representing pandoc AST elements is tested by
unmarshalling the objects and comparing the result in Haskell. A new
function `equals` which performs this test has been added to the
`pandoc.utils` module.

Closes: #5092
2018-11-19 21:46:20 +01:00
John MacFarlane
e80bcb9bea Asciidoc template: add :lang: to title header is lang is set in metadata.
Closes #5088.
2018-11-19 12:02:25 -08:00
OvidiusCicero
6beb1fc28d LaTeX template: add variable romanfont (#4665)
This opens up the possibility of setting the romanfont in xelatex/lualatex.
Note that mainfont actually oversets sansfont in headings
2018-11-03 12:41:47 -07:00
John MacFarlane
2f65263851 AsciiDoc writer: use single-line section headers.
The underline style is now deprecated.
Previously `--atx-headers` would enable the single-line
style; now the single-line style is always used.

Closes #5038.
2018-11-03 12:03:05 -07:00
Nick Fleisher
19e0fcb68b Add viz. to abbreviations file (#5007) 2018-10-22 18:45:46 -07:00
Yoan Blanc
9608fd0c4a revealjs: typo in the socket.io javascript plugin (#5006) 2018-10-22 10:40:49 -07:00
Albert Krewinkel
916db81ade
Lua filters: iterate over AST element fields when using pairs
This makes it possible to iterate over all field names of an AST element
by using a generic `for` loop with `pairs`:

    for field_name, field_content in pairs(element) do
      …
    end

Raw table fields of AST elements should be considered an implementation
detail and might change in the future. Accessing element properties
should always happen through the fields listed in the Lua filter docs.

Note that the iterator currently excludes the `t`/`tag` field.
2018-10-20 19:14:17 +02:00
Albert Krewinkel
8a00b30e40 Lua pandoc module: ensure MetaList elements behave like Lists
Methods usable on Lists can also be used on MetaList objects.
2018-10-15 21:08:39 +02:00
Albert Krewinkel
a444321be8 Lua pandoc module: fix MetaList constructor
Passing a MetaList object to the constructor `pandoc.MetaList` now
returns the passed list as a MetaList. This is consistent with the
constructor behavior when passed an (untagged) list.

Previously, the constructor used to create a new MetaList with the
passed MetaList as its only element.
2018-10-15 21:00:50 +02:00
Albert Krewinkel
6082caf233
Custom writer: provide PANDOC_DOCUMENT instead of Setup function
Custom writers have access to the global variable `PANDOC_DOCUMENT`. The
variable contains a userdata wrapper around the full pandoc AST and
exposes two fields, `meta` and `blocks`. The field content is only
marshaled on-demand, performance of scripts not accessing the fields
remains unaffected.
2018-10-14 21:23:41 +02:00
Albert Krewinkel
49544069a2 Custom writer: give full access to doc in optional Setup function (#4967)
Custom writers can specify an optional `Setup` function. The function
takes the full Pandoc document as input and should not return any value.
Users can use this function to configure the writer depending on the
given document's content or its metadata.

data/sample.lua: add sample use of Setup function.
The change allows to control the image format used to encode the image
produced from dot code.

Closes #4957
2018-10-13 23:20:29 -07:00
Albert Krewinkel
273d4dfcfa
data/sample.lua: replace custom pipe function with pandoc.utils.pipe 2018-10-13 20:54:47 +02:00
Albert Krewinkel
5f6f2c69f5
data/pandoc.lua: add datatype ListAttributes
Make ListAttributes a datatype. The type is similar to Attr.
2018-10-11 22:28:24 +02:00
John MacFarlane
30033f417f Docx writer: added framework for custom properties.
So far, we don't actually write any custom properties,
but we have the infrastructure to add this.

See #3034.
2018-10-09 10:38:50 -07:00
Albert Krewinkel
05efa5a0e6
Lua filter doc: fix description of Code.text 2018-10-06 21:48:24 +02:00
Mathias Walter
537d917988 LaTeX template: add variable hyperrefoptions(#4925)
Introduce a new variable `hyperrefoptions` to pass to the hyperref package.
This allows us (for example) to specify `hyperrefoptions: linktoc=all` in a YAML block.
2018-10-04 12:22:22 -07:00
Ivan Trubach
9f4406023f
Translations/ru
I suppose that you copy-pasted the Russian translations from babel[1] package. Actually, it has two versions — `captionsrussian@ancient` and `captionsrussian@modern`, the former contains translations for the pre-revolution (1918) orthography.

[1]: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/babel-contrib/russian/russianb.ldf
2018-09-22 22:21:56 +03:00
J. B. Rainsberger
7b52d43877 Make HTML5 header easier to style precisely in default template (#4767)
Add the `title-block-header` identifier to the `header` element, to make it easier to style precisely.
2018-09-10 09:15:11 -07:00
José de Mattos Neto
70d0ae135e Remove unnecessary indenting of TOC title (#4869)
Fixes #4798
2018-09-04 09:48:39 -07:00
John MacFarlane
7318bc91ce EPUB writer: set epub:type on body element intelligently.
epub:type of first section        epub:type of body
--------------------------        ------------------
prologue                          frontmatter
abstract                          frontmatter
acknowledgments                   frontmatter
copyright-page                    frontmatter
dedication                        frontmatter
foreword                          frontmatter
halftitle,                        frontmatter
introduction                      frontmatter
preface                           frontmatter
seriespage                        frontmatter
titlepage                         frontmatter
afterword                         backmatter
appendix                          backmatter
colophon                          backmatter
conclusion                        backmatter
epigraph                          backmatter

Otherwise body will have epub:type 'bodymatter'.
This only affects epub3.

See http://www.idpf.org/epub/profiles/edu/structure/#h.l0bzsloklt10

Closes #4823.
2018-08-28 12:35:28 -07:00
Wandmalfarbe
dac85d683f Add support for $toc-title$ to LaTeX (and PDF). (#4853) 2018-08-25 09:55:17 -07:00
John MacFarlane
2bc352f305 TEI template: improve publicationStmt.
Add support for publisher, address, pubPlace, and date variables.
2018-08-16 21:19:03 -07:00
John MacFarlane
0910e92187 TEI improvements.
- Ensure that title element is always present, even if empty.
- Put author tags in the template, rather than adding them in
  the writer.

Closes #4839.
2018-08-16 21:06:49 -07:00
John MacFarlane
fe312b0a7a LaTeX writer/template: be sensitive to filecolor variable.
`linkcolor` only affects internal links, and `urlcolor` only
affects linked URLs.  For external links, the option to use is
`filecolor`.

Closes #4822.
2018-08-16 20:48:51 -07:00
Cyril Roelandt
2ae8272754 Support "toc-title" in the beamer template. (#4835)
It is a bit awkward to have a title for every frame, but not for the one
that holds the table of contents. Allow users to specify a title if they
wish.
2018-08-15 09:58:17 -07:00
Francesco Occhipinti
2661658a69 RST writer: use titleblock instead of title variable for title block
Closes #4803

After this commit use `$titleblock$` in order to get what was contained
in `$title$` before, that is a title and subtitle rendered according to
the official rST method:
http://docutils.sourceforge.net/docs/user/rst/quickstart.html#document-title-subtitle. from

With this commit, the `$title$` and `$subtitle$` metadata are available and they
simply carry the metadata values.  This opens up more possibilities in templates.
2018-08-01 12:32:16 -07:00
John MacFarlane
748aa920f6 Moved some beamer code in default.latex template.
This change allows beamer themes to change the
template and font (as Metropolis does).

Closes #4450.
2018-07-21 22:05:21 -07:00
Igor Khorlo
3efcf2c95a Add missing rollingLinks option to revealjs template (#4778)
Fix (add) the missing option 'rollingLinks' in reveal.js template.
2018-07-18 19:26:16 -07:00
lux-lth
e56a1a3088 Translations/fr (#4766)
* Edited FR translation, Cc (Carbon Copy) translates to 'Copie carbone' : Cc

* Edited FR translation, 'Chapter' translates 'Chapitre' (typo)

* Edited FR translation, 'Figure' translates to 'Figure'

* Edited FR translation, 'Glossary' translates to 'Glossaire'

* Edited FR translation, 'to' translates to 'à'

* Edited FR translation, first letter to uppercase

* Edited FR translation, 'Table' translates to 'Tableau'
2018-07-12 19:31:38 +02:00
Alexander Krotov
ebf4ed8944 Texinfo writer: use @sup and @sub instead of custom macros
Fixes #4728
2018-06-25 03:14:04 +03:00
John MacFarlane
4173460689 reveal.js writer and template: reuse mathjax URL...
...provided by the argument to `--mathjax` or the normal
pandoc default, rather than a hard-coded one in the template.

Closes #4701.
2018-06-12 09:35:27 -07:00
Felix Yan
9b3d14b6ef pandoc.lua: fix a typo (#4692) 2018-06-08 15:15:36 -07:00
John MacFarlane
6ea706256d Support --number-sections in RST output...
via the "section-numbering" directive in standalone output.
2018-06-02 21:37:15 -07:00
Pablo Rodríguez
d5f085535e new Greek fallback typeface (would fix #4405) (#4605)
CMU Serif would give better typographic results
than the current Greek fallback DejaVu Serif.
2018-05-01 21:22:56 -07:00
OvidiusCicero
5ced96c0cc Make template polyglot (#4606)
This line:  `<link rel="stylesheet" href="$css$">` is not valid XML.
Making it self-closing makes the template polyglot.
2018-05-01 11:29:04 -07:00
John Muccigrosso
00e3c5c8c1 Add background-image variable to default.latex (#4601)
New variable with same name as comparable variable in (proposed) reveal.js template, so that background images can indicated for both presentation formats with one variable.
2018-04-26 11:33:20 -07:00
John Muccigrosso
91877692f3 Adding background-image variable to reveal.js template (#4600) 2018-04-26 11:32:48 -07:00
John MacFarlane
d0940c6e00 Ms template: Fix date.
Previously .ND was used, but this only works if you
have a title page, which we don't.  Thanks to @teoric.
2018-04-25 17:49:01 -07:00
John MacFarlane
16f36eee43 Removed deprecated ancient HTML math methods.
Removed `--latexmathml`, `--gladtex`, `--mimetex`, `--jsmath`, `-m`,
`--asciimathml` options.

Removed `JsMath`, `LaTeXMathML`, and `GladTeX` constructors from
`Text.Pandoc.Options.HTMLMathMethod` [API change].

Removed unneeded data file LaTeXMathML.js and updated tests.

Bumped version to 2.2.
2018-04-25 17:18:56 -07:00
Jesse Rosenthal
bb428df32b Powerpoint writer: Remove docProps/thumbnail.jpeg in data dir.
This file wasn't used in the production of documents. It's supposed to
be a thumbnail of the current document, and we can't actually produce
that ourselves. It turns out that the file contains a nonfree ICC
color calibration file, so the best thing to do would be to remove it
altogether.

Fixes: #4588
2018-04-24 16:00:15 -04:00
John MacFarlane
499c91dd96 Fix bash completion for --print-default-data-file.
Previously this looked in the filesystem, even if pandoc
was compiled with `embed_data_files` (and sometimes it looked
in a nonexistent build directory).  Now the bash completion
script just includes a hard-coded list of data file names.
See #4549.
2018-04-12 09:52:10 -07:00
Étienne BERSAC
7f97b04862 Add -V beameroption variable (#4359)
* LaTeX template: Use `pgfpages` package; this is needed for notes on second screen in beamer
* LaTeX template: Add `beameroption` variable in template
2018-03-30 09:20:06 -07:00
Henri Menke
46f4238a2a ConTeXt template: pdfa variable to generate PDF/A (#4294)
The resulting PDF can be verified using the Apache PDFBox preflight app.

```
$ java -jar preflight-app-2.0.8.jar test.pdf 
The file test.pdf is a valid PDF/A-1b file
```

Instructions on how to install the ICC profiles on ConTeXt standalone can be found in the wiki: <http://wiki.contextgarden.net/PDFX#ICC_profiles>.
If the ICC profiles are not available the log will contain messages like these

```
backend         > profiles > profile specification 'sRGB.icc' loaded from '/usr/local/texlive/2017/texmf-dist/tex/context/colors/icc/context/colorprofiles.xml'
backend         > profiles > error, couldn't locate profile 'srgb.icc'
backend         > profiles > no default profile 'srgb.icc' for colorspace 'rgb'
backend         > profiles > profile specification 'sRGB IEC61966-2.1' loaded from '/usr/local/texlive/2017/texmf-dist/tex/context/colors/icc/context/colorprofiles.xml'
backend         > profiles > error, couldn't locate profile 'srgb.icc'
backend         > profiles > invalid output intent 'sRGB IEC61966-2.1'
```

and the resulting PDF will not be valid PDF/A:

```
$ java -jar preflight-app-2.0.8.jar test.pdf 
The file test.pdf is not a valid PDF/A-1b file, error(s) :
2.4.3 : Invalid Color space, The operator "g" can't be used without Color Profile on page 1
2.4.3 : Invalid Color space, The operator "G" can't be used without Color Profile on page 1
2.4.3 : Invalid Color space, /DeviceGray default for operator "TJ" can't be used without Color Profile on page 1
2.4.3 : Invalid Color space, /DeviceGray default for operator "TJ" can't be used without Color Profile on page 1
2.4.3 : Invalid Color space, The operator "g" can't be used without Color Profile on page 1
2.4.3 : Invalid Color space, The operator "G" can't be used without Color Profile on page 1
2.4.3 : Invalid Color space, /DeviceGray default for operator "TJ" can't be used without Color Profile on page 1
```

However, the PDF will still be generated and the "errors" shown in the log do not break anything.
2018-03-17 21:05:55 -07:00
Václav Haisman
2ddf2257dc Provide bidi package's option using \PassOptionsToPackage (#4357).
* Provide `bidi` package's option using `\PassOptionsToPackage`.  This avoid clash when   `polyglossia` loads it first and then it is loaded again for XeLaTeX when `latex-dir-rtl` defined.

* Adjust test suite for LaTeX template change.
2018-03-17 20:20:57 -07:00
Jesse Rosenthal
6c6ac9f22e Powerpoint writer: Move notes slides into data tree. 2018-02-18 16:31:32 -05:00
John MacFarlane
d0e49e0a8a rst template: remove definition of 'math' role as raw.
This used to be needed prior to v 0.8 of docutils, but
now math support is built-in.
2018-02-08 16:31:19 -08:00
John MacFarlane
b8ffd834cf hlint code improvements. 2018-01-19 21:25:24 -08:00
John MacFarlane
8b3707de04
Merge pull request #4221 from phikal/master
Ms writer: Added papersize variable
2018-01-19 21:37:36 -07:00
Henri Menke
6910267abf ConTeXt writer: Use xtables instead of Tables (#4223)
- Default to xtables for context output.
- Added `ntb` extension (affecting context writer only) to use Natural Tables instead.
- Added `Ext_ntb` constructor to `Extension` (API change).
2018-01-15 18:38:33 -07:00
Albert Krewinkel
2c71604554
data/pandoc.lua: add attr, listAttributes accessors
Elements with attributes got an additional `attr` accessor. Attributes
were accessible only via the `identifier`, `classes`, and `attributes`,
which was in conflict with the documentation, which indirectly states
that such elements have the an `attr` property.
2018-01-13 23:24:13 +01:00
Albert Krewinkel
e0cb0dab18
data/pandoc.lua: accept single block as singleton list
Every constructor which accepts a list of blocks now also accepts a
single block element for convenience.  Furthermore, strings are accepted as
shorthand for `{pandoc.Str "text"}` in constructors.
2018-01-13 22:32:22 +01:00
Albert Krewinkel
9fdd266677
data/pandoc.lua: accept singleton inline as a list
Every constructor which accepts a list of inlines now also accepts a
single inline element for convenience.
2018-01-13 18:52:17 +01:00
Albert Krewinkel
1d639456d3
data/pandoc.lua: drop _VERSION
Having a _VERSION became superfluous, as this module is closely tied to
the pandoc version, which is available via PANDOC_VERSION.
2018-01-13 15:38:15 +01:00
Albert Krewinkel
f5e021998e
data/pandoc.lua: fix access to Attr components
Accessing an Attr value (e.g., ` Attr().classes`) was broken; the more
common case of accessing it via an Inline or Block element was
unaffected by this.
2018-01-09 19:44:42 +01:00
Albert Krewinkel
bf944e0aeb
data/pandoc.lua: slightly de-complicate accessor code
Change: minor
2018-01-09 07:44:09 +01:00
Albert Krewinkel
78b142b880
data/pandoc.lua: cleanup code, remove cruft 2018-01-08 23:26:38 +01:00
Albert Krewinkel
b6cec3da3f
data/pandoc.lua: fix docstrings
Change: minor
2018-01-07 22:41:59 +01:00
Albert Krewinkel
f277ac1338
data/pandoc.lua: make Attr an AstElement
Attr is an AST element, which is now reflected in the type hierarchy.
2018-01-07 22:41:59 +01:00
Albert Krewinkel
967a54dea3
data/pandoc.lua: drop 'pandoc-api-version' from Pandoc objects
This attribute was out-of-sync with the actual version as is mostly
irrelevant in the context Lua filters and custom writers.  Use the
global `PANDOC_API_VERSION` instead.
2018-01-07 14:06:34 +01:00
Albert Krewinkel
458e633bc4
data/pandoc.lua: make all types subtypes of AstElement
*Pandoc*, *Meta*, and *Citation* were just plain functions and did not
set a metatable on the returned value, which made it difficult to amend
objects of these types with new behavior. They are now subtypes of
AstElement, meaning that all their objects can gain new features when a
method is added to the behavior object (e.g., `pandoc.Pandoc.behavior`).
2018-01-07 11:22:53 +01:00
Albert Krewinkel
b70079fbfa
data/pandoc.lua: split type and behavior tables
Clearly distinguish between a type and the behavioral properties of an instance
of that type. The behavior of a type (and all its subtypes) can now be amended
by adding methods to that types `behavior` object, without exposing the type
objects internals.

E.g.:

    pandoc.Inline.behavior.frob = function () print'42' end
    local str = pandoc.Str'hello'
    str.frob() -- outputs '42'
2018-01-06 23:25:08 +01:00
Albert Krewinkel
a2e327f0db
data/pandoc.lua: rename Element to AstElement
This avoids confusion with the Element type from Text.Pandoc.Shared.

Change: minor
2018-01-06 23:25:08 +01:00
Albert Krewinkel
5942da4ff7
data/pandoc.lua: remove dead code
A `Element:new` method was a left-over was never called.

Change: minor
2018-01-06 23:25:08 +01:00
Albert Krewinkel
f492f5a6dd
data/pandoc.lua: fix Element inheritance
Extending all elements of a given type (e.g., all inline elements) was
difficult, as the table used to lookup unknown methods would be reset
every time a new element of that type was created, preventing recursive
property lookup. This is was changed in that all methods and attributes
of supertypes are now available to their subtypes.
2018-01-06 23:25:08 +01:00
Albert Krewinkel
0d935bd081
Update copyright notices to include 2018 2018-01-05 20:39:12 +01:00
Albert Krewinkel
4f564b9203
data/pandoc.lua: fix attribute names of Citation
The fields were named like the Haskell fields, not like the documented,
shorter version.  The names are changed to match the documentation and
Citations are given a shared metatable to enable simple extensibility.

Fixes: #4222
2018-01-05 08:20:59 +01:00
Philip K
ca7129800b
Ms writer: Added papersize variable 2018-01-03 11:21:25 +01:00
Albert Krewinkel
9be2c7624c
data/pandoc.lua: drop function pandoc.global_filter
The function `global_filter` was used internally to get the implicitly
defined global filter. It was of little value to end-users, but caused
unnecessary code duplication in pandoc. The function has hence been
dropped. Internally, the global filter is now received by interpreting
the global table as lua filter.

This is a Lua API change.
2017-12-29 10:04:55 +01:00
Albert Krewinkel
ec068f2318
data/pandoc.lua: fix documentation for global_filter 2017-12-29 09:02:25 +01:00
John MacFarlane
108e429c88 Fixed some doc comments in data/pandoc.lua. 2017-12-28 21:55:46 -08:00
Albert Krewinkel
3b2282c962
data/sample.lua: use next instead of for loop
Each definition list item contains just a single key and the associated
value.  Using `next` to get the key/value pair is more idiomatic than
iterating over the single-element table.
2017-12-27 20:11:19 +01:00
John MacFarlane
e19526846f Removed extra comment. 2017-12-27 10:52:12 -08:00
John MacFarlane
cb4123841c Revert "data/sample.lua: Fixed problem with definition lists."
This reverts commit 0e3736422e
in favor of @tarleb's fix.
2017-12-27 10:48:34 -08:00
John MacFarlane
27ba06fe8f data/sample.lua: fixed problem with tables.
Closes #4202.
2017-12-27 09:16:29 -08:00
John MacFarlane
0e3736422e data/sample.lua: Fixed problem with definition lists. 2017-12-27 09:16:01 -08:00
John MacFarlane
596257f350 Updated reference.docx.
Instead of just "Hello, world", the document now contains
exemplars of most of the styles that have an effect on pandoc
documents.

This makes it easier to see the effect of style changes.

Closes #4175.
2017-12-26 22:02:49 -08:00
John MacFarlane
718b2c5837 HTML writer: Use br elements in line blocks...
instead of relying on CSS.  Closes #4162.  HTML-based templates have had
the custom CSS for div.line-block removed.  Those maintaining custom
templates will want to remove this too.

We still enclose line blocks in a div with class line-block.
2017-12-26 08:40:33 -08:00
Albert Krewinkel
ef4351c4d2
data/init.lua: load pandoc.utils by default 2017-12-23 13:42:35 +01:00
Albert Krewinkel
bd3ea72371
Lua modules: added pandoc.utils module
A new module `pandoc.utils` has been created. It holds utility functions
like `sha1`, which was moved from the main `pandoc` module.
2017-12-21 22:42:59 +01:00
John MacFarlane
117a672c4d Removed default.theme data file.
It is no longer needed now that we have `--print-highlight-style`.
See #4096.
2017-12-21 11:28:38 -08:00
Albert Krewinkel
5d3573e780
Lua modules: turn pipe, read into full Haskell functions
The `pipe` and `read` utility functions are converted from hybrid
lua/haskell functions into full Haskell functions. This avoids the need
for intermediate `_pipe`/`_read` helper functions, which have dropped.
2017-12-20 22:24:41 +01:00
Albert Krewinkel
46d3c95ecd
pandoc.lua: re-add missing MetaMap function
This was a bug introduced in version 2.0.4 (commit
3f1f9536d4).
2017-12-19 09:12:16 +01:00
John MacFarlane
17b667ec26 Update latex template to work with recent versions of beamer.
The old template produced numbered sections with some recent
versions of beamer.

Thanks to Thomas Hodgson.
2017-12-13 21:17:13 -08:00
Thomas Hodgson
166561cc8d Added support for LaTeX pagestyle variable (#4135)
* Add pagestyle support

* Add pagestyle option to MANUAL.txt

* Moved mention of pagestyle to the section on variables
2017-12-11 22:26:16 -07:00
Jesse Rosenthal
9734a598ea Add default pptx data for Powerpoint writer. 2017-12-11 07:00:17 -05:00
Albert Krewinkel
4066a385ac
Lua filters: use script to initialize the interpreter
The file `init.lua` is used to initialize the Lua interpreter which is
used in Lua filters. This gives users the option to require libraries
which they want to use in all of their filters, and to extend default
modules.
2017-12-06 22:50:56 +01:00
Albert Krewinkel
d5b1c7b767
Lua filters: refactor lua module handling
The integration with Lua's package/module system is improved: A
pandoc-specific package searcher is prepended to the searchers in
`package.searchers`. The modules `pandoc` and `pandoc.mediabag` can now
be loaded via `require`.
2017-12-02 23:07:29 +01:00
John MacFarlane
00f634ba80 reveal.js template: add title-slide identifier to title slide.
This allows it to be styled more easily.

Closes #4120.
2017-12-04 16:26:04 -08:00
John MacFarlane
c94b970ced Include default CSS for 'underline' class in HTML-based templates. 2017-12-03 20:36:08 -08:00
John MacFarlane
ecfb5a0838 revealjs template: added a necessary escape. 2017-12-01 22:02:07 -08:00
John MacFarlane
d9f0b816e2 reveal.js template: include tex2jax configuration.
This ensures that we don't use $..$ delimiters, which
gives bad results when $ is used as a currency sign.
This depends on the current dev version of reveal.js.
2017-12-01 21:41:48 -08:00
Albert Krewinkel
3f1f9536d4
pandoc.lua: set metatable on List MetaValues
The `List` metatable is assigned to the tables which get passed to the
constructors `MetaBlocks`, `MetaInline`, and `MetaList`. This enables
the use of the resulting objects as lists.  This is part of the changes
discussed in #4081.
2017-12-01 18:47:33 +01:00
Albert Krewinkel
6640506ddc
Lua/StackInstances: push Pandoc and Meta via constructor
Pandoc and Meta elements are now pushed by calling the respective
constructor functions of the pandoc Lua module. This makes serialization
consistent with the way blocks and inlines are pushed to lua and allows
to use List methods with the `blocks` value.
2017-12-01 17:58:12 +01:00
Albert Krewinkel
8473a151c5
List.lua: add missing fixes as discussed in #4099
The changes were missing due to an error while using git.
2017-12-01 17:12:56 +01:00
Albert Krewinkel
c65b514ed1
List.lua: add _VERSION to module, drop unused var 2017-11-29 21:13:10 +01:00
Albert Krewinkel
0105a3c293 Add basic lua List module (#4099)
The List module is automatically loaded, but not assigned to a global
variable. It can be included in filters by calling `List = require
'List'`.

Lists of blocks, lists of inlines, and lists of classes are now given
`List` as a metatable, making working with them more convenient. E.g.,
it is now possible to concatenate lists of inlines using Lua's
concatenation operator `..` (requires at least one of the operants to
have `List` as a metatable):

    function Emph (emph)
      local s = {pandoc.Space(), pandoc.Str 'emphasized'}
      return pandoc.Span(emph.content .. s)
    end

Closes: #4081
2017-11-28 17:20:01 -07:00
Albert Krewinkel
849900c516 data/pandoc.lua: enable table-like behavior of attributes (#4080)
Attribute lists are represented as associative lists in Lua. Pure
associative lists are awkward to work with. A metatable is attached to
attribute lists, allowing to access and use the associative list as if
the attributes were stored in as normal key-value pair in table.

Note that this changes the way `pairs` works on attribute lists. Instead
of producing integer keys and two-element tables, the resulting iterator
function now returns the key and value of those pairs.  Use `ipairs` to
get the old behavior.

Warning: the new iteration mechanism only works if pandoc has been
compiled with Lua 5.2 or later (current default: 5.3).

The `pandoc.Attr` function is altered to allow passing attributes as
key-values in a normal table. This is more convenient than having to
construct the associative list which is used internally.

Closes #4071
2017-11-20 09:37:40 -08:00
John MacFarlane
c9407f85a0 LaTeX template: include natbib/biblatex after polyglossia.
Otherwise we seem to get an error; biblatex wants polyglossia
language to be defined.

Closes #4073.
2017-11-14 20:50:13 -08:00
John MacFarlane
cf7d66c097 Fixed URIs in jats.csl.
They were being rendered twice, leading to invalid XML.
2017-11-11 16:23:41 -08:00
John MacFarlane
8d31e00010 Removed etc. from abbreviations file.
Reason:  often etc. ends a sentence, and we want the . to
be treated as a sentence-ending period.
2017-11-09 23:23:51 -05:00
Wandmalfarbe
62244713f5 Added a few abbreviations and sorted the list. (#3984) 2017-11-03 12:48:58 -04:00
John MacFarlane
642d603666 Improved support for columns in HTML.
* Move as much as possible to the CSS in the template.
* Ensure that all the HTML-based templates (including epub)
  contain the CSS for columns.
* Columns default to 50% width unless they are given a width
  attribute.

Closes #4028.
2017-11-02 20:57:05 -07:00
mb21
8d7ce0fdf0 HTML Writer: consistently use dashed class-names
see #3556
2017-10-31 10:40:16 +01:00
Albert Krewinkel
db715dc9d7
pandoc.lua: define default list attributes
The second argument of the OrderedList constructor, which should define
the list's attributes, is made optional. Default attributes are used if
the parameter is omitted.
2017-10-25 16:41:03 +02:00
Albert Krewinkel
cab4f982f3
pandoc.lua: destructure attr for Link and Image
Make Attr values accessible through through the keys `identifier`,
`classes` and `attributes`.  This is already used in other elements with
attributes and is now fixed for Link and Image.
2017-10-17 21:45:27 +02:00
Albert Krewinkel
12f8efe012
pandoc.lua: throw better error when pipe command fails
A table containing the error code, command, and command output is thrown
instead of just a string error message.
2017-10-05 11:41:59 +02:00
John MacFarlane
6dbf8bab07 Merge pull request #3951 from greut/patch-1
Load Google Font using HTTPS by default
2017-10-03 16:43:55 -04:00
Albert Krewinkel
371f9b7084
pandoc.lua: use wrapper funciton for pipe command
The pipe command is wrapped in a lua function, throwing a lua error if
the command returns with an error. A wrapper is needed as Haskell
functions exposed to lua may not throw lua errors due to limitations of
hslua.

The error handling is written such that a table can be returned as an
error object in the future. This is potentially useful when finer
control is required while catching the error in lua code. Current
limitations of hslua require error objects to be strings.
2017-10-03 20:45:11 +02:00
Yoan Blanc
66135ab970 Load Google Font using HTTPS by default
Otherwise they won't show up in current version of firefox/chromium.
2017-10-03 10:55:52 -05:00
Albert Krewinkel
9b750f7d87
Lua.PandocModule: promote addFunction to top level
This reduces some boilerplate.
2017-10-03 13:13:45 +02:00
John MacFarlane
2e2795412d Move 'tables in footnotes' fix out of beamer part of default.latex.
This caused an error in beamer.

Footnotes already work in tables in beamer, without this code.
2017-09-12 08:31:59 -07:00
Mauro Bieg
c7e3c1ec17 Support for PDF generation via weasyprint and prince (#3909)
* Rename --latex-engine to --pdf-engine
* In `Text.Pandoc.Options.WriterOptions`, rename `writerLaTeXEngine` to `writerPdfEngine` and `writerLaTeXArgs` to `writerPdfArgs`.
 * Add support for `weasyprint` and `prince`, in addition to `wkhtmltopdf`, for PDF generation via HTML (closes #3906).
* `Text.Pandoc.PDF.html2pdf`: use stdin instead of intermediate HTML file
2017-09-11 20:18:42 -07:00
Andrew Dunning
621e43e0ec Write euro symbol directly in LaTeX
The textcomp package allows pdfLaTeX to parse `€` directly, making the \euro command unneeded. Closes #3801.
2017-09-08 22:26:32 +01:00
John MacFarlane
3421f3eac7 Removed old beamer template.
We now use the default.latex template for both latex and beamer.
It contains conditionals for the beamer-specific things.

`pandoc -D beamer` will return this template.
2017-09-08 10:48:02 -07:00
Andrew Dunning
331a0a0c25 Use starred versions of xcolor names
Prevents changes to documents defined using the dvipsnames list (e.g. `Blue` gives a different result with svgnames enabled).
2017-09-08 10:32:36 +01:00
Andrew Dunning
51bb7453e4 Merge branch 'master' into patch-1 2017-09-08 07:06:50 +01:00
John MacFarlane
732005456e LaTeX template: load polyglossia after header-includes.
It needs to be loaded as late as possible.

Closes #3898.
2017-09-07 22:16:23 -07:00
John MacFarlane
f802990d45 Merge pull request #3885 from tarleb/lua-module-docs
Lua module documentation
2017-09-07 21:40:02 -07:00
Andrew Dunning
3654c4373a Use xcolor for colorlinks option
Beamer loads `xcolor` rather than `color`, and thus the `dvipsnames` option doesn't take effect. This also provides a wider range of colour selections with the `svgnames` option. Closes #3877.
2017-09-07 22:06:51 +01:00
Albert Krewinkel
1a4658c573
data/pandoc.lua: fix typos in documentation 2017-08-31 16:57:14 +02:00
Andrew Dunning
a89aa1a681 Combine LaTeX/Beamer templates
All conditionals use the `beamer` variable set by the writer.

Closes #3878.
2017-08-26 09:37:22 +01:00
Václav Haisman
c9be2de5c1 Allow setting Japanese fonts when using LuaLaTeX (#3873)
...by using the `luatexja-fontspec` and `luatexja-preset` packages. Use
existing `CJKmainfont` and `CJKoptions` template variables. Add
`luatexjafontspecoptions` for `luatexja-fontspec` and `luatexjapresetoptions`
for `luatexja-preset`.
2017-08-25 11:20:56 -07:00
Albert Krewinkel
41baaff327
Text.Pandoc.Lua: support Inline and Block catch-alls
Try function `Inline`/`Block` if no other filter function of the
respective type matches an element.

Closes: #3859
2017-08-22 23:30:48 +02:00
John MacFarlane
6cba21b4d3 Small improvement to #3855 - move lang attribute up.
So we don't have a dangling line with the closing `>` when
`lang` is not set.
2017-08-21 21:16:55 -07:00
Jens Getreu
9375e50b96 docbook5 template: use lang and subtitle variables (#3855) 2017-08-21 21:10:41 -07:00
Albert Krewinkel
8ef200b80f
data/pandoc.lua: fix documentation
Multiple documentation mistakes were fixed.
2017-08-21 17:47:54 +02:00
Albert Krewinkel
b81cff4357
data/pandoc.lua: Include Pandoc, Meta in implicit filters
Functions with a name that corresponds to an AST element are included in
implicit pandoc filter, but both `Meta` and `Pandoc` were wrongly
ignored till now.
2017-08-21 16:47:05 +02:00
John MacFarlane
892a4edeb1 Implement multicolumn support for slide formats.
The structure expected is:

    <div class="columns">
      <div class="column" width="40%">
        contents...
      </div>
      <div class="column" width="60%">
        contents...
      </div>
    </div>

Support has been added for beamer and all HTML slide formats.

Closes #1710.

Note:  later we could add a more elegant way to create
this structure in Markdown than to use raw HTML div elements.
This would come for free with a "native div syntax" (#168).
Or we could devise something specific to slides
2017-08-14 23:17:44 -07:00
Andrew Dunning
ceda566a5e Fix hyperref options clash (#3847)
Avoids an options clash when loading a package (e.g. `tufte-latex`) that uses `hyperref` settings different from those in the template (introduced in <feffd7c64a>).
2017-08-14 12:33:46 -07:00
John MacFarlane
f7346bbfc1 Added Listing to Term.
So far only added to English.
2017-08-12 13:19:50 -07:00
John MacFarlane
cc6db2aa8f Added new translations. 2017-08-12 13:18:09 -07:00
John MacFarlane
622c3f2fa6 Change to yaml for translation files. 2017-08-12 12:17:38 -07:00
John MacFarlane
c9c642c8b4 Added de.trans. 2017-08-11 23:52:03 -07:00
John MacFarlane
74212eb1b0 Added support for translations (localization) (see #3559).
* readDataFile, readDefaultDataFile, getReferenceDocx,
  getReferenceODT have been removed from Shared and
  moved into Class.  They are now defined in terms of
  PandocMonad primitives, rather than being primitve
  methods of the class.

* toLang has been moved from BCP47 to Class.

* NoTranslation and CouldNotLoudTranslations have
  been added to LogMessage.

* New module, Text.Pandoc.Translations, exporting
  Term, Translations, readTranslations.

* New functions in Class: translateTerm, setTranslations.
  Note that nothing is loaded from data files until
  translateTerm is used; setTranslation just sets the
  language to be used.

* Added two translation data files in data/translations.

* LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage`
  (polyglossia) and `\figurename`.
2017-08-11 22:22:31 -07:00
John MacFarlane
0f658eb46c data/pandoc.lua: regularize constructors.
We now use Pandoc instead of Doc (though Doc remains a deprecated
Synonym), and we deprecate DoubleQuoted, SingleQuoted,
InlineMath, and DisplayMath.
2017-06-29 17:08:59 +02:00
John MacFarlane
7ea49da002 LaTeX template: added natbiboptions variable.
Closes #3768.
2017-06-28 14:34:12 +02:00
Albert Krewinkel
4fab0d2c30
data/pandoc.lua: add accessors to Table elements 2017-06-27 17:11:42 +02:00
John MacFarlane
cf3b9a4058 Removed redundant element from data/docx/word/numbering.xml.
The elements we need are generated when the document is
compiled; this didn't do anything.
2017-06-27 12:39:13 +02:00
John MacFarlane
6773447c8c Support --toc in opendocument/odt. 2017-06-26 16:31:28 +02:00
John MacFarlane
75f4e41d7d Use table-of-contents for contents of toc, make toc a boolean.
Changed markdown, rtf, and HTML-based templates accordingly.

This allows you to set `toc: true` in the metadata; this
previously produced strange results in some output formats.

Closes #2872.

For backwards compatibility, `toc` is still set to the
toc contents.  But it is recommended that you update templates
to use `table-of-contents` for the toc contents and `toc`
for a boolean flag.
2017-06-26 16:20:09 +02:00
John MacFarlane
8af1c065d2 latex template: fix typo in fix for notes in tables.
See 1475299c9a (diff-c7c27b8e99f898fde7715afd9ae8cd02R126)

However, this is not a complete fix:
https://github.com/jgm/pandoc-templates/pull/208#issuecomment-309631622

Thanks to zeeMonkeez.  See #2378.
2017-06-20 10:24:35 +02:00
Yuchen Pei
564c77964d Added Vimwiki reader (#3705).
* New module Text.Pandoc.Readers.Vimwiki, exporting readVimwiki [API change].
* New input format `vimwiki`.
* New data file, `data/vimwiki.css`, for displaying the HTML produced by this reader and pandoc's HTML writer in the style of vimwiki's own HTML export.
2017-06-19 22:15:12 +02:00
John MacFarlane
ec3992b2f0 Use revealjs's math plugin for mathjax.
This is a thin wrapper around mathjax that makes math look better
on revealjs.

See https://github.com/hakimel/reveal.js/#mathjax

We do this by setting the 'mathjax' boolean variable and
using it in the revealjs template. Also, for revealjs
and mathjax, we don't assign the usual thing to the 'math'
variable, since it's handled by mathjax config.

Closes #3743.
2017-06-18 11:44:21 +02:00
Václav Haisman
4bae307616 Added aspectratio variable to beamer template (#3723).
* Transplant jgm/pandoc-templates#236 to Pandoc repository.
* Document `aspectratio` in user manual.
* Enumerate possible values for `aspectratio`.
2017-06-05 15:52:36 +02:00
John MacFarlane
650e1ac1fd Docx writer: Use Table rather than "Table Normal" for table style.
"Table Normal" is the default table style and can't be modified.

Closes #3275, further testing welcome.
2017-05-25 12:11:46 +02:00
lwolfsonkin
b45e47735c modified template.latex to fix XeLaTex being used with tables (#3661)
- reordered `lang` variable handling to immediately before `bidi`
2017-05-18 22:42:18 +02:00
Ian
b9185b0216 Docx writer: Change FigureWithCaption to CaptionedFigure (#3658)
Edit styles.xml as part of the fix for #3656
2017-05-18 22:34:13 +02:00
Albert Krewinkel
399a36280d
Lua module: allow omitting Attr in element constructors
The Attr argument is made optional for all pandoc element constructors
which take such a parameter. The attr param is always the last argument
of the constructor functions, so the option to omit them makes it easier
to construct new pandoc elements by hand.
2017-05-18 00:04:48 +02:00
Václav Haisman
7bdf38ef2e LaTeX: Load parskip before hyperref. (#3654)
* LaTeX: Load `parskip` before `hyperref`.

According to `hyperref` package's `README.pdf`, page 22, `hyperref` package
should be loaded after `parskip` package.

* Adjust tests for previous change.
2017-05-09 22:09:10 +02:00
Václav Haisman
5048be5112 Fix links inside captions in LaTeX output with links-as-notes.
Declare our redefined `\href` robust.

Fixes #3651. (#3652)
2017-05-08 12:07:01 +02:00
John MacFarlane
2f3d62cb86 ConTeXt template: improved font handling.
simplefonts is now obsolete in ConTeXt.

This patch comes from Pablo Rodríguez via jgm/pandoc-templates#247.
2017-05-06 14:58:32 +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
Albert Krewinkel
2e916b3abf
Lua module: simplify Attributes, rename to Attr
Attributes was written to behave much like a normal table, in order to
simplify working with it. However, all Attr containing elements were
changed to provide panflute-like accessors to Attr components, rendering
the previous approach unnecessary.
2017-04-30 11:50:09 +02:00
Albert Krewinkel
3362cb89d9
Lua module: make Header argument order consistent
Attributes are always passed as the last element, making it possible to
omit this argument.  Argument order for `Header` was wrong and is fixed.
2017-04-30 11:28:03 +02:00
Albert Krewinkel
01e8df2e53
Lua module: add example for usage of read 2017-04-30 11:24:48 +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
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
5416fb14ab Lua filter: allow natural access to meta elements
Meta elements that are treated as lua tables (i.e. MetaList,
MetaInlines, MetaBlocks, and MetaMap), are no longer wrapped in an
additional table but simply marked via a metatable.  This allows
treating those meta values just like normal tables, while still making
empty elements of those values distinguishable.
2017-04-26 23:28:40 +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
Albert Krewinkel
291e4f39e8
Lua module: provide accessors to element properties 2017-04-15 21:36:39 +02:00
Albert Krewinkel
3d6edbd9e3
Lua filter: use Attributes constructor for Attrs
Element attributes are pushed to the stack via the `Attributes`
function. `Attributes` creates an Attr like triple, but the triple also
allows table-like access to key-value pairs.
2017-04-15 09:31:09 +02:00
Albert Krewinkel
ac275528c2
Lua module: fix doc generation, reorder code
Ensure that documentation generated with `ldoc` is readable and correct.
2017-04-15 00:12:51 +02:00
Albert Krewinkel
8c2e6a66b9
Lua module: provide builder functions for math and quoted
Provide functions `pandoc.SingleQuoted`, `pandoc.DoubleQuoted`,
`pandoc.DisplayMath`, and `pandoc.InlineMath` to allow simple building
of Math and Quoted elements.
2017-04-15 00:10:33 +02:00
Albert Krewinkel
d671b69b87
Lua filter: use lua strings for nullary constructors
Lua string are used to represent nullary data constructors. The previous
table-based representation was based on the JSON serialization, but can
be simplified. This also matches the way those arguments are passed to
custom writers.
2017-04-14 22:32:08 +02:00
Albert Krewinkel
540a3e80ad
Push blocks via lua constructors and constants
All element creation tasks are handled by lua functions defined in the
pandoc module.
2017-04-14 10:33:38 +02:00
Albert Krewinkel
425df8fff4
Use lua constructors to push meta values 2017-04-13 22:57:50 +02:00
Albert Krewinkel
00746c3c76
Improve lua module documentation 2017-04-13 19:10:51 +02:00
Albert Krewinkel
97dfe782cf
Lua module: provide multi-param Inline constructors
Instead of taking only a single argument containing the pre-packed
element contents, `Inline` constructors now take the same arguments as
the respective filter and `Custom` writer function
2017-04-12 21:21:25 +02:00
Albert Krewinkel
7e3705c1c4
Lua filter: use custom StackValue Inline instance
Inline elements are no longer pushed and pulled via aeson's Value.
2017-04-11 23:31:55 +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
65b692b413 Small fixes to ms template. 2017-04-04 16:19:53 +02:00
John MacFarlane
9e78a9d26b Added data/default.theme to repository. 2017-04-01 22:59:10 +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
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
560cfadb92 jats template: added xml-stylesheet variable. 2017-03-30 22:49:22 +02:00
John MacFarlane
6ad486c3c3 Automatically include URI-encoded jats.csl for jats output.
This way people can do

    pandoc -s -t jats --filter pandoc-citeproc

and it will just work.  If they want to specify a stylesheet,
they still can.
2017-03-30 16:43:17 +02:00
John MacFarlane
64fe39c255 Added default.jats template.
This is copied from Martin Fenner's pandoc-jats project:
https://github.com/mfenner/pandoc-jats
2017-03-28 09:38:00 +02:00
John MacFarlane
306dadc901 default.ms template: move header-includes and .1C up. 2017-03-26 23:47:38 +02:00
John MacFarlane
0eb62f03fe Ms writer: Hyperlink table of contents and other improvements. 2017-03-26 20:03:37 +02:00
John MacFarlane
e30d2c700a Ms writer: Use @ instead of | for inline math delimiter.
The `|` delimiter had a bad interaction with tbl.
See discussion in #1839.
2017-03-26 16:59:38 +02:00
John MacFarlane
267e1a13ea Ms writer: Support external links.
Also add config options for link color.
2017-03-26 11:05:23 +02:00
John MacFarlane
1d659bec01 Ms writer: Implement header identifiers and internal links. 2017-03-25 22:16:44 +01:00
John MacFarlane
ed6249bd0b Ms writer: use light gray for strikeout.
Pending groff definitions for striking out an arbitrary
section of text (not just a few words).
2017-03-25 20:53:32 +01:00
John MacFarlane
c941a00cac Ms writer: improved pdf metadata. 2017-03-25 19:30:24 +01:00
John MacFarlane
7c8eb2ba6e ms template: beginnings of support for PDF metadata.
This will have to be refined along the lines of what is
now done in the latex writer/template.

For help, see
http://pipeline.lbl.gov/code/3rd_party/licenses.win/groff/1.19.2/pdf/pdfmark.pdf
2017-03-25 11:43:44 +01:00