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.
See #10069 -- the static linked pandoc on other OSes also
have a limitation to use binary lua packages. So added
this point at the top of the document. In addition
conda-forge is cross-platform way to install pandoc
and other tools, added to Windows, macOS and
Linux sections.
Co-authored-by: iandol <iandol@seneca.org>
In "Specifying bibliographic data," update the URL for CSL YAML/JSON
HTML-like markup: that section is no longer part of the official CSL
documentation and has been moved to the citeproc-js documentation.
We used to normalize so that the base level is always 1, but
asciidoc no longer seems to care about that, and the behavior
creates difficulties when we are converting fragments.
Closes#10062.
In #9275 we made pandoc strip off locator labels (e.g. `p.`)
for natbib and biblatex output. In fact, this is only desirable
for biblatex. natbib needs the locators to be preserved.
Closes#10057.
The default.latex template defines "part title", "section title" and
"subsection title" via \setbeamertemplate. But for "section title" and
"subsection title", the beamercolorbox also used the "part title"
parameter instead of the "(sub)section title". This had the effect that
for (sub)section pages the color attributes of the part title were used.
Closes#9994. The bug affects e.g. ordered lists with bullet
sublists; after the sublist the top-level list reverts to bullets
instead of being properly numbered.
This regression was introduced in version 3.2.1 and was caused by
commit f5531f1.