- Document in defaults file section of MANUAL.
- Add to pandoc-lua-engine writer option marshalling.
- Add to pandoc-server initialization of writer options.
This is like `makeSections` but has an additional parameter
specifying number offsets, for use with the `--number-offset` option.
Use `makeSectionsWithOffsets` in HTML writer instead of ad hoc
and inefficient number-adjusting code.
Clarify MANUAL.txt: the `--number-offset` option should only
directly affect numbering of the first section heading in
a document; subsequent headings will increment normally.
Fix test output for #5071 to reflect this.
+ Add command line options `--table-caption-position` and
`--figure-caption-position`. These allow the user to specify whether
to put captions above or below tables and figures, respectively.
The following output formats are supported: HTML (and related such
as EPUB), LaTeX (and Beamer), Docx, ODT/OpenDocument, Typst.
+ Text.Pandoc.Options: add `CaptionPosition` and new
`WriterOptions` fields `writerFigureCaptionPosition` and
`writerTableCaptionPosition` [API change].
+ Text.Pandoc.Opt: add `Opt` fields `optFigureCaptionPosition` and
`optTableCaptionPosition` [API change].
+ Docx writer: make table/figure rendering sensitive to caption
position settings.
+ OpenDocument writer: make table/figure rendering sensitive to
caption position settings.
+ Typst writer/template: implement figure caption positions by
triggering a show rule in the default template, which determines caption
positions for figures and tables globally.
+ LaTeX writer: make table/figure rendering sensitive to caption
position settings. Closes#5116.
+ HTML writer/template: make `<figcaption>` placement sensitive to caption
position settings. For tables, `<caption>` must be the first element,
and positioning is determined by CSS, for here we set a variable
which the default template is sensitive to.
This means that in GFM output, the "new style" math will be used
by default, e.g.
$`x=y`$
```math
x = y
```
To defeat this and get the older behavior, namely
$x=y$
$$x=y$$
one could use `-t gfm-tex_math_gfm`.
See #9121.
so that it is smarter about URLs. URLs are parsed, and we take the
format from the path component, if present.
This means that `https://emacs.org/` will be treated as HTML, while
`https://emacs.org/sample.org` will be treated as Org.
Closes#10141.
wkhtmltopdf is deprecated. weasyprint is the easiest-to-install,
maintained alternative. For better results, one might prefer
pagedjs-cli.
Closes#10142.
This table renderer is pretty basic and uses minimal non-data ink. It
presently renders correctly in the presence of colspans but not
rowspans. Code blocks in table cells are never syntax highlighted
because the present approach of using skylighting's ANSI output is
incompatible with the reflowing done by doclayout's block elements.
(i.e., you get terminal escapes littering your output). No attempt is
made to shrink table width below the available maximum.
Code blocks are indented four spaces. Unhighlighted code blocks are
colored red.
A quirk is that code blocks that are numbered (class numberLines) but
don't set a language get run through skylighting, but the code itself
isn't actually highlighted, so the default red style won't get applied
to them. This isn't reasonably solvable right now.
All headings at the document top-level are green. Headings inner to
structures like blockquotes and lists are not. H1 is bold and all caps.
H2 is bold. H3-H6 are italic. The design here is meant to be relatively
boring/simple and allow telling H1 and H2 apart from each other and from
the remaining heading levels.
The ANSI writer (-t ansi) outputs a document formatted with ANSI control
sequences for reading on the console.
Most Pandoc elements are supported and printed in a reasonable way, if
not always ideally. This version does no detection of terminal
capabilities nor does it fall back to different output styles for
less-capable terminals.
Some gory details:
- Title blocks are formatted with modest extravagance in --standalone
mode.
- Strong, Emph, Underline, and Strikeout spans are all formatted
accordingly using SGR codes (which will be silently ignored by
terminals that don't support them).
- Headings have somewhat arbitrary styles applied to them that
probably need immediate improvement.
- Blockquotes and all flavors of list look pretty good.
- Code spans are colored magenta-on-white, which on the author's
terminal looks kind of like the pinkish treatment of code spans used
by many stylesheets. This probably isn't a good final decision.
- Code blocks are formatted by Skylighting's formatANSI using standard
writer options and included directly in the output. This has some
issues; see code comments.
- Links are printed with OSC 8 to create hyperlinks and colored cyan.
The author's terminal automatically adds a dotted-underline to OSC 8
hyperlinks, but only colors them differently on command-mouseover.
Setting an underlined style on links may be more broadly accessible.
OSC 8 support is not checked for, so on terminals not supporting it or
with support disabled, the link text will be colored but not do
anything and the links will not be printed.
- Images are displayed as their alt text. Support for the Kitty and
iTerm 2 inline image protocols is planned. Supporting other terminals
by using Chafa (https://hpjansson.org/chafa/) to print sixels etc would
be cool too but the author would have to do some FFI stuff and it would
add a dependency to Pandoc.
- Tables are replaced with a useless placeholder. Table output using
box-drawing characters is desired.
- Subscripts and Superscripts are just parenthesized when accurate Unicode
representations aren't available. Because these span types could have
all kinds of semantics, there's not an obvious thing to do with them.
- Simple math is translated to Pandoc inlines using existing
functionality. An ambitious person could look into emulating the
console-mode math output of a computer algebra system, or rendering each
display math element as an image with TeX or Typst and including it, or
some other thing.
For reasons not currently clear to me(!), the tip of doclayout consumes
the breaking space that is followed by nothing (i.e. the ignored raw
LaTeX inline). The tests of djoths itself still pass.
KaTeX (and probably other tools that produce MathML from TeX)
includes an annotation tag with the original TeX; we extract this
if present instead of converting the MathML.
See #9971.
KaTeX emits the mathml followed by a span with an HTML fallback.
Previously pandoc was converting both. We now ignore the HTML
fallback span, marked with class `katex-html`.
Closes#9971.
Multiline rows occur only when the *first* cell is empty; we were
previously treating lines with *any* empty cell as row continuations.
Closes#10093.
In addition, we no longer wrap multiline cells in Para if they
can be represented as Plain. This is consistent with docutils
behavior.