Download this page as .mdz

MDZip Studio: Import and Export

In MDZip Studio, File → Import… turns a Word document, a PowerPoint presentation, a PDF and other files into an .mdz, pictures included. File → Export… saves the document you're working on as a Word document, a PDF, a web page, an EPUB book and more.

Studio does this with two free programs, Pandoc and markitdown-mdz, when they're installed. Help → System Integration… installs them: see Helper programs. PDF export needs neither.

Both dialogs show the exact command they run, with a Copy button. You can run it yourself in a terminal, put it in a script, or just see what Studio does: see The command.

Import

Choose File → Import… and pick a file. The dialog says what kind of file it is and which program will convert it, and shows the command. Click Import.

The result opens in View, with the outline on the left, so you can read through what came across. It's a new .mdz that isn't saved yet, so Save asks where to keep it. The file you imported isn't changed. If the window already has a document open, the new one opens in a window of its own.

File Converted by
Word (.docx) Pandoc, or markitdown-mdz
PowerPoint (.pptx) markitdown-mdz
Excel (.xlsx, .xls) markitdown-mdz
PDF markitdown-mdz (text only: a PDF's pictures aren't kept)
Web page (.html) Pandoc, or markitdown-mdz
EPUB book Pandoc, or markitdown-mdz
Jupyter notebook (.ipynb) Pandoc, or markitdown-mdz
OpenDocument text (.odt), Rich Text (.rtf), LaTeX, reStructuredText, Org Pandoc

When both programs can read a file, Studio chooses the first one that's installed, and you can pick the other. Pandoc keeps more of a Word document's structure: tables, footnotes and headings.

Keeping the look

Markdown is plain text, and some things a document can have don't exist in it: a picture's size, a table with merged cells, a shaded cell, underlined text. When you import with Pandoc, Studio keeps them as HTML inside the Markdown, so the document looks like the original in Studio's preview, and Export… → Word document gives them back. You choose which under Keep the look in the dialog. They're all on unless you turn them off, and Studio remembers your choices for the next import.

Choice On: kept as HTML Off: plain Markdown
Picture sizes Each picture at the size the document shows it Pictures at their own size in pixels, so a small, detailed logo can come out large
Complex tables Tables with merged cells, or with headings, lists or several paragraphs in a cell Simple Markdown tables: each cell on one line (list items joined with semicolons, headings in bold), and a merged cell split into that cell and empty ones
Table shading and lines (Word only) Shaded cells, and tables lined differently from most of the document's Every table looks like the document's usual table
Underline, superscript and highlight These, and subscript and small caps Plain text, so x² becomes x2

What to weigh:

  • HTML looks right, but is harder to edit. A table written in HTML is many lines of tags. Studio's editor can change it, but not as easily as a Markdown table, and other Markdown editors may show it only as code. Turn the choices off when people will mostly edit the text; keep them when the document is mostly read, printed or exported.
  • What you turn off is gone. The .mdz doesn't keep it, so exporting to Word won't bring it back. Choose Keep a copy of the original file (below) if you might need it.
  • A Word document's usual table look comes from its styles. The lines most of its tables share come from Use its styles when exporting to Word (below), not from HTML, so those tables stay Markdown tables when they can. Only tables that differ, or have shaded cells, become HTML.

Each choice that's on adds a switch to the command, such as +image_sizes for picture sizes (-t mdz.lua+image_sizes+html_tables+table_look+html_formatting with all four), so the command in the dialog is always the one Studio runs. Without the switches, as when you run mdz.lua yourself, the result is plain Markdown.

Importing a Word document

A Word document (or template) has three more choices in the dialog:

  • Use its styles when exporting to Word (on unless you turn it off) adds a copy of the document with only its look: its styles, page size and margins, headers and footers with their pictures, and the look most of its tables have (grid lines, say). Its text, other pictures, footnotes, comments and authors' names aren't in the copy. It's saved as styles/reference.docx and named in the manifest, so Export… → Word document looks like the original (see Word styles). Opened in Word, it shows a sample of each of those styles to change; the samples never reach an export.
  • Show it with its fonts and colours (on unless you turn it off) adds its look as a stylesheet, styles/style.css: the fonts, sizes, colours and spacing of its text and headings, its links, and the lines and header shading most of its tables have. Studio's preview, File → Print and PDF export use it, so the document looks like the original there too. See The document's own look.
  • Keep a copy of the original file (off unless you turn it on) adds the file unchanged, in a sources folder. It keeps everything in the original, including comments, tracked changes and authors' names, so think about who you'll share the document with.

An exported document looks like the original as far as Word's standard styles go: headings, normal text, lists and tables, with the shading and lines Keep the look kept. Text the original formatted with a style of its own (say "Company Body") comes out as Pandoc's Body Text.

Conversion notes

Conversion notes (on unless you turn it off, for any file) adds sources/conversion-notes.md, a note that sits beside the document and isn't part of it. Open it from the contents pane. It says:

  • Where it came from: the original's file name (not its folder), size and a checksum, when it was converted, and with which program and version.
  • What didn't come across, for a Word document imported with Pandoc: comments (left out), tracked changes (accepted, so the text reads as if every change had been), shapes and text boxes, fields such as a table of contents or page numbers (their last text, no longer updating), charts, SmartArt, embedded objects, text in several columns, headers and footers, and macros. Each is listed only when the document has it, so you know what to check against the original.
  • What Studio did: the command it ran, the files the choices above added, and any warnings from Pandoc or markitdown-mdz.

With Pandoc, the notes add +notes to the command. markitdown-mdz writes no notes of its own, so with it you get only Studio's part.

The document's own look

