Commit graph

738 commits

Author SHA1 Message Date
John MacFarlane
213913f025 Pass ReaderOptions to custom readers as second parameter. 2021-11-06 16:47:13 -07:00
John MacFarlane
822f894984 Fuller sample custom reader. 2021-11-06 16:38:12 -07:00
John MacFarlane
ee2f0021f9
Add interface for custom readers written in Lua. (#7671)
New module Text.Pandoc.Readers.Custom, exporting
readCustom [API change].

Users can now do `-f myreader.lua` and pandoc will treat the
script myreader.lua as a custom reader, which parses an input
string to a pandoc AST, using the pandoc module defined for
Lua filters.

A sample custom reader can be found in data/reader.lua.

Closes #7669.
2021-11-05 22:10:29 -07:00
S.P.H
ebe21f3f65 Update bash_completion.tpl
- Specify local scope for highlight_styles; prevents global namespace pollution when sourcing completion from a file rather than adding `eval "$(pandoc --bash-completion)"` to .bashrc
- Add argument completion for --print-highlight-style, --eol, and --markdown-headings
2021-11-03 14:58:30 -07:00
Albert Krewinkel
1c02145d93
Lua: load module pandoc.path on startup
Previously the module always had to be loaded via
`require 'pandoc.path'`.

Closes: #7524
2021-11-01 13:48:36 +01:00
Albert Krewinkel
96e76d4cd4
Lua: restore List behavior of MetaList
Fixes a regression introduced in 2.16 which had MetaList elements loose
the `pandoc.List` properties.

Fixes #7650
2021-11-01 08:27:14 +01:00
Albert Krewinkel
f4d9b443d8
Lua: use hslua module abstraction where possible
This will make it easier to generate module documentation in the future.
2021-10-29 17:08:30 +02:00
Albert Krewinkel
b95e864ecf
Lua: marshal SimpleTable values as userdata objects 2021-10-26 21:45:16 +02:00
Albert Krewinkel
80ed81822e
Lua: generate constants in module pandoc programmatically 2021-10-26 14:40:11 +02:00
Albert Krewinkel
f56d870631
Lua: marshal ListAttributes values as userdata objects 2021-10-26 14:40:11 +02:00
Albert Krewinkel
a493c7029c
Lua: marshal Block values as userdata objects
Properties of Block values are marshalled lazily, which generally
improves performance considerably. Script users may also notice the
following differences:

  - Block element properties can no longer be accessed by numerical
    indexing of the `.c` field. The `.c` property now serves as an alias
    for `.content`, so some filter that used this undocumented method
    for property access may continue to work, while others will need to
    be updated and use proper property names.

  - The marshalled Block elements now have a `show` method, and a
    `__tostring` metamethod. Both return the Haskell string
    representation of the element.

  - Block values now have the Lua type `userdata` instead of `table`.
2021-10-26 14:40:10 +02:00
Albert Krewinkel
230b133db5
Lua: marshal Citation values as userdata objects 2021-10-25 09:08:58 +02:00
Albert Krewinkel
6a03aca906 Lua: marshal Inline elements as userdata
This includes the following user-facing changes:

- Deprecated inline constructors are removed. These are `DoubleQuoted`,
  `SingleQuoted`, `DisplayMath`, and `InlineMath`.

- Attr values are no longer normalized when assigned to an Inline
  element property.

- It's no longer possible to access parts of Inline elements via
  numerical indexes. E.g., `pandoc.Span('test')[2]` used to give
  `pandoc.Str 'test'`, but yields `nil` now. This was undocumented
  behavior not intended to be used in user scripts. Use named properties
  instead.

- Accessing `.c` to get a JSON-like tuple of all components no longer
  works. This was undocumented behavior.

- Only known properties can be set on an element value. Trying to set a
  different property will now raise an error.
2021-10-22 11:16:51 -07:00
Albert Krewinkel
8523bb01b2 Lua: marshal Attr values as userdata
- Adds a new `pandoc.AttributeList()` constructor, which creates the
  associative attribute list that is used as the third component of
  `Attr` values. Values of this type can often be passed to constructors
  instead of `Attr` values.

- `AttributeList` values can no longer be indexed numerically.
2021-10-22 11:16:51 -07:00
Albert Krewinkel
e4287e6c95 Lua: marshal Pandoc values as userdata 2021-10-22 11:16:51 -07:00
John MacFarlane
fcd3384f9f Fix line numbers in source code with reveal.js
We need "overflow: visible" for these to work, and reveal's
default css disables this.  So this modifies the default
template to add this.

Closes #7634.  Thanks to @cderv for diagnosing the issue.
2021-10-21 08:59:33 -07:00
Emily Bourke
8de261ba4e pptx: Line up continuation paragraphs
This commit changes the `marL` and `indent` values used for plain
paragraphs and numbered lists, and changes the spacing defined in the
reference doc master for bulleted lists.

For paragraphs, there is now a left-indent taken from the `otherStyle`
in the master. For numbered lists, the number is positioned where the
text would be if this were a plain paragraph, and the text is indented
to the next level. This means that continuation paragraphs line up
nicely with numbered lists.

It also /mostly/ matches the observed PowerPoint behaviour when
inserting paragraphs and numbered lists: the only difference is that
PowerPoint was using a different margin value for the first level
numbered lists – I’ve changed this to match the other levels, as I don’t
think it makes the spacing unappealing and it allows continuation
paragraphs at any level to line up.

With bulleted lists, I’m keeping the observed PowerPoint behaviour of
specifying only a level, letting `marL` and `indent` be automatically
taken from `bodyStyle`. To that end, this commit changes the `bodyStyle`
spacing in the master of the default reference doc, to:

- line up the text of the first paragraph in each bullet with any
  continuation paragraphs
- line up nested bullet markers in any continuation paragraphs with the
  first paragraph, matching lists and plain paragraphs

This does mean the continuation paragraphs still won’t line up for
anyone using their own reference doc where they haven’t matched the
`otherStyle` and `bodyStyle` indent levels, but I think people in that
situation will be able to troubleshoot.
2021-10-17 17:24:30 -07:00
John MacFarlane
3f489bcb58 Ensure that babel is loaded also with pdflatex.
This fixes a regression in #7604, which modernized
babel usage but omitted to load babel for pdflatex,
with the result that even simple documents could no
longer be produced.

Closes #7627.
2021-10-16 23:34:53 -07:00
hseg
da8bcb783b Make babel use more idiomatic
* Use `babel`'s bidi implementation
* Remove global `lang` option -- it broke eg hebrew
* Import babel languages individually instead of as package options --
  was broken for greek, hebrew
* Move `header-includes` to after `babel` setup

Closes #7604
2021-10-03 19:16:50 -07:00
John MacFarlane
dd7b83ac91 Use babel, not polyglossia, with xelatex.
Previously polyglossia worked better with xelatex, but
that is no longer the case, so we simplify the code so that
babel is used with all latex engines.

This involves a change to the default LaTeX template.
2021-09-19 09:40:59 -07:00
William Lupton
fc20672bb9
Various sample.lua editorial fixes. (#7493)
These address most of the items mentioned in #7487.
There's also a table caption fix (the caption wasn't escaped).
2021-08-12 10:16:34 -07:00
John MacFarlane
ca12e198ba RTF template: specify font family for fixed-width font f1.
According to the spec, this is mandatory.
2021-08-01 09:45:09 -06:00
John MacFarlane
1f1a30bbf6 LaTeX writer: Use ulem for underline.
ulem is conditionally included already when the `strikeout`
variable is set, so we set this when there is underlined text,
and use `\uline` instead of `\underline`.

This fixes wrapping for underlined text.
Closes #7351.
2021-07-22 23:05:43 -07:00
Mauro Bieg
de4da56079 document-css: reset overflow-wrap on code blocks
fixes #7423
2021-07-05 08:57:23 -07:00
John MacFarlane
972db3cdca Revert "LaTeX template: move title, author, date up to top of preamble."
This reverts commit cc088687b4
and PR #7295.

This fixes issues people had when using LaTeX commands defined later
in the preamble (or in some cases UTF-8 text) in the title or author
fields.  Closes #7422.
2021-07-03 15:34:42 -07:00
John MacFarlane
14b2eb2aeb reveal.js writer: better handling of options.
Previously it was impossible to specify false values for
options that default to true; setting the option to false
just caused the portion of the template setting the option
to be omitted.

Now we prepopulate all the variables with their default
values, including them unconditionally and allowing them
to be overridden.
2021-06-21 16:40:52 -07:00
John MacFarlane
3a1988b6b2 reveal.js template: use hash: true by default rather than...
`history: true`.  Closes #6968.  Setting `hash: true` is enough
to get linkability to a particular page of the slide show.
2021-05-20 17:17:15 -07:00
Denis Maier
183ce58477
ConTeXt reader: improve ordered lists (#7304)
Closes #5016 

- change ordered list from itemize to enumerate
- adds new itemgroup for ordered lists
- add fontfeature for table figures
- remove width from itemize in context writer
2021-05-20 09:59:53 -07:00
John MacFarlane
fa23effe25 LaTeX template: improve treatment of CSL entry-spacing.
Previously with the default template settings (`indent` variable
not set), we would get interparagraph spaces separating bib
entries even with `entry-spacing="0"`.  On the other hand,
setting `entry-spacing="2"` gave ridiculously large spacing.
This change makes the spacing caused by `entry-spacing` a multiple
of `\parskip` by default, which gives aesthetically reasonable
output.  Those who want a larger or smaller unit (e.g. because
they use `indent` which sets `\parskip` to 0) may
`\setlength{\cslentryspacingunit}{10pt}` in header-includes
to override the defaults.

Closes #7296.
2021-05-17 20:46:49 -07:00
John MacFarlane
cc088687b4 LaTeX template: move title, author, date up to top of preamble.
This allows header-includes to use them, and puts them
in a position where you can see them immediately.
Closes #7295.
2021-05-16 14:35:13 -07:00
Albert Krewinkel
d92622ba3c
LaTeX template: define commands for zero width non-joiner character
Closes: #6639

The zero-width non-joiner character is used to avoid ligatures (e.g. in
German).
2021-05-16 12:33:32 -07:00
John MacFarlane
31b650b4ec docx writer settings.xml:
- Set zoom to 100% by default.
- Align math options more with current Word defaults (e.g.
  Cambria Math font).
2021-05-15 11:04:53 -07:00
John MacFarlane
2cf971cf56 docx writer: Remove rsids from settings.docx.
Word will add these when revisions are made.  But it's
pointless to start out with a set of them.
2021-05-15 10:54:05 -07:00
Thomas Hodgson
97a0ee23bc
HTML-based slide shows: add support for institute (#7289)
Add institute variable (string or list) to HTML-based slide formats.
2021-05-15 09:56:48 -07:00
John MacFarlane
0e5b840c2a LaTeX template: Move CSL macro defs before header-includes.
This allows them to be overriden by header-includes.
Closes #7286.
2021-05-14 08:48:59 -07:00
John MacFarlane
ba4ec8c5c0 latex template: use non-starred names for xcolor color names.
This should make svgnames and x11names work properly.
Closes #6109.
2021-05-10 09:21:27 -06:00
Florian Kohrt
96d384ac9e
Support toc-title in revealjs (#7171)
* Support toc-title in revealjs
* Add semantic HTML "nav" tag

Closes #7170.

As with default.html5
2021-04-29 18:49:17 -07:00
badumont
b9b22e3ce4
Update default.latex (#7234)
Fix bad vertical spacing after the bibliography.
2021-04-29 18:47:23 -07:00
Julien Dutant
8fe7e8dd5c
list of figures before list of tables in LaTeX and ConTeXt templates (#7235) 2021-04-28 19:06:13 -07:00
Florian Kohrt
afa801ed3f
Remove JS comment from HTML (#7154)
Illegal, turn into HTML comment
2021-03-16 09:20:54 -07:00
John MacFarlane
3622097da3 Handle 'nocite' better with --biblatex and --natbib.
Previously the nocite metadata field was ignored with
these formats.  Now it populates a `nocite-ids` template
variable and causes a `\nocite` command to be issued.

Closes #4585.
2021-03-14 00:10:37 -08:00
Albert Krewinkel
872b4313a1
JATS templates: support 'equal-contrib' attrib for authors
Authors who contributed equally to a paper may be marked with
`equal-contrib`.
2021-03-11 11:07:59 +01:00
Loïc Grobol
8123571e8e
Wrap url colours in braces in the default LaTeX template (#7121) 2021-02-26 10:05:30 -08:00
maurerle
6b7d614888
revealjs writer: add 'center' option for vertical slide centering.
Closes #7104.
2021-02-20 10:17:31 -08:00
Lorenzo
d68bbae552 Update default ODT style
As of now, the default style for ODT documents has a "First paragraph" style that inherits from "Standard" style and has no top or bottom margin. All subsequent paragraphs have "Text_20_body" style that inherits from "Standard" and add "0.0598in" margins on top and bottom. This makes the final document a bit ugly since the first paragraph has a small gap ("0.0598in") towards the second one, and all subsequent have double that.

The proposed fix makes "First paragraph" inherit from "Text_20_body" instead so that it also has a consistent margin.

Another approach would be to inherit "Text_20_body" and add a 0 margin on top.
2021-02-19 10:18:49 -08:00
John MacFarlane
005344fb18 Revert "LaTeX template: disable ` ? ` and ! `` ligatures."
This reverts commit 24d7cd539b.
2021-02-18 17:03:11 -08:00
John MacFarlane
24d7cd539b LaTeX template: disable ` ? ` and ! `` ligatures.
These are often triggered by accident in languagegs that
use ` `` ` for end quote (e.g. German).

See jgm/citeproc#54.
2021-02-18 15:48:40 -08:00
Albert Krewinkel
b5b576184c
JATS writer: add date-type to pub-date elements 2021-02-15 13:15:14 +01:00
Albert Krewinkel
2c99e0e358
JATS writer: replace attribute "pub-type" with "publication-format".
The former attribute is deprecated.
2021-02-15 13:15:14 +01:00
Andrew Dunning
4de9edb8e8
LaTeX template: Update to iftex package (#7073)
Load the iftex package directly rather than via the ifxetex and ifluatex compatibility
wrappers, which have been merged into a single package that is part of the LaTeX core.
The capitalization of the commands has been changed for compatibility with older
versions of TeX Live that have the version of iftex by the Persian TeX Group. This had
been removed in
<2845794c0c>
for compatibility with BasicTeX, but that is no longer an issue.
2021-02-03 08:54:11 -08:00
John MacFarlane
84d46e3523 Add default.bibtex to repository. 2021-02-01 18:53:59 -08:00
John MacFarlane
02d3c71e72 BibTeX writer: use doclayout and doctemplate.
This change allows bibtex/biblatex output to wrap as other
formats do, depending on the settings of `--wrap` and `--columns`.

It also introduces default templates for bibtex and biblatex,
which allow for using the variables `header-include`, `include-before`
or `include-after` (or alternatively the command line options
`--include-in-header`, `--include-before-body`, `--include-after-body`)
to insert content into the generated bibtex/biblatex.

This change requires a change in the return type of the unexported
`T.P.Citeproc.writeBibTeXString` from `Text` to `Doc Text`.

Closes #7068.
2021-02-01 18:05:20 -08:00
Albert Krewinkel
d82fe52a02
JATS templates: tag author.name as string-name
The partitioning the components of a name into surname, given names,
etc. is not always possible or not available. Using `author.name` allows
to give the full name as a fallback to be used when `author.surname` is
not available.
2021-01-29 09:51:20 +01:00
John MacFarlane
c451207b08 Docx writer: handle table header using styles.
Instead of hard-coding the border and header cell vertical alignment,
we now let this be determined by the Table style, making use of
Word's "conditional formatting" for the table's first row.
For headerless tables, we use the tblLook element to tell Word
not to apply conditional first-row formatting.

Closes #7008.
2021-01-12 09:49:10 -08:00
Albert Krewinkel
68fa437999
JATS writer: fix citations (#7018)
* JATS writer: keep code lines at 80 chars or below

* JATS writer: fix citations
2021-01-10 15:35:48 -08:00
John MacFarlane
a41cb09afe Update default CSL to use latest chicago-author-date.csl. 2021-01-10 12:52:50 -08:00
John MacFarlane
533b2edd51 Remove \setupthinrules from default context template.
The width parameter this used is not actually supported,
and the command didn't do anything.
2021-01-06 14:39:44 -08:00
John MacFarlane
99e1b67b74 Use meta-description instead of description in templates.
Since this is an attribute value, we need to prepare it
in the writer.
2020-12-27 23:19:14 -08:00
Jerry Sky
528b67df59
templates: added the description metatag to both html4 and html5 templates (#6982)
The `description` meta tag will make the generated HTML documents more complete and SEO-friendly.
2020-12-27 23:02:28 -08:00
Albert Krewinkel
8f402beab9
LaTeX writer: support colspans and rowspans in tables. (#6950)
Note that the multirow package is needed for rowspans.
It is included in the latex template under a variable,
so that it won't be used unless needed for a table.
2020-12-20 18:04:54 -08:00
John MacFarlane
29c6089681 Remove data/templates/README.markdown. 2020-12-18 12:19:44 -08:00
John MacFarlane
906251e623 Remove data/make-reference-files.hs.
I don't think this has been used for a long time.
2020-12-18 12:17:05 -08:00
John MacFarlane
f4839cc581 Remove some extraneous files in data directory. 2020-12-18 12:08:43 -08:00
John MacFarlane
8031ac137f LaTeX template: include csquotes package if csquotes variable set. 2020-12-07 18:57:24 -08:00
Kolen Cheung
aab54c4325
Add translations zh-Hans.yaml and zh-Hant.yaml
Closes #6904, closes #6909.

Co-authored-by: taotieren <admin@taotieren.com>
2020-12-02 21:00:57 -08:00
Shin Sang-jae
97b70d20bb
EPUB: use preserveAspectRatio="xMidYMid" for cover image (#6895)
This change affects both the epub2 and the epub3 templates.
It avoids distortion of the cover image by requiring that the aspect ratio be preserved.
2020-11-27 09:11:40 -08:00
John MacFarlane
ea8097e412 latex template: put back amssymb
We need it for checkboxes in todo lists, and maybe for
other things.  In this location it seems compatible
with the cases that propmted #6469 and PR #6762.
2020-11-25 16:08:10 -08:00
John MacFarlane
7c4d7db9c7 LaTeX writer: improve longtable output.
- Don't create minipages for regular paragraphs.
- Put width and alignment information in the longtable column
  descriptors.
- Closes #6883.
2020-11-25 15:42:44 -08:00
John MacFarlane
e26d31d56b latex template: disable language-specific shorthands in babel.
Babel defines "shorthands" for some languages, and these can
produce unexpected results. For example, in Spanish, `1.22`
gets rendered as `122`, and `et~al.` as `etal`.

One would think that babel's `shorthands=off` option (which
we were using) would disable these, but it doesn't.  So we
remove `shorthands=off` and add some code that redefines
the shorthands macro.  Eventually this will be fixed in babel,
I hope, and we can revert to something simpler.

Closes #6817, closes #6887.
2020-11-25 08:25:30 -08:00
Albert Krewinkel
f7d80b4170
JATS template: allow array of persistent institute ids in pid 2020-11-23 10:27:57 +01:00
Albert Krewinkel
797db8d306
JATS writer: support author affiliations (#6867)
Closes: #6687
2020-11-20 09:57:06 -08:00
John MacFarlane
a7b2bfb42d reveal.js template fixes.
Put quotes around `controlsLayout`, `controlsBackArrows`,
and `display`, since these require strings.

Add `showSlideNumber`, `hashOneBasedIndex`, `pause`.
2020-11-19 11:56:05 -08:00
John MacFarlane
6b057d6d18 latex template: add a \break after parbox in CSLRightInline.
This should fix spacing problems between entries
with numeric styles.
2020-11-18 23:22:34 -08:00
John MacFarlane
356795dba0 latex template: fix number of params on CSLReferences. 2020-11-18 22:49:35 -08:00
TEC
0306eec5fa Replace org #+KEYWORDS with #+keywords
As of ~2 years ago, lower case keywords became the standard (though they
are handled case insensitive, as always):
13424336a6

Upper case keywords are exclusive to the manual:
- https://orgmode.org/list/871s50zn6p.fsf@nicolasgoaziou.fr/
- https://orgmode.org/list/87tuuw3n15.fsf@nicolasgoaziou.fr/
2020-11-18 14:48:56 +01:00
John MacFarlane
1b18278288 man template: change tbl comment to '\" t.
This is what is specified in groff_man(7).
Closes #6803.
2020-11-03 12:54:02 -08:00
John MacFarlane
b1a58a04fd LaTeX template: fix \CSLRightInline...
so that it does not run over the right margin.
2020-11-03 10:27:05 -08:00
John MacFarlane
5760cd850f Default CSS tweaks.
These changes restore the 20px font size while increasing readibility by
reducing line width. (The number of words per line is now similar to
that of pandoc's default LaTeX/PDF output.)  With the narrower lines, we
also need less interline and interparagraph space, so the content
becomes more compact and skimmable:

- Change default font size back to 20px.
- Set font-size for print media to 12pt.
- Reduce interline space.
- Reduce interparagraph space.
- Reduce line width.
- Remove the special `line-height: 1` for table cells,
  which I had suggested but which now seems a mistake.
- Remove the special line-height for pre.
- Ensure that there is a bit more space before a heading
  than after.
- Slightly reduced space after title header.
2020-11-02 10:51:18 -08:00
John MacFarlane
ea45837372 Default CSS: avoid padding and color if monobackgroundcolor not given.
This makes the default more austere, while putting the padded,
colored code elements within easy reach.
2020-11-01 14:29:03 -08:00
Mauro Bieg
95d8713633
Updates to default CSS (#6786)
- Fix margin before codeblock
- Add `monobackgroundcolor` variable, making the background color
  and padding of code optional.
- Ensure that backgrounds from highlighting styles take precedence over
  monobackgroundcolor
- Remove list markers from TOC
- Add margin-bottom where needed
- Remove italics from blockquote styling
- Change borders and spacing in tables to be more consistent with other
   output formats
- Style h5, h6
- Decrease root font-size to 18px
- Update tests for styles.html changes
- Add CSS example to MANUAL
2020-11-01 14:22:58 -08:00
Albert Krewinkel
7af608b214
JATS templates: ensure jats_publishing output is valid 2020-10-31 15:20:30 +01:00
John MacFarlane
bd7c9eb32b LaTeX writer: Improved calculation of table column widths.
We now have LaTeX do the calculation, using `\tabcolsep`.
So we should now have accurate relative column widths no
matter what the text width.

The default template has been modified to load the calc
package if tables are used.
2020-10-29 12:10:05 -07:00
Denis Maier
4bce33e899
ConTeXt template: adds \setupinterlinespace to fonts larger than normal (#6763) 2020-10-22 17:24:27 -07:00
Angelo Peronio
83b54bb0b3
Do not load amssymb if not needed (#6762)
Fixes #6469. From https://tex.stackexchange.com/a/549938
2020-10-19 16:15:32 -07:00
John MacFarlane
82280cc62c default.latex: fix CSLReference macro definition.
It improperly handled entry spacing and expected 3 parameters
instead of 2.
2020-10-13 10:09:19 -07:00
William Lupton
36e010cb4a
Fix apparent typos in sample.lua (#6729) 2020-10-08 09:42:36 -07:00
niszet
1f707da40f
Support toc-depth option for ODT writer (#6697)
To support `--toc-depth` option for ODT, writer and template are
updated.  Closes #6696.
2020-09-24 09:28:38 -07:00
John MacFarlane
e0984a43a9 Add built-in citation support using new citeproc library.
This deprecates the use of the external pandoc-citeproc
filter; citation processing is now built in to pandoc.

* Add dependency on citeproc library.
* Add Text.Pandoc.Citeproc module (and some associated unexported
  modules under Text.Pandoc.Citeproc).  Exports `processCitations`.
  [API change]
* Add data files needed for Text.Pandoc.Citeproc:  default.csl
  in the data directory, and a citeproc directory that is just
  used at compile-time.  Note that we've added file-embed as a mandatory
  rather than a conditional depedency, because of the biblatex
  localization files. We might eventually want to use readDataFile
  for this, but it would take some code reorganization.
* Text.Pandoc.Loging: Add `CiteprocWarning` to `LogMessage` and use it
  in `processCitations`. [API change]
* Add tests from the pandoc-citeproc package as command tests (including
  some tests pandoc-citeproc did not pass).
* Remove instructions for building pandoc-citeproc from CI and
  release binary build instructions.  We will no longer distribute
  pandoc-citeproc.
* Markdown reader: tweak abbreviation support.  Don't insert a
  nonbreaking space after a potential abbreviation if it comes right before
  a note or citation.  This messes up several things, including citeproc's
  moving of note citations.
* Add `csljson` as and input and output format. This allows pandoc
  to convert between `csljson` and other bibliography formats,
  and to generate formatted versions of CSL JSON bibliographies.
* Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`. [API
  change]
* Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`. [API
  change]
* Added `bibtex`, `biblatex` as input formats.  This allows pandoc
  to convert between BibLaTeX and BibTeX and other bibliography formats,
  and to generated formatted versions of BibTeX/BibLaTeX bibliographies.
* Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and
  `readBibLaTeX`. [API change]
* Make "standalone" implicit if output format is a bibliography format.
  This is needed because pandoc readers for bibliography formats put
  the bibliographic information in the `references` field of metadata;
  and unless standalone is specified, metadata gets ignored.
  (TODO: This needs improvement. We should trigger standalone for the
  reader when the input format is bibliographic, and for the writer
  when the output format is markdown.)
* Carry over `citationNoteNum` to `citationNoteNumber`.  This was just
  ignored in pandoc-citeproc.
* Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter.
  [API change] This runs the processCitations transformation.
  We need to treat it like a filter so it can be placed
  in the sequence of filter runs (after some, before others).
  In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`,
  so this special filter may be specified either way in a defaults file
  (or by `citeproc: true`, though this gives no control of positioning
  relative to other filters).  TODO: we need to add something to the
  manual section on defaults files for this.
* Add deprecation warning if `upandoc-citeproc` filter is used.
* Add `--citeproc/-C` option to trigger citation processing.
  This behaves like a filter and will be positioned
  relative to filters as they appear on the command line.
* Rewrote the manual on citatations, adding a dedicated Citations
  section which also includes some information formerly found in
  the pandoc-citeproc man page.
* Look for CSL styles in the `csl` subdirectory of the pandoc user data
  directory.  This changes the old pandoc-citeproc behavior, which looked
  in `~/.csl`.  Users can simply symlink `~/.csl` to the `csl`
  subdirectory of their pandoc user data directory if they want
  the old behavior.
* Add support for CSL bibliography entry formatting to LaTeX, HTML,
  Ms writers.  Added CSL-related CSS to styles.html.
2020-09-21 10:15:50 -07:00
Albert Krewinkel
acbea6b8c6
Lua filters: add SimpleTable for backwards compatibility (#6575)
A new type `SimpleTable` is made available to Lua filters. It is
similar to the `Table` type in pandoc versions before 2.10;
conversion functions from and to the new Table type are provided.

Old filters using tables now require minimal changes and can use,
e.g.,

    if PANDOC_VERSION > {2,10,1} then
      pandoc.Table = pandoc.SimpleTable
    end

and

    function Table (tbl)
      tbl = pandoc.utils.to_simple_table(tbl)
      …
      return pandoc.utils.from_simple_table(tbl)
    end

to work with the current pandoc version.
2020-09-20 15:48:31 -07:00
Mauro Bieg
caa225ad82
Add CSS to default HTML template (#6601) 2020-09-19 16:13:50 -07:00
a-vrma
6cae8208e7
epub.css: Fix cover page selectors and add note explaining their use. (#6649) 2020-08-30 15:12:12 -07:00
Albert Krewinkel
44c4660a31
Lua filters: make attr argument optional in Table constructor
This changes the Lua API. It is highly unlikely for this change to
affect existing filters, since the documentation for the new Table
constructor (and type) was incomplete and partly wrong before.

The Lua API is now more consistent, as all constructors for elements
with attributes now take attributes as the last parameter.
2020-07-25 20:37:57 +02:00
John MacFarlane
1e84178431 Docx writer: support --number-sections.
Closes #1413.
2020-07-22 11:53:31 -07:00
John MacFarlane
06d834caaa Use selnolig to selectively suppress ligatures with lualatex.
Closes #6534
2020-07-15 13:28:44 -07:00
Frederik Elwert
7716caaf2a
Make polyglossia package options list-aware in the LaTeX template. (#6444) 2020-06-14 10:38:02 -07:00
Salim B
1b3ce80347
update template for reveal.js 4.0.0 (#6390)
cf.
- https://github.com/hakimel/reveal.js/releases/tag/4.0.0
- https://revealjs.com/upgrading/

see also https://github.com/jgm/pandoc-templates/pull/13
2020-05-21 14:30:12 -07:00
John MacFarlane
e2bc913c27 epub.css: wrap overlong lines in highlighted code blocks.
This fixes a problem in iBooks v2.4 with our earlier
horizontally scrolling code blocks.  The problem seems to
be a bug in iBooks, not pandoc, but since iBooks is a major
target we're changing pandoc's default behavior so that
pandoc-produced epubs work on that platform.

Closes #6242.
2020-05-18 22:58:33 -07:00
Lila
f4185fcef0
Use CSS in favor of <br> for display math (#6372)
Some CSS to ensure that display math is
displayed centered and on a new line is now included
in the default HTML-based templates; this may be
overridden if the user wants a different behavior.
2020-05-18 22:45:44 -07:00
John MacFarlane
f11b8ff080 Add abstract and subtitle to opendocument template.
With prior changes, this closes #6369.
2020-05-16 14:40:15 -07:00
John MacFarlane
cc7dcf2a92 ODT: clean up styles.
Add Abstract.

Change Author, Date to centered paragraphs with no character
styling.
2020-05-16 14:38:26 -07:00