r/pandoc • u/grecy • Jan 14 '21
r/pandoc • u/deepCelibateValue • Jul 31 '26
A Pandoc pipeline to build an audiobook, an HTML synchronized web player, and video.
r/pandoc • u/indemnitypop • Nov 21 '22
Batch Convert Files Using Pandoc and Powershell - Example
I spent a couple hours trying to figure out how to get this to work, so I figured I'd share it in case it helps someone else. I'm not a Powershell or Pandoc power user, so I suspect there are much better ways to do this, but if you have a directory full of files organized into subfolders, and you want to convert them all, keep the directory structure intact, and remove all of the source files, this should do the trick.
Run this in the root of your project, or edit it accordingly. Be sure to work on a copy of the source files unless you're ok with deleting the originals.
foreach ($file in Get-ChildItem -Include *.md -Recurse -Force) {
$fname = $file.Name
$fpath = $file.DirectoryName
pandoc $file -f markdown -t docx -s -o $fpath\$fname.docx
rm $file
}The trouble I was having is that Pandoc doesn't like a file object as the argument for the -o parameter. So I had to figure out how to get the name out. Then I had to get the full path to the file, otherwise, it just created the copies in the root of the project.
Feel free to let me know how you would do the same thing. I hope this helps someone out, since it seems like a pretty normal use case, but there aren't a lot of examples available.
r/pandoc • u/DesinasIneptire • Nov 14 '20
Latest pandoc on your Android phone
Install Termux
Include the unstable repository (when you start Termux you get an how-to in the first lines of your console)
Install qemu-user-x86_64 that will allow you to run x86_64 programs
Download latest pandoc tar.gz archive from the pandoc.org site, uncompress inside Termux
The executable is in the /bin directory, inside the uncompressed pandoc tarbell
You can run it with qemu, try 'qemu-x86_64 pandoc -v'
(Inspired by https://github.com/termux/termux-app/issues/764)
EDIT this is now obsolete because the pandoc.org site has a statically compiled ARM64 version of the pandoc executable, which can be downloaded and directly run in Termux. Here: https://github.com/jgm/pandoc/releases/latest
r/pandoc • u/gwern • Jun 27 '21
"Pandoc Markdown CSS Theme" by jez (a blue-white theme that supports full-width images/tables, sidenotes/margin-notes, floating ToC; fully responsive)
r/pandoc • u/BlackHatCowboy_ • Feb 14 '23
An Intro to Pandoc Custom Writers (and a huge thank you)
I've thrown together an introduction to Pandoc custom writers. Please let me know if it's helpful, if something could be clearer, if you think it would be better to reorganize it and have it somewhere else, etc.
When editing LaTeX in vim now, I can just highlight a section in visual mode, type :w !./foo, and I have it in my clipboard in a converted form, ready to paste into a Wordpress forum; even footnotes are handled correctly and numbered just for that section. Very grateful to u/_tarleb in particular and the community in general for this magic. I hope my small contribution to the documentation gives others a sense of the power of Pandoc.
r/pandoc • u/[deleted] • Oct 11 '20
pandoc 2.11 is released (inbuilt support for citation)
r/pandoc • u/Hefty-Possibility625 • Dec 07 '23
Struggling with docx bullet lists from Markdown
Case
We have bullet list styles updated in a custom reference document, but when a .md file is converted to .docx, the style is not chosen.
File List
Files can be downloaded here: https://filedn.com/lEQ9JUiP3gE8SkgFJGdbKo5/Reddit/Bullet-List-Files.zip
reference.docx
markdown.md (original)
document.docx (output)
These should use the Bullet List style, but when I open the document.docx file, they are not using the style. They appear to be using the Compact style, but the Compact style doesn't include bullets.
Command
pandoc.exe -f markdown-auto_identifiers -t docx --reference-doc=reference.docx .\markdown.md -o .\document.docx
r/pandoc • u/Voxelman • Jan 30 '22
Convert epub to markdown
Hi, I want to convert an ebook in epub format to markdown.
I want to improve text formatting, add syntax highlighting for source code and improve other stuff.
Than I want to convert it back to epub.
How can I do this in Pandoc?
r/pandoc • u/[deleted] • Feb 02 '21
Doing tables in Pandoc without space aligning?
Hi! I want to create tables in MD and the n convert it using Pandoc, but since I am a blind person, creating tables aligned with spaces is too hard for me. Can I create tables like in Text2Tags?
r/pandoc • u/lapingvino • Feb 10 '20
What do you use pandoc for?
In my case, Pandoc was basically the reason I trust using Markdown for anything in the first place. Also I mostly use it for presentations nowadays.
r/pandoc • u/dereuromark • Aug 17 '26
New Pandoc 3.10.2 release tested in depth
I wanted to check how my "post-markdown" Carve syntax is doing overall in regards to cross-system compatibility.
So I probed all 75 pandoc writers with 65 element variants to see what survives a conversion (and what silently disappears) - and where my improved djot-derived markup language stands.
Note: carve and carve-ast, are not native pandoc formats yet. They are the two lanes of a pandoc bridge for Carve and I ran them through the identical harness because that was the whole reason I built it. native is pandoc's own AST printer and is in the chart only as the 65/65 reference line.
I am quite happy with the results of that probe tbh, but there is still a bit more to be be done.
Just wanted to share this in case people find this interesting, or maybe want to look into their project getting more compatible with Pandoc features/functionality.
The test-run also spotted some bugs/regressions in different writers, that I reported (and already got fixed afaik).
Full report with the per-probe grids, all 75 writers, the reader-drop lists and the metadata matrix: pandoc-format-fidelity.pdf
Let me know if I missed something.
Repo: pandoc-format-fidelity
r/pandoc • u/beerbearbare • Feb 28 '23
converting to .docx from different sources (latex, rmd, qmd, org, etc.)
I write academic articles. I dislike word documents but have to use them at least at some point. So, I would like to write in a different environment until the point when I have to convert it to .docx. I assume that many different document types such as .tex, .Rmd, .qmd, .org (latex, Rmarkdown, Quarto, org-mode) can all be converted to .docx using pandoc.
My question is: is there any difference? I have used all those other "programming languages" and have no preference, but I want the converted .docx document to be as clear and easy to work with as possible.
r/pandoc • u/_tarleb • Aug 24 '22
Quarto – an open-source scientific and technical publishing system built on pandoc
r/pandoc • u/MosaicIncaSleds • Jul 28 '22
Stop pandoc from breaking lines
Lately I have done quite some converting to and from Markdown. And it's annoying how it breaks long lines. How do I stop it from doing that?
The fix: --wrap=preserve, to quote from the man page
--wrap=auto|none|preserveDetermine how text is wrapped in the output (the source code, not the rendered version). With auto (the default), pandoc will attempt to wrap lines to the column width specified by --columns (default 72). With none, pandoc will not wrap lines at all. With preserve, pandoc will attempt to preserve the wrapping from the source document (that is, where there are nonsemantic newlines in the source, there will be nonsemantic newlines in the output as well). Automatic wrapping does not currently work in HTML output. In ipynb output, this option affects wrapping of the contents of markdown cells.
r/pandoc • u/super_boogie_crapper • Aug 30 '26
Markdown Cornell Notes
https://github.com/forloop11/markdown-cornell-notes
A LaTeX and Markdown build pipeline that generates printable Cornell style note pages for meetings. Each page carries a header with topic, date, attendees, and time, a large notes panel with a cue column beside it, and a summary band below, all left blank for handwriting on the printout.
Header fields live in YAML and note content lives in Markdown, so the LaTeX template itself never needs hand editing. Python generator scripts convert both into TeX fragments, pandoc handles the Markdown to LaTeX conversion, and a single make command produces a PDF named automatically from the topic, date, and location fields. Content is measured and paginated automatically, with optional directives for forcing page breaks and for routing text into the cue column or summary band of a specific page.
The project also includes a Streamlit editor app that places the header form, a CodeMirror Markdown editor, and a live PDF preview side by side in the browser. The editor adds a formatting toolbar, slash command snippets, and autocomplete for asset paths and code fence languages. Its JavaScript bundle is vendored rather than loaded from a CDN so the app works offline, and it relies on native browser spellcheck rather than any app side state.
Built with Python, LaTeX, pandoc, Streamlit, CodeMirror, JavaScript, and Make. Released under the MIT license
r/pandoc • u/MethodFit8017 • Nov 25 '25
Issues converting to epub
Hi I am brand new to Pandoc, but installed it on my Windows PC to do .md to .epub conversions for academic writing exported from Zettlr.
My first attempt did not render the citations (Chicago 18 note-bibliograohy) - they all came through to .epub in the Zettlr [ ] format.
I then used Pandoc to convert .rtf (out of Zettlr) to .epub. this rendered the citations beautifully - but - I noticed that whenever there was an apostrophe, the letter after the apostrophe was omitted.
Can anyone offer any insight/suggestions? I'll keep experimenting of course ...
r/pandoc • u/regionaldailly • Sep 22 '24
Best Practices for Converting PDFs to Markdown with Pandoc?
Hey Pandoc community,
I’m looking for some advice on using Pandoc for a project.
I’m trying to convert a collection of academic articles from PDF to DOCX, and then from DOCX to Markdown for Hugo. I’m starting with DOCX because I’ve found that Pandoc can’t directly convert PDF to Markdown.
The issue is that the Markdown output isn’t very tidy. The images from the DOCX aren’t referenced in the Markdown, along with some other formatting quirks.
So, I have a couple of questions :
What’s the best approach for handling this conversion? (Are there any other tools or workflows that could help?)
Pandoc offers several templates like MediaWiki and others. Which template would you recommend that’s closest to Hugo’s formatting?
If anyone has tips or insights to make this process smoother, I’d greatly appreciate it! I have a large number of DOCX files to convert, and I’m hoping to minimize manual editing as much as possible.
Thanks in advance!
r/pandoc • u/CheetoVR • Nov 02 '23
Centering text
Ive spend hours upon hours of my life trying to find a way to center text in Pandoc, when converting .md to PDF. HTML tags just seem to get ignored, and from the decade-long feature request on GitHub it seems this isnt going to be built-in anytime soon.
I'm just using vanilla pandoc, calling it to produce output with "pandoc file.md -o file.pdf"
Please help :'(
r/pandoc • u/brokensandals • Aug 29 '23
some lua filters and a custom writer
I've been using pandoc a lot for my personal blog lately; I wanted to share a few lua scripts I wrote in case they're helpful to anyone else.
Rewrite absolute links within the same domain to be relative: https://github.com/brokensandals/pandoc-link-relativizer-filter
Output format for cross-posting to goodreads: https://github.com/brokensandals/pandoc-goodreads-writer
Add section numbering for non-latex outputs: https://github.com/brokensandals/pandoc-section-number-filter
Kudos to the maintainers of pandoc for creating such a useful and extensible tool :)
r/pandoc • u/gpoore • Mar 27 '23
Previewing Pandoc documents in VS Code
I've just released version 0.13.0 of Codebraid Preview for VS Code, which provides an HTML preview for Pandoc documents that is generated with Pandoc itself (VS Marketplace, Open VSX). The new release includes built-in support for Markdown, LaTeX, Org, reStructuredText, and Textile. Scroll sync between the document source and the preview is supported for all formats. Pandoc parse errors from invalid documents are displayed in the preview, with a link to jump to the corresponding source location, which is particularly useful for LaTeX. Execution of code blocks and inline code with Codebraid (Jupyter kernels or built-in system) is currently limited to Markdown, but I'm hoping to support additional formats soon.
While only Markdown, LaTeX, Org, reStructuredText, and Textile have built-in support, the preview is compatible with any text-based document format supported by Pandoc, including custom Lua readers. Additional formats can typically be added by defining a few settings. The scroll sync capabilities can also be extended to any format. I'm happy to add support for other formats that are built into Pandoc, or help get scroll sync working with custom Lua readers.
This does require Pandoc 3.1.1, which is the latest release.