Also, when falling back to a Div with class `figure` for a figure
that can't be represented any other way, include a Div with class
`caption` containing the caption.
Closes#10755.
...to determine what to do about `.pdfhref` macros in `ms`
output.
When no PDF engine is specified, we don't use the `.pdfhref`
macros at all. This gives better results for links in formats
other than PDF, since the link text would simply disappear if
it exists only in a `.pdfhref` macro.
When a PDF engine is specified, escape the argument of
`.pdfhref O` in a way that is appropriate.
Remove `groff` extension.
Text.Pandoc.Extensions: remove `Ext_groff` constructor.
See #10738. This revises the earlier commit
3adcb4bd80.
If `--pdf-engine` is specified or if a PDF is being produced,
we set the `pdf-engine` variable. This allows writers and
templates to behave differently depending on the PDF engine.
When `groff` is used as a PDF engine, the `groff` extension
to `ms` is automatically enabled.
Limitations:
- `groff` currently produces larger PDFs than `pdfroff`.
- With `groff`, a table of contents produced with
`--table-of-contents/--toc` will always be placed at the end of
the document.
- Certain characters (e.g. Greek characters) may be dropped in
the PDF outline.
Closes#10738.
When this extension is enabled, the `ms` writer won't
escape `.pdfhref O` macros in the way that is required
when `pdfroff` is used (octal-encoded UTF-16).
The extension is not enabled by default.
Text.Pandoc.Extensions: add `Ext_groff` constructor [API change].
We now use the plain writer to render these, so that Greek characters
etc. will show up properly.
Note: the ms output this produces works well with pdfroff but not
with `groff -Tpdf`.
The form `\[e aa]` works for groff but not for all roff's (not for
macOS man for instance). So instead we'll emit `e` followed by
an escape for a unicode combining accent.
See #10716.
This affects T.P.RoffChar, T.P.Writers.Roff,
and the Man and Ms writers.
That is, `\(xy` instead of `\[xy]`. This was the original AT&T troff
form and is the most widely supported. The bracketed form causes
problem for some tools, e.g. `makewhatis` on macOS.
Closes#10716.
In LaTeX's tabular environment, the tabular newline takes an optional
argument that we skip. But it only takes a single optional argument, and
any further square-bracketed text that follows shouldn't be skipped.
Fixes#7512, and also adds a test for the original problem raised in
that issue which was already fixed at some point.
This reverts commit 3f1f58e96e.
The reason for reverting this change is that it led to an
undesirable behavior change. Documents with no explicit date
specified now have a date printed, because the default
title block will include a date if no `\date` command is used.
The empty `\date{}`, by contrast, suppressed the date, which
is the desirable behavior.
PR #10687 was motivated by the desire to include a custom `\date`
in the frontmatter via header-includes. I think that aim can
be achieved more simply by simply setting the `date` variable.
In markdown you can even use `date:` in metadata and put some
raw LaTeX there.