Commit graph

738 commits

Author SHA1 Message Date
Albert Krewinkel
16d134218b HTML writer: revert to using width property for column widths
The default `flex` and `overflow-x` properties of a column are set to
`auto`. In combination, these changes allow to get good results when
using columns with or without explicit widths.
2022-08-22 15:32:39 +02:00
luz paz
aff726b460 Fix typos
Found via `codespell -q 3 -S changelog.md -L bu,fo,ist,mke,multline,noes,ot,pard,pres,tabl,te,tothe`
2022-08-21 20:23:00 -07:00
Albert Krewinkel
90d8205e17
Org template: add abstract from metadata as block of type "abstract"
See #8204.
2022-08-17 16:40:54 +02:00
Albert Krewinkel
eb18267407
LaTeX template: fix behavior of colorlinks variable
Fixes a regression that required the `boxlinks` variable to be set in
addition to the usual link coloring variables. Otherwise links were
never colored in LaTeX PDF output.

Fixes: #8226
2022-08-12 00:11:10 +02:00
John MacFarlane
473c3f22ec Improve default CSS for task lists.
This ensures that there is a space between the checkbox
and the following content and that subsequent content lines up.

Closes #8151.

Supersedes and closes #8163.
2022-08-03 09:51:21 -07:00
Albert Krewinkel
0e8f424d9e HTML: use CSS flex boxes for columns.
This allows to render an arbitrary number of columns, while the previous
approach assumed exactly two columns.
2022-08-01 10:12:13 -07:00
John MacFarlane
d2bd9abc4d Html template styles: remove span.underline.
Now we use `<u>` elements for underlined text, so this is
superfluous. (@mb21 correct me if I'm wrong.)
2022-07-31 09:51:54 -07:00
John MacFarlane
c97c4761a8 Add boxlinks variable for LaTeX/PDF output.
If `boxlinks` is set but `colorlinks` is not, then boxes will
be printed around links (`hidelinks` will not be set in `hypersetup`).

Addresses #8198.
2022-07-26 09:48:17 -07:00
John MacFarlane
c950a28191 ms template: redefine rather than removing .CH macro.
This responds to feedback in #8175.
2022-07-12 00:03:51 +02:00
John MacFarlane
05ab2060d6 ms writer: add comment in preamble stating generator. 2022-07-11 23:40:45 +02:00
Albert Krewinkel
41af476a3d
JATS template: mark authors with cor-id as corresponding authors
Corresponding authors are marked by setting the attribute
`corresp="yes"` in their respective `<contrib>` element.
2022-06-24 15:44:38 +02:00
Castedo Ellerman
e7269beeb6
Follow JATS4R recommendation and PudMed Central (#8041)
Using the default jats template of pandoc 2.18, the https://jats4r.org/jats4r-validator/ warns: "The license URI is given in `@xlink:href`. For JATS 1.1d3 and later, if the license is defined by a canonical URI, then it should be specified in the `<ali:license_ref>` child element."

I can confirm that what JATS4R recommends here is consistent with the JATS article packages found on the FTP site for the
PubMed Central Open Access Subset <https://www.ncbi.nlm.nih.gov/pmc/tools/openftlist/> (at least with the eLife article I looked at).

This proposed change follows the JATS4R recommendation and an example eLife article on the PubMed Central FTP site.
2022-06-22 10:17:24 -07:00
Albert Krewinkel
f49bee5c31
ConTeXt writer: support complex table structures. (#8116)
The following table feature are now supported in ConTeXt:

- colspans,
- rowspans,
- multiple bodies,
- row headers, and
- multi-row table head and foot.

The wrapping `placetable` environment is also given a `reference` option
with the table identifier, enabling referencing of the table from within
the document.
2022-06-21 10:22:34 -07:00
John MacFarlane
786a2d4757 Update default.csl from the latest chicago-author-date.csl. 2022-06-14 20:42:49 -06:00
Albert Krewinkel
e5c41f11de
ConTeXt writer: use "sectionlevel" environment for headings (#8106)
The document hierarchy is now conveyed using the
`\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy
to include pandoc-generated snippets in documents at arbitrary levels.
The more semantic environments "chapter", "section", "subsection", etc.
are used if the `--top-level-division` command line parameter is set to
a non-default value.

Closes: #5539
2022-06-06 09:24:28 -07:00
Albert Krewinkel
9c29d840ff
LaTeX template: fix links-as-notes
The redefinition of `\href` when using `links-as-notes` must happen
after the hyperref package has been loaded.

Fixes: #8077
2022-05-17 16:12:53 +02:00
Albert Krewinkel
843eeae13d
JATS template: include particles, prefix, suffix in names 2022-05-01 13:02:53 +02:00
Albert Krewinkel
3f354ce4b8
JATS template: unconditionally include permissions element
Fixes a bug that caused license information to be omitted when no copyright
information was provided.

Fixes: #8040
2022-04-26 17:48:27 +02:00
Hos Es
b1990b0657
LaTeX template: Fix <200c> character rendering (#8036)
Renamed `\textormath` to `\TextOrMath`.
2022-04-23 11:38:47 +02:00
Albert Krewinkel
dbc80c1a6b
JATS template: allow multiple licenses to be given.
The `license` metadata field can now be used to set the license of an
article; a list can be used to add multiple license statements.
2022-04-04 10:05:32 +02:00
Albert Krewinkel
c694a6e4f5
JATS template: allow multiple copyright statements, years, holders 2022-04-02 15:29:37 +02:00
John MacFarlane
9053214fba LaTeX template: Move urlstyle and xurl commands to after hyperref.
Closes #7978.
2022-03-21 10:42:18 -07:00
John MacFarlane
c9cf8568bf LaTeX template: Fix regression with code in footnotes...
...due to moving hyperref later in the template.

Closes #7964.
2022-03-14 12:28:56 -07:00
John MacFarlane
8d3959ea29 Remove special redefinition of \sout.
This used to be necessary to avoid problems with hyperref,
when headings contain strikeout text, but it does not seem to be
necessary any more (tested).
2022-03-13 17:18:31 -07:00
John MacFarlane
6328ac5097 LaTeX template: Move \sout correction after hyperref.
This fixes the previous change the default.latex.
2022-03-13 15:25:32 -07:00
John MacFarlane
f3fcdd52c8 LaTeX template: move hyperref near end of preamble.
It now comes after header-includes and right before title, author, date,
abstract.

The hyperref documentation says: “Make sure it comes last of your loaded
packages”. The reason is that it redefines many LaTeX commands.

For example, loading it after titlesec (which might be loaded in
header-includes) causes links in the table of contents to point to
the wrong page (#7960).

Closes #5811.

Note:  Users who presuppose hyperref in their header-includes
will now have to add `\usepackage{hyperref}` to their header-includes
to make it available there.  (The redundant `\usepackage` will
do no harm in this case.)
2022-03-13 10:48:09 -07:00
John MacFarlane
bc7f74968e LaTeX template: skip \babelprovide if babel-lang is empty.
This avoids an error.  See #7945.
2022-03-02 08:52:13 -08:00
John MacFarlane
c3cf339f1d RST writer: support all standard metadata ("bibliographic") fields. 2022-03-01 13:20:31 -08:00
John MacFarlane
5375bd1446 DocBook reader: handle complete set of entities...
as specified at <https://www.w3.org/2003/entities/2007doc/byalpha.html>.

Closes #7938.
2022-02-24 15:50:53 -08:00
Albert Krewinkel
46e5937628
Custom writer: default to single quotes for strings
Makes the code more consistent and makes it easier to use double quotes
in strings, which is the usual quoting style used for HTML attributes.

Closes: #7487
2022-01-31 11:33:31 +01:00
Mauro Bieg
9e60142cc9
CSS in HTML template: adjust #TOC and h1 on mobile (#7835) 2022-01-16 09:22:43 -08:00
John MacFarlane
c6cf78a033 Improve on fix to #7506.
Don't boldface code in output formats that can represent
it as monospace.

Define aliases for VI, VB, VBI as well.
2022-01-15 12:57:26 -08:00
John MacFarlane
c40727bfbb Man writer: use custom font V for inline code.
The V font is defined conditionally, so that it renders
like CB in output formats that support that, and like B
in those that don't (e.g. the terminal).

We could just redefine C, but this would affect code
blocks, too, and putting them all in boldface looks ugly,
I think.

Possible drawback: fragments created by pandoc's man
writer will presuppose a nonstandard V font.

Closes #7506.
Supersedes 253467a549.
2022-01-15 12:39:19 -08:00
Kolen Cheung
ed2ab2e2b0
HTML template: load header-includes before math (#7833)
MathJax expect the config comes before loading the MathJax script.
This change of order allows one to config MathJax via header-includes,
which loads before the MathJax script.

This potentially is a breaking change.

However, the only kind math supported by pandoc that is configurable
seems to be katex, and according to src/Text/Pandoc/Writers/HTML.hs
the way it is configured is hard-coded (katex doesn't seem to offer
MathJax style config that is independent of loading katex.)
So it seems it is safe to change this order without breaking
others' documents.

c.f. #2750
2022-01-13 20:31:32 -08:00
John MacFarlane
ceb463e36e EPUB template improvements.
Include abstract in default template.

Also ensure that the essential styles needed by
pandoc (`styles.html` partial) are included in the
templates.  This is important for correct formatting
of CSL bibliographies.

Note that much of the styling in `styles.html` will
be ignored for EPUB, because of the conditional on
`document-css`, but if it is desired, you can set
the `document-css` variable.
2022-01-09 11:33:47 -08:00
John MacFarlane
2e50c8d137 Improve abstract in HTML template.
* Add localized title "abstract", unless `abstract-title` variable
  is set.
* Add `abstract-title` div to abstract CSS.
* Move abstract CSS out of CSL conditional.
* Ensure that abstract is aligned left but indented on all sides.
* Use smaller font for abstract.

Improves #7588.
2022-01-09 10:56:28 -08:00
Jannik Buhr
d908e31fe6
Add abstract to default html template (#7588) 2022-01-09 10:30:10 -08:00
John MacFarlane
811eee7cad ConTeXt template: make title appear in PDF title bar.
This is recommended for accessibility reasons.
Note: doesn't work with macOS Preview.app.

See https://groups.google.com/d/msgid/pandoc-discuss/m2lezx20jq.fsf%40MacBook-Pro-2.hsd1.ca.comcast.net
2022-01-02 22:04:55 -08:00
John MacFarlane
808bcb5d3b Change reference.pptx to use 16:9 aspect ratio.
This is now Powerpoint's default.
2022-01-02 14:58:55 -08:00
Albert Krewinkel
e54f6dcd7a
JATS template: fix position of contrib affiliations in authoring set
Any `<aff>` element must come before any `<email>` element.
2021-12-23 19:09:22 +01:00
Albert Krewinkel
ddd1b85608
JATS templates: fix affiliation tagging in articleauthoring output
Affiliations were `xlink`ed even in the articleauthoring tag set, but
`<aff>` are not allowed as children of `contrib-group` elements in that
tag set. Each affiliation must be listed directly in the contrib
element.
2021-12-23 09:11:54 +01:00
Albert Krewinkel
7954070b01
JATS templates: add support for article subtitles 2021-12-23 09:11:54 +01:00
binaarinen
0610f16f7f
Add a writer for Markua 0.10 (#7729)
Markua is a markdown variant used by Leanpub.
More information about Markua can be found at https://leanpub.com/markua/read.

Adds a new exported function `writeMarkua` from T.P.Writers.Markdown.
[API change]

Closes #1871.

Co-authored by Tim Wisotzki and Samuel Lemmenmeier.
2021-12-19 12:10:41 -08:00
Albert Krewinkel
83b5b79c0e Custom reader: pass list of sources instead of concatenated text
The first argument passed to Lua `Reader` functions is no longer a plain
string but a richer data structure. The structure can easily be
converted to a string by applying `tostring`, but is also a list with
elements that contain each the *text* and *name* of each input source as
a property of the respective name.

A small example is added to the custom reader documentation, showcasing
its use in a reader that creates a syntax-highlighted code block for
each source code file passed as input.

Existing readers must be updated.
2021-12-11 08:59:11 -08:00
Albert Krewinkel
3692a1d1e8
Lua: use package pandoc-lua-marshal (#7719)
The marshaling functions for pandoc's AST are extracted into a separate
package. The package comes with a number of changes:

  - Pandoc's List module was rewritten in C, thereby improving error
    messages.

  - Lists of `Block` and `Inline` elements are marshaled using the new
    list types `Blocks` and `Inlines`, respectively. These types
    currently behave identical to the generic List type, but give better
    error messages. This also opens up the possibility of adding
    element-specific methods to these lists in the future.

  - Elements of type `MetaValue` are no longer pushed as values which
    have `.t` and `.tag` properties. This was already true for
    `MetaString` and `MetaBool` values, which are still marshaled as Lua
    strings and booleans, respectively. Affected values:

      + `MetaBlocks` values are marshaled as a `Blocks` list;

      + `MetaInlines` values are marshaled as a `Inlines` list;

      + `MetaList` values are marshaled as a generic pandoc `List`s.

      + `MetaMap` values are marshaled as plain tables and no longer
        given any metatable.

  - The test suite for marshaled objects and their constructors has
    been extended and improved.

  - A bug in Citation objects, where setting a citation's suffix
    modified it's prefix, has been fixed.
2021-11-27 17:08:01 -08:00
Albert Krewinkel
fe113dd5fa
JATS template: fix incomplete previous commit 2021-11-11 09:44:49 +01:00
Albert Krewinkel
b116022de4
JATS template: fix equal-contrib attribute
The standard requires the value to be either `yes` or `no`, but is was
set to `true` for authors who contributed equally.
2021-11-11 09:38:07 +01:00
John MacFarlane
60233cf07e Remove some extra stuff from data/creole.lua. 2021-11-08 08:13:31 -08:00
Christophe Dervieux
19eb5c6d6a Add disableLayout variable in revealjs template
This allows to modify it using Pandoc variable. Default value is correctly set to false by Pandoc.
2021-11-08 07:28:18 -08:00
John MacFarlane
881b45209e Replace old sample custom reader with a full-featured reader for creole.
This is better as an example.  And it is faster than pandoc's
regular creole parser, which shows that high-performance readers
can be developed this way.
2021-11-07 14:34:56 -08:00