Repository navigation
Troubleshooting
pnpx @skxv/leafmark doctorThen rebuild with intermediate files retained:
pnpx @skxv/leafmark --keep-build-filesInstall Pandoc and restart the terminal so PATH is refreshed. See Installation.
Install XeLaTeX or pdfLaTeX. XeLaTeX is recommended for system and OpenType fonts. If only HTML is needed, use --html-only.
- Inspect Pandoc/LaTeX's reported missing package or font.
- Verify font names and local font paths.
- Inspect
dist/_pandoc-fonts.texand_pandoc-build-includes.texwith--keep-build-files. - Ensure theme LaTeX includes are compatible with the chosen engine.
Install Poppler, use --no-merge-cover, or remove coverpage. Confirm the configured cover exists and is already a PDF.
The configured frontmatter file must begin with a fenced YAML document:
---
title: Example
---If the file is normal chapter content, rename it or set frontmatter: false in config.
styles must be a YAML list and each file must exist relative to the active project:
styles:
- styles/report.cssDo not write styles: styles/report.css as a scalar.
Update Leafmark to the latest version. For fenced HTML, ensure the opening language is html or htm and that the closing fence uses the same character with at least the same length:
```html
<div class="card">Rendered content</div>
```The generated image Markdown must not remain inside an unterminated code fence.
They are temporary and are deleted after a successful build. The images have already been embedded into the PDF or DOCX. Use:
pnpx @skxv/leafmark --keep-build-filesInstall Chrome, Chromium, Edge, or Brave in its normal platform location. This is required only for HTML blocks in PDF/DOCX; --html-only preserves HTML without screenshotting it.
- Confirm every stylesheet path exists.
- Use a visible background and text color.
- Ensure local fonts and image resources resolve.
- Remember that JavaScript is disabled.
- Inspect the generated PNG with
--keep-build-files. - Split very tall blocks.
- Confirm the bibliography file exists.
- Check that
[@key]exactly matches a BibTeX entry key. - Ensure
bibliographyis notfalseor empty. - Fix malformed BibTeX before rebuilding.
Run leafmark order, inspect the config order array, or pass chapter names explicitly. Files not present in the saved order are appended.
Run leafmark status <folder> to confirm the active input and chapters. A direct .md target writes beside the source by default; folder builds write to ./dist. Use --output for an explicit location.
theme use replaces .leafmark/theme/. Store reusable changes in a theme repository, or keep project-specific overrides outside that directory.
Leafmark owns the generated PDF preamble. Move custom LaTeX into a theme include, fonts.latexInclude, or a Lua/Pandoc extension.
Ensure output is not placed inside a watched non-ignored source path. The normal workspace output root is ignored automatically; unusual custom paths can create noisy workflows.
Collect:
-
leafmark doctoroutput; - the exact command;
- the full error;
- relevant config/frontmatter with secrets removed;
- Leafmark, Node, and Pandoc versions;
- a minimal reproducing chapter.
Then open an issue in the Leafmark repository.
Leafmark documentation · Source repository · npm
Leafmark Wiki
Authoring
Configuration
Building
Help