M

md-pdf

CLAWHUB · Unverified

Convert Markdown to polished PDF using Pandoc + XeLaTeX for print-quality or browser rendering with emoji and CSS support for rich visuals. Skill: md-pdf Owner: karlzhu-zxc Summary: Convert Markdown to polished PDF using Pandoc + XeLaTeX for print-quality or browser rendering with emoji and CSS support for rich visuals. Tags: latest:1.0.1 Version history: v1.0.1 | 2026-03-26T14:16:26.649Z | user - Removed package-lock.json from the repository. - No changes to the skill's functionality or documentation. v1.0.0 | 2026-03-26T14:15:32.477Z | user - Initial r

62
Rank
84
Safety
953
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 953 downloads reported by the source. Last updated 10/12/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17d46bnyjnxcgj1eynga9hbcd83hmd0:md-pdf
  1. Node.js workspace detected. Install dependencies securely: run `npm ci --ignore-scripts` to prevent post-install lifecycle triggers from running arbitrary code, then selectively audit the dependency tree.
  2. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  3. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-karlzhu-zxc-md-pdf/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

51,632 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: md2pdf
description: High-fidelity Markdown to PDF conversion with two pipelines: Pandoc + XeLaTeX for print-style documents, and browser-rendered HTML/Twemoji for emoji-heavy or WYSIWYG-friendly output. Use when users ask for polished PDF output from .md, want better visual quality than basic markdown renderers, need strong Chinese/CJK support, or specifically need emoji to survive PDF export.
---

# md2pdf

Produce polished, print-ready PDF from Markdown with a stable, reusable pipeline.

## Quick start

1. Install dependencies (Ubuntu/Debian):
   - `bash scripts/install_deps_ubuntu.sh`
2. Convert standard formal Markdown with Pandoc/XeLaTeX:
   - `bash scripts/md2pdf.sh input.md output.pdf`
3. Convert emoji-heavy or browser-like Markdown with CDP browser rendering:
   - `bash scripts/md2pdf-browser.sh input.md output.pdf`
4. Optional: enable cover page / metadata style via defaults:
   - `bash scripts/md2pdf.sh input.md output.pdf --defaults assets/defaults/hifi.yaml`

## Workflow

### 1) Choose the pipeline

Use the LaTeX pipeline when the document is mostly text/tables and should look print-formal.

Use the browser pipeline when any of these are true:

- emoji must render correctly
- HTML/CSS-like appearance matters more than TeX typography
- the Markdown contains GitHub-style formatting that is easier to preserve in HTML
- a CDP browser endpoint is already available

### 2) Prepare source markdown

- Prefer `#`/`##` heading hierarchy (for TOC quality).
- Keep code blocks fenced with language tags (for syntax highlight).
- Keep tables in GFM format.
- For very wide tables, prefer shorter cell content or convert the summary table to bullets before export.

### 3) Run the formal print pipeline

Use `scripts/md2pdf.sh` as the default entrypoint for print-style output.

It applies a professional baseline:

- `--pdf-engine=xelatex`
- Chinese font fallback (`Noto Sans CJK SC`)
- Table of contents (`--toc`)
- Section numbering (`--number-sections`)
- Reasonable margins / line spread / link coloring
- Code highlight style

### 4) Run the emoji-friendly browser pipeline

Use `scripts/md2pdf-browser.sh` when emoji support matters.

It does this:

- render Markdown to HTML
- convert emoji to Twemoji images
- connect to an existing CDP browser (`BROWSER_CDP_URL` or `http://127.0.0.1:9222`)
- print the page to PDF with browser CSS

Example:

- `BROWSER_CDP_URL=http://192.168.1.30:9222 bash scripts/md2pdf-browser.sh input.md output.pdf`

### 5) Tune output quality

Use either:

- CLI flags in `scripts/md2pdf.sh` (quick tuning), or
- defaults file (`assets/defaults/hifi.yaml`) for stable team-wide style.

Recommended adjustments:

- business report: keep `11pt`, margin `2.2cm`, TOC on
- printable manual: increase margin to `2.5cm`
- dense technical doc: keep section numbers and monospace code font
- emoji-heavy travel/share docs: prefer browser pipeline first

## Troubleshooting

- `pandoc: command not found`: run `scripts/install_deps_ubuntu.sh`.

_meta.json

{
  "ownerId": "kn7bq9xffcv2jxmhfxg7kvne3h828rb6",
  "slug": "md-pdf",
  "version": "1.0.1",
  "publishedAt": 1774534586649
}

references/style-guide.md

# md2pdf style guide

## Baseline choices

- Engine: XeLaTeX (best CJK + typography compatibility for mixed Chinese/English docs)
- Font strategy:
  - CJK main font: `Noto Sans CJK SC`
  - Latin serif: `DejaVu Serif`
  - Latin sans: `DejaVu Sans`
  - Monospace/code: `DejaVu Sans Mono`

## Recommended markdown authoring rules

1. Keep one H1 title only.
2. Use H2/H3 hierarchy consistently for TOC.
3. Always annotate fenced code language (e.g. ` ```bash `).
4. Keep tables concise; split very wide tables.
5. Use footnotes for dense annotations.

## Quality profiles

### Business report
- TOC: on
- Numbering: on
- Margin: 2.2cm
- Font size: 11pt

### Manual / print
- TOC: on
- Numbering: on
- Margin: 2.5cm
- Font size: 11pt or 12pt

### Dense technical appendix
- TOC: optional
- Numbering: on
- Margin: 2.0cm
- Font size: 10.5pt or 11pt

## If output still looks plain

- Add a custom LaTeX template and pass via defaults yaml
- Use a stricter markdown style guide for source authoring
- Normalize heading levels before conversion

skill-card.md

## Description:

Converts Markdown to polished PDF through either a Pandoc and XeLaTeX print pipeline or a browser-rendered HTML and Twemoji pipeline for emoji-heavy output.

This skill is ready for commercial/non-commercial use.

## Publisher:

[karlzhu-zxc](https://clawhub.ai/user/karlzhu-zxc)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and technical writers use this skill to turn Markdown documents into print-ready PDFs, including CJK-friendly reports and emoji-heavy documents that need browser-style rendering.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Browser-based rendering can expose sensitive Markdown content to an existing or remote browser session.

Mitigation: Use the browser pipeline only with a trusted local or access-controlled CDP endpoint and avoid processing sensitive or untrusted Markdown through it.

Risk: Active Markdown or embedded HTML may execute during browser rendering.

Mitigation: Add sanitization, disable JavaScript where possible, and block unnecessary network requests before routine use.

Risk: The browser pipeline installs npm dependencies without a lockfile.

Mitigation: Pin dependencies with a lockfile before adopting the skill in a repeatable production workflow.

## Reference(s):

- [md2pdf style guide](references/style-guide.md)
- [Reusable defaults preset](assets/defaults/hifi.yaml)
- [ClawHub skill page](https://clawhub.ai/karlzhu-zxc/skills/md-pdf)

## Skill Output:

**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with inline shell commands and configuration paths]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Produces guidance for generating PDF files from Markdown using local command-line tools.]

## Skill Version(s):

1.0.1 (source: ClawHub release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

package.json

{
  "name": "md2pdf-skill-browser-pipeline",
  "private": true,
  "version": "1.0.0",
  "description": "Browser-based Markdown to PDF pipeline for emoji-friendly output.",
  "license": "MIT",
  "dependencies": {
    "marked": "^16.3.0",
    "puppeteer-core": "^24.22.3",
    "twemoji": "^14.0.2"
  }
}

Sponsored

Ads related to md-pdf and adjacent AI workflows.