Skip to content

Simple formatting for writers: Pandoc templates to turn a plain text Markdown file with your poem or story into a polished PDF or Word document in Standard Manuscript Format—fast.

License

Notifications You must be signed in to change notification settings

dylan-k/panscribe

Repository files navigation

PanScribe: Pandoc Templates for Writers

Quick formatting for writers. Start with a plain text, markdown-formatted file: a poem or a short story, and use pandoc to quickly create a PDF or Word doc, using Standard Manuscript Format.

Some setup is required, but you'll save time spent on formatting documents, so you can focus on writing, editing, or reading instead.

format different types of writing...

  • poem
  • story
  • novel
  • poetry collection (WIP)
  • stories collection (TODO)

... into standard manuscript format, in a variety of file-types:

  • PDF
  • Word
  • epub
  • mobi / kindle

GETTING STARTED

You'll want to be familiar with a few key concepts, to begin.

  • Markdown, an easy-to-read and easy-to-write syntax for writing in plain text format that's non-proprietary, cross-platform, and archival, to help with re-use. collaboration, version control, and more...

  • Standard Manuscript Format is a formatting style for manuscripts of short stories, novels, poems and other literary works submitted by authors to publishers.

  • Pandoc is tool to efficiently convert what you've written, from one file format to another. (e.g. .docx, .rtf, .tex, .html, .pdf)

You'll need to install some prerequisites before this kit will be useful.

INSTALLATION

  • Download or git clone the files in this repository
  • Save (or symlink) them into your pandoc data directory. (create it if it doesn't exist already)
    • Windows: %APPDATA%\pandoc
    • Mac/Unix: $HOME/.local/share/pandoc.

You can find the default user data directory on your system by looking at the output of pandoc --version.

Data files placed in this directory (for example, reference.odt, reference.docx, epub.css, templates/) will override pandoc's normal defaults. (Note that the user data directory is not created by pandoc, so you will need to create it yourself if you want to make use of it.)

USAGE

This kit helps you transform your plain-text (Markdown) writing—such as poems, stories, or novels—into Standard Manuscript Format for a variety of output file types. Below are examples for PDF and Word. You can adapt these commands for other formats (ePub, MOBI, etc.) by changing the relevant pandoc parameters.

Prose Markdown to PDF

pandoc story.md --pdf-engine=xelatex --template=story.latex --from=markdown_github+yaml_metadata_block --output=story.pdf

Verse Markdown to PDF

pandoc --pdf-engine=lualatex --template=poem.latex --metadata-file=author.yml --lua-filter=linecount.lua --from=gfm+hard_line_breaks "poem.md" --output=output.pdf

...or, a shorter command thanks to the defaults/poem.yml file

pandoc --defaults=poem.yml "poem.md" -o output.pdf

Breakdown of Flags:

  • story.md or poem.md: The input Markdown file
  • --pdf-engine=lualatex: Specifies the LaTeX engine
  • --template=story.latex: Points to your LaTeX template, which implements the Standard Manuscript Format.
  • --from=markdown_github+yaml_metadata_block: Tells Pandoc to expect GitHub-flavored Markdown with YAML metadata blocks.
  • --output=story.pdf: Specifies the output file name and format (PDF).

Chapbook to PDF

The directory contains a script to generate a PDF chapbook from multiple markdown files using Pandoc.

Directory Structure:

writing/
├─ chapbooks/
│  ├─ build.py
│  ├─ chapbook1.md
│  ├─ chapbook2.md
│  └─ README.md
├─ poems/
│  ├─ poem2.md
│  ├─ poem1.md

Usage

  1. Ensure you have Pandoc and Python installed on your system.
  2. Create a markdown file for the chapbook, in the chapbooks\ directory
  3. In the markdown file, include a list of poems, from the poems\ directory:
title: "Example Chapbook 2"
author: "Firstname Lastname"
date: 2025-03-08
contents:
  - "../../poems/poem1.md" # accept a relative path
  - "S:\Directory\poems\poem2.md" # or accept an absolute path
  1. Run the build.py script with the name of the main markdown file as an argument. For example:

    
    python build.py chapbook1.md
    
    
  2. The script will generate a PDF based on the contents specified in the main markdown file.

Convert to Word

pandoc story.md --reference-doc=story-reference.docx --from=markdown_github+yaml_metadata_block --output=manuscript.docx

Pandoc supports a variety of other formats, including .epub, .mobi, and .html. Just adjust the --to or --output flags.

Tips for Best Results

Use YAML Metadata Include a YAML header in your Markdown (e.g., title, author) so Pandoc can automatically fill those fields in the final document.

Place Templates in Pandoc's Data Directory If you put your LaTeX templates and Word references in Pandoc's data directory, you won't need to specify full paths each time.

Tweak As Needed Modify .latex templates or .docx references to fine-tune margins, headers, spacing, or any other manuscript elements.

With PanScribe, you can focus on crafting your writing rather than fiddling with formatting. Happy writing!

See Also

About

Simple formatting for writers: Pandoc templates to turn a plain text Markdown file with your poem or story into a polished PDF or Word document in Standard Manuscript Format—fast.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published