Commit graph

400 commits

Author SHA1 Message Date
John MacFarlane
f515f984d4 Revise MANUAL's comment on table-mode. 2019-11-03 14:57:27 -08:00
John MacFarlane
e906e5ac23 Allow pdf output to stdout.
PDF output will not be output to the terminal, but can be
sent to stdout using either `-o -` or a pipe.

The intermediate format will be determined based on
the setting of `--pdf-engine`.

Closes #5751.
2019-11-03 11:44:00 -08:00
John MacFarlane
15e1ca6441 Manual: clarify when macro definitions are passed as raw latex.
In Markdown input, they are always passed through.
In LaTeX, only if `latex_macros` is disabled.
2019-11-02 11:03:47 -07:00
John MacFarlane
db972b8ea0 LaTeX reader: parse macro defs as raw latex...
when `latex_macros` is disabled.  (When `latex_macros` is enabled,
we omit them, since pandoc is applying the macros itself.)

Previously, it was documented that the macro definitions got
passed through as raw latex regardless of whether `latex_macros`
was set -- but in fact they never got passed through.
2019-11-02 10:36:31 -07:00
John MacFarlane
cebf0091ca Document how to use custom writers with --standalone.
Closes #5866.
2019-11-02 08:24:39 -07:00
John MacFarlane
02c579ff3c Revert "ALlow multiple comma-separated files for --defaults."
This reverts commit e96f3fd813.
2019-11-01 21:48:30 -07:00
John MacFarlane
e96f3fd813 ALlow multiple comma-separated files for --defaults. 2019-11-01 10:14:30 -07:00
John MacFarlane
bf9e3faa35 --defaults improvements.
- ToYAML instance is now for `Opt -> Opt`, rather than `Opt`.

- This allows us to handle `--defaults` without clobbering all the
  options that occur prior to `--defaults` on the command line.
  (Note, however, that options in `--defaults` can replace these
  options if the `--defaults` option is used after them,
  which may be a bit confusing given the name.)

- `--defaults` may now be used multiple times on the command line,
  allowing users to break defaults into different chunks.
2019-11-01 09:03:40 -07:00
John MacFarlane
080a3cdaeb Update Template syntax in MANUAL.txt with latest doctemplates. 2019-10-29 22:39:25 -07:00
John MacFarlane
d8d784ab54 Fixed typo in example. 2019-10-14 08:48:51 -07:00
mb21
bfbff3106d KaTeX math: respect classoption=fleqn variable
closes #5815
2019-10-14 08:47:40 -07:00
John MacFarlane
2f32b5316f More documentation of default files 2019-10-11 10:06:01 -07:00
John MacFarlane
9e3e195dd4 Fix gfm_auto_identifiers behavior with emojis.
Closes #5813.

Note that we also now use emoji names for emojis
when `ascii_identifiers` is enabled.
2019-10-11 10:00:33 -07:00
John MacFarlane
34e6464e30 Improve sample --defaults file in MANUAL.txt. 2019-10-11 08:57:49 -07:00
John MacFarlane
7388cd3e7a Improve parsing of --defaults.
- Add FromYAML instances to Opt and to all subsidiary types.
- Remove the use of HsYAML-aeson, which doesn't give good
  position information on errors.
- Rename some fields in Opt to better match cli options or
  reflect what the ycontain [API change]:

  + optMetadataFile -> optMetadataFiles
  + optPDFEngineArgs -> optPDFEngineOpts
  + optWrapText -> optWrap
- Add IpynbOutput enumerated type to Text.Pandoc.App.Opts.
  Use this instead fo a string for optIpynbOutput.
- Add FromYAML instance for Filter in Text.Pandoc.Filters.

With these changes parsing of defaults files should be
complete and should give decent error messages.

Now (unlike before) we get an error if an unknown field
is used.
2019-10-10 23:21:18 -07:00
John MacFarlane
2523941453 Fix examplel for defaults. 2019-10-10 10:34:35 -07:00
John MacFarlane
5085fe605a Added documentation for --defaults. 2019-10-10 10:33:35 -07:00
John MacFarlane
a3cd74c29b --metadata-file: when multiple files specified, second takes precedence...
on conflicting fields.  This changes earlier behavior (but not in
a release), where first took precedence.

Note that this may seem inconsistent with the behavior of
multiple YAML blocks within a document, where the first takes
precedence.  Still, it is convenient to be able to override
defaults with options later on the command line.
2019-10-10 10:00:45 -07:00
John MacFarlane
68b09a6d81 Make some writers sensitive to 'unlisted' class on headings.
If this is present on a heading with the 'unnumbered' class,
the heading won't appear in the TOC.  This class has no
effect if 'unnumbered' is not also specified.