A document can carry a stylesheet that says how it looks: its manifest's styles names the file, for example "styles": "styles/style.css". Importing a Word document with Show it with its fonts and colours adds one, and you can write or change one yourself: it's ordinary CSS, written as if the document were a web page of its own.

  • Dark theme. A stylesheet made from a Word document has a dark version of each colour: the same hue, made light enough to read on a dark page. Shaded table cells keep their colour, with dark text on them. A stylesheet you write can do the same with @media (prefers-color-scheme: dark), which follows Studio's theme.
  • Turning it off. View → Document Style shows every document in Studio's own look instead, and Studio remembers the choice. Print and PDF export follow it too.
  • What it can't do. It applies only to the document's pages, not to Studio itself, and it can only use files inside the .mdz: anything it tries to load from the web or your computer is ignored.
  • Other apps. This is MDZip Studio's for now: a proposal would make it part of the MDZip format. Other apps show the document in their own look, and Word export uses the Word styles (below), not the stylesheet.

Export

Choose File → Export… (Ctrl+E). Pick a format, then Export…, and choose where to save the file. Unsaved changes are included. When it's done, the bottom of the dialog says so, with Open and Show in Folder.

Format Made by
Word document Pandoc, with your own Word styles if the document carries them: see Word styles
PDF MDZip Studio itself, from its preview, as File → Print does
Web page (one file) Pandoc: one .html file with the pictures inside it
EPUB book, OpenDocument text, PowerPoint, Rich Text, LaTeX Pandoc

What's exported:

  • The page you're viewing. For an .mdz with several pages, Export takes the one that's open, as Print does.
  • Include the pages it links to, as one document: the first page and every page it links to, in the order the links come, as one document. Links between the pages keep working. In Word, each page starts on a new page.
  • Include all its documents, as one file: for a project (an .mdz of separate documents rather than one document in several pages), every document in one file, each a part of its own.

PDF is always the page you're viewing. It looks the way the preview does and needs nothing installed.

Word styles

An exported Word document uses Pandoc's plain styles unless the .mdz carries a reference document: a Word file whose styles it copies. Headings, body text, tables, fonts, page size, margins, headers and footers all come from it. Only its styles are used, not its text.

To give a document your styles:

  1. Insert the template. Choose File → Insert Word Template. Studio asks Pandoc for its own reference document, which has every style Pandoc uses, adds it as styles/reference.docx, and names it in the manifest. Exporting as Word uses it from then on.
  2. Change its styles in Word. Click styles/reference.docx in the contents pane and choose Open in Word. In Word's Styles pane, right-click a style (Heading 1, Normal, Table, and so on), choose Modify…, and change it. Changing the text itself does nothing; only the styles count. Set page size, margins, headers and footers in Layout as usual.
  3. Save in Word, then save the document. Each time you save in Word, the change comes back into the document. Save the document to keep it.

If Word isn't the app your computer opens .docx files with, use Open With… and pick it. Without either, Extract… the file, change it in Word, and put it back with Replace… (see Other kinds of files).

From then on, File → Export… → Word document uses those styles, for anyone who exports the document: the styles travel inside the .mdz. Other formats ignore it.

File → Insert Word Template needs Pandoc (see Helper programs). If the document already has Word styles, it asks before replacing them.

Your own reference document

Any .docx or .dotx works, such as your organization's template, though Pandoc's has every style it uses. Add it in the contents pane (right-click a folder, or the top of the list, and choose Add Files…), then name it in the manifest: select manifest.json, switch to its JSON, and set the pandoc entry to the file's path in the archive:

"pandoc": { "referenceDoc": "styles/company.dotx" }

To make Pandoc's reference document yourself, run pandoc -o reference.docx --print-default-data-file reference.docx in a terminal. That's what Insert Word Template does.

This is a setting of mdzip-pandoc, the part of Pandoc's toolkit that reads .mdz files: Word styles carried in the .mdz has more, including an example archive whose tables have grid lines.

The command

The command in each dialog is exactly what Studio runs, with your file's name, quoted for PowerShell on Windows or the usual shell on macOS and Linux. Run it in the file's folder.

Commands for an .mdz use mdz.lua and docx.lua, from mdzip-pandoc. Studio has its own copy; to run the commands yourself, download mdzip-pandoc, unzip it, and put the path of its mdz.lua in the command.

When you export a page other than the first, the command starts by setting MDZ_DOCUMENT to that page's path in the archive, which tells mdz.lua which page to convert:

  • PowerShell: $env:MDZ_DOCUMENT = "chapters/install.md"; pandoc -f mdz.lua guide.mdz -o guide.docx
  • macOS and Linux: MDZ_DOCUMENT=chapters/install.md pandoc -f mdz.lua guide.mdz -o guide.docx

For PDF, the dialog shows the Pandoc command that does much the same. From a terminal, Pandoc needs a PDF engine for that, such as Typst.

When something goes wrong

  • A format or program is greyed out: it isn't installed, or it's too old (Studio needs Pandoc 3 or newer). The dialog links to Help → System Integration…, where you can install or update it.
  • markitdown-mdz says it's missing readers for this kind of file: it was installed without MarkItDown's readers for Word, PowerPoint, Excel and PDF. The dialog shows the command that adds them; run it in a terminal and try again.
  • It takes a long time: a long document with many pictures can take a minute. Cancel stops Pandoc or markitdown-mdz; nothing is saved.
  • Pandoc's warnings: after an export, anything Pandoc warned about (a picture it couldn't find, for example) is listed in the dialog. The file is still saved.

This page renders from studio-import-export.mdz (MDZip, ~8 KB, updated 2026-11-23) — one self-contained file. Download it, open it in the web editor, or read how these pages are made. Built with @mdzip/renderer.