Skip to content

Use Pandoc to create a PDF from an Atom editor pane, and view it in another pane.

License

Notifications You must be signed in to change notification settings

allefeld/atom-pandoc-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pandoc/PDF

Pandoc/PDF is a package for the Atom editor that makes it possible to use Pandoc directly from an editor pane to create a PDF, and to view that PDF in another Atom pane.

It is not a preview package, because what you see is the final, high-quality PDF output.

Activated by keyboard shortcut (default Alt-P) or menu item, Pandoc/PDF inserts a toolbar into the active editor, processes the document with Pandoc, and shows the resulting PDF. By default, the document is reprocessed every time it is saved, but that can be deactivated and reprocessing triggered instead with the keyboard shortcut or a toolbar button.

Pandoc/PDF supports all of Pandoc's text-based input formats, including Pandoc's Markdown, reStructuredText, Textile, MediaWiki & DokuWiki markup, and DocBook. It supports PDF generation via Pandoc's latex, beamer, context, html, and ms output formats.

Installation and prerequisites

Install from Atom's Settings/Install dialog (search for pandoc-pdf) or via apm install pandoc-pdf.

Pandoc needs to be installed. For full functionality, version 2.9.1 or later is necessary.

At least one PDF engine needs to be installed:

If you choose Latexmk, see the Pandoc documentation for a list of the LaTeX packages needed by the default template.

To view the generated PDF within Atom, the pdfjs-viewer package is recommended, but pdf-view-plus or pdf-view can be used, too.

If the input format is Pandoc's Markdown, using the language-markdown package with a supported syntax theme is recommended for writing, but this does not affect the functionality of Pandoc/PDF.

Settings

Pandoc/PDF has settings to choose the PDF engine, Pandoc template and defaults file, and configure input file extensions. For a detailed explanation, see the package settings dialog after installation.

Toolbar buttons

The toolbar contains the following buttons:

  Process with Pandoc into PDF

Triggers reprocessing with Pandoc. Processing occurs in the background, and Pandoc's log messages are shown in the "Pandoc log messages" dialog.

  Toggle Pandoc log messages

Toggles an overlay dialog with shows the Pandoc call including command line arguments, Pandoc's log messages, and its exit code. The icon is animated during processing, and changes color if warning or error messages are found. If Pandoc aborts processing with an error, the dialog opens automatically.

  Save generated PDF

Pandoc generates the PDF file in a temporary directory along with other files, and opens it from there. This button allows to save the PDF to a user-chosen directory.

  Open local defaults file in Atom

Recent versions of Pandoc allow options to be specified in a YAML-format "Defaults File". Pandoc/PDF checks whether a file with the same name as the document but the extension .yaml is present in the document's directory, and if yes, passes it to Pandoc. This button creates/opens such a local defaults file in Atom.

  Show intermediate files generated by Pandoc

Opens the temporary directory in the system file browser.

  Show Pandoc/PDF settings

Opens the Pandoc/PDF package settings dialog.

  Show Pandoc User's Guide

Opens https://pandoc.org/MANUAL.pdf within Atom for quick reference. Note that only a subset of Pandoc's capabilities are relevant for Pandoc/PDF.


This software is copyrighted © 2020 by Carsten Allefeld and released under the terms of the MIT license.

About

Use Pandoc to create a PDF from an Atom editor pane, and view it in another pane.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published