This affects HTML-based writers (including slide shows
and epub), LateX (including beamer), RTF, and PowerPoint.
Other writers do not yet support `unlisted`.

Closes #1762.
2019-10-10 09:15:40 -07:00
John MacFarlane
3f28e332bf Remove misleading sentence in --variables documentation. 2019-10-07 11:54:51 -07:00
John MacFarlane
175c57a966 Clarify that --dpi provides a default and doesn't override...
dpi values specified in the images themselves.  See #5721.
2019-10-06 09:32:45 -07:00
Wandmalfarbe
94a10ea1a5 PR corrections. 2019-10-03 17:24:09 -07:00
Wandmalfarbe
3459700312 Add documentation for the variable hyperrefoptions. 2019-10-03 17:24:09 -07:00
John MacFarlane
0b2dc480be Minor reformatting of exit code table. 2019-09-29 16:33:57 -07:00
John MacFarlane
f03e8c2c6c MANUAL: Use a table for exit codes. 2019-09-29 15:20:11 -07:00
John MacFarlane
054c30228d MANUAL: Put all template variable docs into one section. 2019-09-29 15:14:46 -07:00
John MacFarlane
2956c695f6 MANUAL.txt - use axt headers consistently. 2019-09-29 15:09:41 -07:00
John MacFarlane
ac4067fe2e MANUAL.txt: Add fuller documentation of templates.
Including new template syntax, partials, etc.

Closes #5779.
2019-09-29 15:00:34 -07:00
John MacFarlane
746c92a41a Raise error on unsupported extensions. Closes #4338.
+ An error is now raised if you try to specify (enable or
  disable) an extension that does not affect the given
  format, e.g. `docx+pipe_tables`.

+ The `--list-extensions[=FORMAT]` option now lists only
  extensions that affect the given FORMAT.

+ Text.Pandoc.Error: Add constructors `PandocUnknownReaderError`,
  `PandocUnknownWriterError`, `PandocUnsupportedExtensionError`.
  [API change]

+ Text.Pandoc.Extensions now exports `getAllExtensions`,
  which returns the extensions that affect a given format
  (whether enabled by default or not). [API change]

+ Text.Pandoc.Extensions: change type of `parseFormatSpec`
  from `Either ParseError (String, Extensions -> Extensions)`
  to `Either ParseError (String, [Extension], [Extension])`
  [API change].

+ Text.Pandoc.Readers: change type of `getReader` so it returns
  a value in the PandocMonad instance rather than an Either
  [API change].  Exceptions for unknown formats and unsupported
  extensions are now raised by this function and need not be handled by
  the calling function.

+ Text.Pandoc.Writers: change type of `getWriter` so it returns
  a value in the PandocMonad instance rather than an Either
  [API change].  Exceptions for unknown formats and unsupported
  extensions are now raised by this function and need not be handled by
  the calling function.
2019-09-29 11:43:17 -07:00
John MacFarlane
981b5de790 MANUAL.txt: fixed some markdown errors. 2019-09-28 11:16:46 -07:00
Nils Carlson
8028de3322 odt: Add external option for native numbering
This adds an external options +native_numbering to the
ODT writer enabling enumeration of figures and tables in
ODT output.
2019-09-24 15:23:59 -07:00
John MacFarlane
d247e9f72e Make plain output plainer.
Previously we used the following Project Gutenberg conventions
for plain output:

- extra space before and after level 1 and 2 headings
- all-caps for strong emphasis `LIKE THIS`
- underscores surrounding regular emphasis `_like this_`

This commit makes `plain` output plainer. Strong and Emph
inlines are rendered without special formatting.  Headings
are also rendered without special formatting, and with only
one blank line following.

To restore the former behavior, use `-t plain+gutenberg`.

API change: Add `Ext_gutenberg` constructor to `Extension`.

