{"skill":{"slug":"pandic-office","displayName":"md-to-office","summary":"Converts Markdown files to PDF files using the pandoc command-line utility. Use when a user asks to convert a .md or markdown file to a .pdf file.","description":"---\nname: local-pandoc\ndescription: Converts Markdown files to PDF files using the pandoc command-line utility. Use when a user asks to convert a .md or markdown file to a .pdf file.\n---\n\n# Local Pandoc Conversion Skill\n\nThis skill uses the `pandoc` command-line utility to convert documents between numerous markup formats.\n\n## Basic Usage\n\nThe fundamental structure of a `pandoc` command is:\n\n```bash\npandoc [options] [input-file]…\n```\n\n### Simple Conversion\n\nTo convert a Markdown file to HTML:\n\n```bash\npandoc -o output.html input.md\n```\n\n### Specifying Formats\n\nWhile `pandoc` can infer formats from file extensions, you can be explicit with the `-f` (from) and `-t` (to) flags.\n\n```bash\n# Convert HTML to Markdown\npandoc -f html -t markdown input.html\n```\n\n### Standalone Documents\n\nTo create a complete document with a proper header and footer (e.g., a full HTML file), use the `-s` or `--standalone` flag.\n\n```bash\npandoc -s -o output.html input.md\n```\n\n## Advanced Examples\n\nThe following examples are extracted from the official Pandoc User's Guide.\n\n### PDF Output\n\nTo create a PDF, `pandoc` typically uses a LaTeX engine. Ensure one is installed.\n\n```bash\n# Basic PDF creation\npandoc input.md -o output.pdf\n\n# Control PDF engine and style via variables\npandoc input.md -o output.pdf --pdf-engine=xelatex -V geometry:margin=1in -V fontsize=12pt\n```\n\n### Document Structure & Metadata\n\nPandoc can automatically generate a table of contents and use document metadata.\n\n```bash\n# Create a document with a Table of Contents (up to level 3 headings)\npandoc --toc --toc-depth=3 -o output.docx input.md\n\n# Set metadata fields from the command line\npandoc -M title:\"My Report\" -M author:\"Galactus\" -o output.pdf input.md\n```\n\n### Templates and Styling\n\nYou can control the final output's structure and style with templates and other options.\n\n```bash\n# Use a custom template for HTML output\npandoc -s --template=my-template.html -o output.html input.md\n\n# For HTML output, link to a custom CSS file\npandoc -s --css=styles.css -o output.html input.md\n\n# For DOCX output, use a reference document for styling\npandoc --reference-doc=reference.docx -o output.docx input.md\n```\n\n### Reading from the Web\n\nPandoc can directly fetch and convert content from a URL.\n\n```bash\npandoc -f html -t markdown https://www.fsf.org\n```\n\n### Other Useful Options\n\n```bash\n# Preserve tabs instead of converting them to spaces\npandoc --preserve-tabs ...\n\n# Control line wrapping in the output source code\npandoc --wrap=none ...\n\n# Shift heading levels (e.g., make all H1s into H2s, H2s into H3s)\npandoc --shift-heading-level-by=1 ...\n```\nThis enhanced documentation provides a more robust foundation for using `pandoc`.\n","topics":["PDF"],"tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":2787,"installsAllTime":105,"installsCurrent":6,"stars":0,"versions":1},"createdAt":1769871238870,"updatedAt":1778987519601},"latestVersion":{"version":"1.0.0","createdAt":1769871238870,"changelog":"- Initial release of the pandic-office (local-pandoc) skill.\n- Converts Markdown (.md) files to PDF using the pandoc command-line utility.\n- Provides basic and advanced usage examples, including HTML, DOCX, metadata, templates, CSS styling, and downloading content from URLs.\n- Covers PDF generation options with custom engines and document styling.\n- Includes examples for creating standalone documents, table of contents, and custom document metadata.","license":null},"metadata":null,"owner":{"handle":"piyushduggal-source","userId":"s178xdzhqeg4296pzn6qqqv7es884d8x","displayName":"PiyushDuggal-source","image":"https://avatars.githubusercontent.com/u/63952890?v=4"},"moderation":null}