Export Markdown to Social Cards and Long Images
Guide to rendering typography-grade social media cards, WeChat long graphics, and high-DPI poster images directly from raw Markdown with NexusNote.

Key Takeaways
- Eliminate formatting loss when copying between editors and web publishing tools.
- Configure custom card aspect ratios (3:4 for Xiaohongshu/Instagram, 16:9 for X/Twitter).
- Export Retina @2x and @3x PNG images with embedded KaTeX formulas and code themes.
1. Why Copy-Pasting Markdown Breaks Formatting
Most social platforms filter inline CSS styles and SVG rendering elements. When you write equations with KaTeX or complex Mermaid diagrams, raw clipboard copy pastes raw LaTeX code or missing image links.
NexusNote includes an offscreen GPU-rendered snapshot pipeline. It renders your document into clean vector-like canvas layers and outputs standalone PNG long graphics, preserving every single drop-shadow, font ligatures, and code syntax color.
2. Preparing the Document: Typography, Spacing and Image Density
Social platforms compress aggressively. A 1080px-wide card with 14px body text becomes mush after re-encoding; a 3:4 card at 1440–2160px with 28–34px body text survives. Set the export width first, then choose the font size: a useful rule is body text at roughly 2.5% of the card width. NexusNote previews the exact rasterised result before you export, so you are not guessing.
Respect the safe area. Xiaohongshu and Instagram overlay UI on the top and bottom of the image; keep titles and footers at least 8% away from the edges. Long paragraphs are hard to read on a phone, so break them into 2–4 sentence blocks with generous line height (1.6–1.8). Use one accent colour and one heading weight; more variation looks noisy at thumbnail size.
Image density is a conversion decision, not a decoration decision. A 3:4 card with one screenshot, one heading, and two short paragraphs consistently outperforms a wall of text. If the source Markdown contains ten sections, split it into a carousel rather than shrinking everything to fit a single long image. Keep the first card as a standalone hook that makes sense without the rest.
3. Export Recipes by Platform
Xiaohongshu: 3:4, 1440×1920, PNG, light theme, 28–32px body, first card as a hook, 6–9 cards for a tutorial. WeChat Official Accounts: 16:9 or 1:1 within the article body, but keep a separate 2.35:1 cover for the feed. X/Twitter: 16:9, 1600×900, higher contrast because the timeline compresses images twice. LinkedIn: 1.91:1 or 1:1, avoid tiny text because the feed preview crops aggressively.
Export a master at 2× and let each platform downscale. Upscaling a 1080px card to 2160px does not recover detail. Store the exported PNGs next to the source Markdown (for example `exports/2026-11-20/`) so a later revision can be traced back to the exact source version. This matters when a post performs well and you want to reuse it in a different format.
For code-heavy posts, keep syntax colours but raise the minimum font size to 26px and limit lines to about 40 characters. For formula-heavy posts, render KaTeX before rasterising; do not screenshot a browser preview that may have subpixel blur. NexusNote renders formulas and code with the same pipeline as the document, so the exported card matches what you reviewed.
4. A Repeatable Batch Workflow for Content Teams
Standardise the source, not the output. Keep one Markdown file per post with a small front-matter block (title, series, target platforms, cover image). Store theme and font choices in a project-level preset so every card in a series looks related. Reviewers should review the Markdown, not a screenshot of the Markdown.
Batch the mechanical work. Write or update five posts, then export all covers in one pass, then export carousels in a second pass. Switching between writing and exporting destroys focus and increases the chance that one card uses the wrong theme. Treat export as a build step with a checklist: correct title, correct date, no private notes, no broken images, readable at thumbnail size.
Measure what gets saved or shared, not what gets liked. A card that is screenshotted and reposted is doing more acquisition work than a card with passive likes. Keep the source file and exported PNG together so you can iterate on the winning format next week. If a format consistently underperforms, delete the preset instead of accumulating dead templates.
5. The Pre-Export Checklist
Check the source before you check the design. Confirm the title matches the final copy, the author line is correct, and every number or quote has been verified. A beautiful card with a wrong number is worse than an ugly card with the right one, because the wrong number travels farther and is harder to correct after screenshots circulate.
Check the first card separately. It is the only card most readers will see in the feed. It should state the claim, show one piece of evidence, and make the next card feel necessary. If the first card only says "5 tips" without saying what the tips are for, rewrite it before exporting the carousel.
Check the technical details last: file name, dimensions, theme consistency, and whether any private note or TODO leaked into the body. Rename the export with the date and platform (`2026-11-20-xiaohongshu-01.png`) so future-you can find it. A consistent naming scheme is the difference between a reusable asset and a folder of mystery images.
6. When a PDF Is the Better Export
PNG cards are for feeds; PDFs are for reading. If the content is longer than one screen, contains multiple sections, or needs to be printed or annotated, export a PDF instead of a very tall image. A 4000-pixel-tall card is technically shareable but practically unreadable on a phone, and platforms will downscale it until the body text is illegible. Choose the format based on the reading context, not on what looks impressive in the editor.
Use PDF when the document needs structure: headings, page breaks, tables of contents, and stable pagination. Use PNG when the document needs to stop a scroll: one claim, one image, one call to action. The mistake is trying to make one format do both jobs. Decide the reading context first, then choose the export.
Explore the full production solution architecture
Frequently Asked Questions
Can I customize font styles and margins before exporting?
Yes. The export modal provides instant live preview with switches for theme (Light/Dark/Sepia), font family, padding, branding watermark, and card aspect ratios.
What image size should I use for Xiaohongshu and WeChat?
For Xiaohongshu use 3:4 at 1440×1920 (or 2160×2880 for a 2× master). For WeChat article bodies use 16:9 or 1:1; the feed cover is a separate 2.35:1 image. Always export a 2× master and let the platform downscale rather than upscaling a small card.
Do exported images include formulas and code highlighting?
Yes. NexusNote renders KaTeX formulas and syntax-highlighted code through the same offscreen pipeline as the document, then rasterises the result. This avoids the blurry screenshot-of-a-preview problem and keeps a single source of truth for typography.
Continue Reading
Instant Full-Text Search in 180MB PDF Manuals with Local FTS5 Indexing
Creative WritingManaging 500,000-Word Multi-Chapter Novel Manuscripts with AI Plot Tracking
Bulk Editing & SafetyHow to Batch-Edit Hundreds of Markdown Files with AI Safely
ComparisonFree Typora Alternative
ProductNexusNote
Experience Extreme Performance with NexusNote
Local-first native architecture, 12ms cold load, 100 free daily AI credits, and zero telemetry.