See #5741.
2019-09-22 11:33:09 -07:00
Nikolay Yakimov
9dbfd23c56 Update documentation wrt docx reader custom style names 2019-09-21 11:37:21 -07:00
Ben Steinberg
7389919bb4 Preserve built-in styles in DOCX with custom style (#5670)
This commit prevents custom styles on divs and spans from overriding
styles on certain elements inside them, like headings, blockquotes,
and links. On those elements, the "native" style is required for the
element to display correctly. This change also allows nesting of
custom styles; in order to do so, it removes the default "Compact"
style applied to Plain blocks, except when inside a table.
2019-09-20 22:13:29 -07:00
John MacFarlane
b222272b60 Add note on --print-default-template explaining how to print partials. 2019-09-16 09:45:03 -07:00
John MacFarlane
4f909c626c Change exit codes.
It's good practice not to use codes 1-2 for user errors.
Also, we used 65 for two different errors.

- PandocAppError was 1, is now 4
- PandocOptionError was 2, is now 6
- PandocMakePDFError was 65, is now 66
2019-09-12 08:46:38 -07:00
John MacFarlane
5aef7d04f0 MANUAL: add section for exit codes. 2019-09-12 08:36:49 -07:00
John MacFarlane
88dc6fac5d Add --shift-heading-level-by option.
Deprecate --base-heading-level.

The new option does everything the old one does, but also
allows negative shifts.  It also promotes the document
metadata (if not null) to a level-1 heading with a +1 shift,
and demotes an initial level-1 heading to document metadata
with a -1 shift. This supports converting documents that
use an initial level-1 heading for the document title.

Closes #5615.
2019-09-10 23:16:13 -07:00
John MacFarlane
4dad7c5e86 MANUAL: document some pptx limitations...
in slide show section:

- no incremental display (#5689)
- no pause with `. . .` (#5701)
2019-09-08 22:41:04 -07:00
John MacFarlane
8696725cd9 Add -L option as shortcut for --lua-filter. 2019-09-08 22:37:38 -07:00
Owen McGrath
92debe4b9e Change optMetadataFile type from Maybe to List (#5702)
Changed optMetadataFile from `Maybe FilePath` to `[FilePath]`. This allows
for multiple YAML metadata files to be added. The new default value has
been changed from `Nothing` to `[]`.

To account for this change in `Text.Pandoc.App`, `metaDataFromFile` now
operates on two `mapM` calls (for `readFileLazy` and `yamlToMeta`) and a fold.

Added a test (command/5700.md) which tests this functionality and
updated MANUAL.txt, as per the contributing guidelines.

With the current behavior, using `foldr1 (<>)`, values within files
specified first will be used over those in later files. (If the reverse
of this behavior would be preferred, it should be fixed by changing
foldr1 to foldl1.)
2019-08-24 09:41:25 -07:00
Mauro Bieg
ace4cdfc23 MANUAL: link to YAML spec (#5687) 2019-08-14 10:09:19 -07:00
John MacFarlane
b35fae6511 Use doctemplates 0.3, change type of writerTemplate.
* Require recent doctemplates.  It is more flexible and
  supports partials.
* Changed type of writerTemplate to Maybe Template instead
  of Maybe String.
* Remove code from the LaTeX, Docbook, and JATS writers that looked in
  the template for strings to determine whether it is a book or an
  article, or whether csquotes is used. This was always kludgy and
  unreliable.  To use csquotes for LaTeX, set `csquotes` in your
  variables or metadata. It is no longer sufficient to put
  `\usepackage{csquotes}` in your template or header includes.
  To specify a book style, use the `documentclass` variable or
  `--top-level-division`.
* Change template code to use new API for doctemplates.
2019-07-28 19:25:45 -07:00
Mauro Bieg
3edee7f68c MANUAL: reveal.js flags (#5653) 2019-07-19 12:21:32 -07:00
Tristan Stenner
09f30d65e4 Add option to include source files in ConTeXt PDFs (#5578)
Add a metadata option (`includesource`) to attach the source documents to the resulting PDF.
2019-07-16 09:31:59 -07:00
Karl Pettersson
5303791bc4 Customizable type of PDF/A for the ConTeXt writer (issue #5608) (#5610)
* Let the user choose type of PDF/A generated with ConTeXt (closes #5608)
* Updated ConTeXt test documents for changes in tagging
* Updated color profile settings in accordance with ConTeXt wiki
* Made ICC profile and output intent for PDF/A customizable
* Read pdfa variable from meta (and updated manual)
2019-07-15 11:55:04 -07:00
John MacFarlane
6d30d3e0b3 Pass through aria- attributes to HTML5.
Also document addition of data- prefix to unknown attributes.

Closes #5646.
2019-07-12 17:03:01 -07:00
Jeroen de Haas
e67f4c58f2 Powerpoint code formatting is now context dependent (#5573)
This commit alters the way in which the Powerpoint writer treats
inline code and code blocks.

- Inline code is now formatted at the same size as the surrounding
  text.
- Code blocks are now given a margin and font size according to their
  level.
- Furthermore this commit allows changing the font with which code is
  formatted via the `monofont` option.

Tested in
- PowerPoint 365 for Windows - 1808 (Build 10730.20344 Click-to-Run)
- PowerPoint 365 for Mac - 16.26 (19060901)
2019-06-14 08:42:06 -07:00
John MacFarlane
b6d564696f Update manual date, readme, man page. 2019-06-11 21:50:10 -07:00
John MacFarlane
931030d95d PDF via ms: make TOC appear at beginning and in PDF bookmarks.
Previously the TOC appeared at the end of the document,
and was not bookmarked.

If you want it to continue appearing at the end, add
`--pdf-engine-opt=--no-toc-relocation` to your command
line.

Closes #5553.
2019-06-08 11:53:37 -07:00