| Age | Commit message (Collapse) | Author |
|
Don't inculde them if `pdf-engine` isn't set.
|
|
This is more reliable; see #10738.
|
|
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 5132f1ef330d3eb2a0bf87037035beaeaf19d3f3 we added `-` to
the list of characters needing backslash escaping, to accommodate
a change in groff man's behavior, described here:
https://lwn.net/Articles/947941/
This change also led `-` to be escaped in ms output, but that
is wrong; `\-` in ms is a unicode minus sign.
To fix this, we add a Boolean parameter to `escapeString` in
Text.Pandoc.Writers.Roff that determines whether `-` is to
be escaped. (NB: This is not an exported function in the API.)
The list `standardEscapes` in Text.Pandoc.RoffChar no longer
contains `-`.
Closes #10536.
|
|
The groff_man (7)` man page indicates that `-` characters will be
treated as typographic hyphens and are not appropriate for cases
where the output should be copy-pasteable as an ASCII
hyphen-minus character. (E.g. in command line options.)
However, until a recent update groff man did not actually do this;
it treated `-` and `\-` the same. With the new update (1.23.0)
the two are distinguished (see https://lwn.net/Articles/947941/
for background), so now it is important that pandoc escape `-`.
This reverts ee60ba5252360d2efbf9cf30197236a21a15a924.
That change was motivated by a problem with backslash-escaping
`-` in a filename for .PSPIC. That's simply a separate issue;
we shouldn't do the normal escapes in such a context. It has
been addressed in the previous commit.
|
|
This improves the man and ms writer output, preventing
sentence breaks after initials.
|
|
See #4475.
+ PDFPIC is now used for PDF images in figures.
+ Inline images that are postscript or PDF are rendered using
PSPIC or PDFPIC. This isn't ideal, because they will still be
rendered as if in a separate paragraph, but it's probably
better than just printing the image name.
+ Units are included in height.
For further improvement, we might consider in Text.Pandoc.PDF
using something like `convertImages` (which we currently use for
converting to PDF via LaTeX) to convert SVG (and other?) images
to PDF so they can be rendered in this way.
|
|
The aim here (see #9020) is to produce more standard and more
portable man pages. To that end:
- We revert the fanciness introduced in #7506, which employs a
custom font name V and a macro that makes this act like boldface
in a terminal and monospace in other formats. Unfortunately,
this code uses a mechanism that is not portable (and does not
work in mandoc).
- Instead of using V for inline code, we simply use CR.
Note that `\f[CR]` is emitted instead of plain `\f[C]`,
because there is no C font in man. (This produces warnings
in recent versions of groff.)
- For code blocks, we now use the `.EX` and `.EE` macros,
together with `.IP` for spacing and indentation. This gives
more standard code that can be better interpreted e.g. by mandoc.
|
|
`pandoc-version`, `outputfile`, `title-prefix`, `epub-cover-image`,
`curdir`, `dzslides-core` can be overridden by `--variable` on the
command line.
Previously they would create lists in the template Context,
which is not desirable.
|
|
Thanks and credit go to Aner Lucero, who laid the groundwork for this
feature in the 2021 GSoC project. He contributed many changes, including
modifications to the readers for HTML, JATS, and LaTeX, and to the HTML
and JATS writers.
Shared (Albert Krewinkel):
- The new function `figureDiv`, exported from `Text.Pandoc.Shared`,
offers a standardized way to convert a figure into a Div element.
Readers (Aner Lucero):
- HTML reader: `<figure>` elements are parsed as figures, with the
caption taken from the respective `<figcaption>` elements.
- JATS reader: The `<fig>` and `<caption>` elements are parsed into
figure elements, even if the contents is more complex.
- LaTeX reader: support for figures with non-image contents and for
subfigures.
- Markdown reader: paragraphs containing just an image are treated as
figures if the `implicit_figures` extension is enabled. The identifier
is used as the figure's identifier and the image description is also
used as figure caption; all other attributes are treated as belonging
to the image.
Writers (Aner Lucero, Albert Krewinkel):
- DokuWiki, Haddock, Jira, Man, MediaWiki, Ms, Muse, PPTX, RTF, TEI,
ZimWiki writers: Figures are rendered like Div elements.
- Asciidoc writer: The figure contents is unwrapped; each image in the
the figure becomes a separate figure.
- Classic custom writers: Figures are passed to the global function
`Figure(caption, contents, attr)`, where `caption` and `contents` are
strings and `attr` is a table of key-value pairs.
- ConTeXt writer: Figures are wrapped in a "placefigure" environment
with `\startplacefigure`/`\endplacefigure`, adding the features
caption and listing title as properties. Subfigures are place in a
single row with the `\startfloatcombination` environment.
- DocBook writer: Uses `mediaobject` elements, unless the figure contains
subfigures or tables, in which case the figure content is unwrapped.
- Docx writer: figures with multiple content blocks are rendered as
tables with style `FigureTable`; like before, single-image figures are
still output as paragraphs with style `Figure` or `Captioned Figure`,
depending on whether a caption is attached.
- DokuWiki writer: Caption and "alt-text" are no longer combined. The
alt text of a figure will now be lost in the conversion.
- FB2 writer: The figure caption is added as alt text to the images in
the figure; pre-existing alt texts are kept.
- ICML writer: Only single-image figures are supported. The contents of
figures with additional elements gets unwrapped.
- HTML writer: the alt text is no longer constructed from the caption,
as was the case with implicit figures. This reduces duplication, but
comes at the risk of images that are missing alt texts. Authors should
take care to provide alt texts for all images.
Some readers, most notably the Markdown reader with the
`implicit_figures` extension, add a caption that's identical to the
image description. The writer checks for this and adds an
`aria-hidden` attribute to the `<figcaption>` element in that case.
- JATS writer: The `<fig>` and `<caption>` elements are used write
figures.
- LaTeX writer: complex figures, e.g. with non-image contents and
subfigures, are supported. The `subfigure` template variable is set if
the document contains subfigures, triggering the conditional loading
of the *subcaption* package. Contants of figures that contain tables
are become unwrapped, as longtable environments are not allowed within
figures.
- Markdown writer: figures are output as implicit figures if possible,
via HTML if the `raw_html` extension is enabled, and as Div elements
otherwise.
- OpenDocument writer: A separate paragraph is generated for each block
element in a figure, each with style `FigureWithCaption`. Behavior for
single-image figures therefore remains unchanged.
- Org writer: Only the first element in a figure is given a caption;
additional block elements in the figure are appended without any
caption being added.
- RST writer: Single-image figures are supported as before; the contents
of more complex images become nested in a container of type `float`.
- Texinfo writer: Figures are rendered as float with type `figure`.
- Textile writer: Figures are rendered with the help of HTML elements.
- XWiki: Figures are placed in a group.
Co-authored-by: Aner Lucero <[email protected]>
|
|
This new module exports `pandocVersion` and `pandocVersionText`,
which are no longer exported from Text.Pandoc.Shared. [API change]
Also, we now set the `pandoc-version` variable centrally rather
than in the writers. One effect is the man writer now emits
a comment with the pandoc version (this was intended before,
judging from the template, but it didn't happen because the
vairable wasn't set).
|
|
|
|
Previously they were being translated to eqn as inline equations.
Closes #8308.
|
|
This responds to feedback in #8175.
|
|
Previously we used our own homespun formatting. But this
produces over-long lines that aren't ideal for diffs in tests.
Easier to use something off-the-shelf and standard.
Closes #7580.
Performance is slower by about a factor of 10, but this isn't
really a problem because native isn't suitable as a serialization
format. (For serialization you should use json, because the reader
is so much faster than native.)
|
|
|
|
paragraph indent is set to 0 (as is the default).
Also ensure indent for display math that falls back
to TeX.
|
|
|
|
This is less ugly than Times.
|
|
|
|
Like LaTeX, ConTeXt.
|
|
To be more like the default LaTeX output.
|
|
For discussion see
https://groups.google.com/forum/#!msg/pandoc-discuss/B-oiCXcQOVo/WO-BXVpICAAJ
The `\-` gets rendered in HTML and PDF as a unicode minus sign.
|
|
Because we use it as a delimiter for tables (in man)
and for math (in ms).
|
|
T.P.GroffChar: replaced `essentialEscapes` with `manEscapes`,
which includes all the escapes mentioned in the groff_man manual.
T.P.Writers.Groff: removed escapeCode; changed parameter on
escapeString from Bool to new type `EscapeMode`.
Rewrote `escapeString`.
|
|
- Improve escaping of accented characters with `--ascii`.
Combining accents are now handled properly.
- Don't escape spaces and tabs in code blocks. This doesn't
seem to be necessary.
|
|
It is the ascii - sign, not the unicode hyphen.
|
|
- `--ascii` is now turned on automatically for man output, for
portability. All man output will be escaped to ASCII.
- In T.P.Writers.Groff, `escapeChar`, `escapeString`, and
`escapeCode` now take a boolean parameter that selects
ascii-only output. This is used by the Ms writer for
`--ascii`, instead of doing an extra pass after writing
the document.
- In ms output without `--ascii`, unicode is used whenever
possible (e.g. for double quotes).
- A few escapes are changed: e.g. `\[rs]` instead of `\\` for
backslash, and `\ga]` instead of `` \` `` for backtick.
|
|
|
|
(unexported module). These are used in both the man and ms
writers.
Moved groffEscape out of Text.Pandoc.Writers.Shared [cancels earlier
API change from adding it, which was after last release].
This fixes strong/code combination on man (should be `\f[CB]` not
`\f[BC]`), mentioned in #4973.
Updated tests.
Closes #4975.
|
|
Previously .ND was used, but this only works if you
have a title page, which we don't. Thanks to @teoric.
|
|
* Use `\f[R]` rather than `\f[]` to reset. The latter
returns to the previous font, which gives unintended
results in some cases.
* Use `\f[BI]` and `\f[CB]` in headers, instead of `\f[I]` and `\f[C]`,
since the header font is automatically bold.
* Use `\f[CB]` rather than `\f[BC]` for monospace bold.
Closes #4552.
|
|
Closes #4550.
|
|
Previously we escaped hyphens as `\-`, but that's a minus sign.
Closes #4467.
Updated changelog.
|
|
This is now the default for pandoc's Markdown.
It allows whitespace between the two parts of a
reference link: e.g.
[a] [b]
[b]: url
This is now forbidden by default.
Closes #2602.
|
|
Previously some indents weren't wide enough, leading
the list item to start on a line after the marker.
|
|
|
|
- added some variables to the default template.
- cleaner output for images (stringify alt text).
|
|
Otherwise we may get unescaped @s that give eqn fits,
with @ as the delimiter character.
|
|
Closes #3547.
Macro definitions are inserted in the template when there is highlighted
code.
Limitations: background colors and underline currently not
supported.
|
|
|
|
|
|
|
|
The `|` delimiter had a bad interaction with tbl.
See discussion in #1839.
|
|
Also add config options for link color.
|
|
|
|
|
|
Pending groff definitions for striking out an arbitrary
section of text (not just a few words).
|
|
|