Skip to content
ADVERTISEMENT
Sign In
  • Sections
    • News
    • Advice
    • The Review
  • Topics
    • Data
    • Diversity, Equity, & Inclusion
    • Finance & Operations
    • International
    • Leadership & Governance
    • Teaching & Learning
    • Scholarship & Research
    • Student Success
    • Technology
    • Transitions
    • The Workplace
  • Magazine
    • Current Issue
    • Special Issues
    • Podcast: College Matters from The Chronicle
  • Newsletters
  • Events
    • Virtual Events
    • Chronicle On-The-Road
    • Professional Development
  • Ask Chron
  • Store
    • Featured Products
    • Reports
    • Data
    • Collections
    • Back Issues
  • Jobs
    • Find a Job
    • Post a Job
    • Professional Development
    • Career Resources
    • Virtual Career Fair
  • More
  • Sections
    • News
    • Advice
    • The Review
  • Topics
    • Data
    • Diversity, Equity, & Inclusion
    • Finance & Operations
    • International
    • Leadership & Governance
    • Teaching & Learning
    • Scholarship & Research
    • Student Success
    • Technology
    • Transitions
    • The Workplace
  • Magazine
    • Current Issue
    • Special Issues
    • Podcast: College Matters from The Chronicle
  • Newsletters
  • Events
    • Virtual Events
    • Chronicle On-The-Road
    • Professional Development
  • Ask Chron
  • Store
    • Featured Products
    • Reports
    • Data
    • Collections
    • Back Issues
  • Jobs
    • Find a Job
    • Post a Job
    • Professional Development
    • Career Resources
    • Virtual Career Fair
    Upcoming Events:
    College Advising
    Serving Higher Ed
    Chronicle Festival 2025
Sign In
Profhacker Logo

ProfHacker

Teaching, tech, and productivity.

Pandoc Converts All Your (Text) Documents

By Lincoln Mullen February 23, 2012

Pandoc conversion networkFor the past few months we ProfHackers have been running an occasional series about using the command line. I got us started with a couple posts

To continue reading for FREE, please sign in.

Sign In

Or subscribe now to read with unlimited access for as low as $10/month.

Don’t have an account? Sign up now.

A free account provides you access to a limited number of free articles each month, plus newsletters, job postings, salary data, and exclusive store discounts.

Sign Up

Pandoc conversion networkFor the past few months we ProfHackers have been running an occasional series about using the command line. I got us started with a couple posts explaining why you might want to use the command line and how to get started using it. Konrad followed with a posts about the uniq command and the sort command for working with text and data files. Amy added a post about how the command line let her hack the NOOK Color, and I wrote about using pdftk to manipulate PDFs.

Taking up the command line is easier if you have a specific problem you’re trying to solve. For me, the problem was that I wanted to do all of my writing in a plain text format, like Markdown or LaTeX. But I need to be able to share my writing in a variety of formats: HTML for the web, PDF for printed documents or academic writing, and occasionally RTF or Microsoft Word or OpenOffice.

The best way I’ve found to move between these formats is Pandoc. Pandoc is a command line tool written by a philosophy professor, John MacFarlane. Its general use is to take a document in one format and convert it to another. You can get an idea of the wide variety of formats Pandoc can translate by looking at an enlargement of the header diagram.

ADVERTISEMENT

Here’s an example of how this works. Suppose that you have a Markdown document like the one we created for the post on Markdown. (View pandoc-example.markdown on GitHub.) You can convert this to a number of text formats with a simple terminal command:

Markdown to HTML (HTML output on GitHub):

pandoc pandoc-example.markdown -o pandoc-example.html

Markdown to LaTeX (LaTeX output on GitHub):

pandoc pandoc-example.markdown -o pandoc-example.tex

Markdown to DOCX:

pandoc pandoc-example.markdown -o pandoc-example.docx

Markdown to PDF (download PDF):

pandoc pandoc-example.markdown -o pandoc-example.pdf

ADVERTISEMENT

That command calls pandoc, tells it which file to convert (pandoc-example.markdown) and tells it which file to export (e.g., pandoc-example.html). Pandoc figures out what types of files these are from the extension, or you can pass it additional arguments. For some of the formats, you can convert the other way. For example, you could convert LaTex to Markdown or to a Word DOCX, or HTML to Markdown or LaTeX. To convert to PDF, though, you’ll need to have LaTeX installed on your system.

Another useful thing that Pandoc can do is take a URL and convert the webpage to another format. For example, this command turns a page on my website into Markdown.

pandoc -s -r html http://lincolnmullen.com/writing.html -o test.markdown

You can see many more uses for Pandoc on its example page, and you can try some conversions with its online demo.

There are several pros to using Pandoc. It’s easy to install if you use the binaries for Windows or Mac. (It was a bit of a pain for me to compile from source, but there’s no reason you’d need to do that.) The tool is under active development, so bugs are being fixed and occasionally new formats are added. And there are quite a few advanced things that you can do, like create EPUB e-books and automatically generate citations using citeproc-hs and bibliographies like BibTeX (which you can export from Zotero). There are some conversions that it would be nice if Pandoc could do, but it can’t. For example, Pandoc can turn Markdown into a Word DOCX, but it can’t turn a DOCX into Markdown, HTML, etc., because of the limitations of the DOCX format.

ADVERTISEMENT

If you do your writing in plain text or a markup format like LaTeX, Pandoc is an essential, everyday tool for moving between formats. And if you occasionally need to turn HTML into other formats, it’s handy to have Pandoc in your toolkit.

Have you tried Pandoc? What uses have you found for it?

We welcome your thoughts and questions about this article. Please email the editors or submit a letter for publication.
Share
  • Twitter
  • LinkedIn
  • Facebook
  • Email
ADVERTISEMENT
ADVERTISEMENT

More News

Vector illustration of large open scissors  with several workers in seats dangling by white lines
Iced Out
Duke Administrators Accused of Bypassing Shared-Governance Process in Offering Buyouts
Illustration showing money being funnelled into the top of a microscope.
'A New Era'
Higher-Ed Associations Pitch an Alternative to Trump’s Cap on Research Funding
Illustration showing classical columns of various heights, each turning into a stack of coins
Endowment funds
The Nation’s Wealthiest Small Colleges Just Won a Big Tax Exemption
WASHINGTON, DISTICT OF COLUMBIA, UNITED STATES - 2025/04/14: A Pro-Palestinian demonstrator holding a sign with Release Mahmud Khalil written on it, stands in front of the ICE building while joining in a protest. Pro-Palestinian demonstrators rally in front of the ICE building, demanding freedom for Mahmoud Khalil and all those targeted for speaking out against genocide in Palestine. Protesters demand an end to U.S. complicity and solidarity with the resistance in Gaza. (Photo by Probal Rashid/LightRocket via Getty Images)
Campus Activism
An Anonymous Group’s List of Purported Critics of Israel Helped Steer a U.S. Crackdown on Student Activists

From The Review

John T. Scopes as he stood before the judges stand and was sentenced, July 2025.
The Review | Essay
100 Years Ago, the Scopes Monkey Trial Discovered Academic Freedom
By John K. Wilson
Vector illustration of a suited man with a pair of scissors for a tie and an American flag button on his lapel.
The Review | Opinion
A Damaging Endowment Tax Crosses the Finish Line
By Phillip Levine
University of Virginia President Jim Ryan keeps his emotions in check during a news conference, Monday, Nov. 14, 2022 in Charlottesville. Va. Authorities say three people have been killed and two others were wounded in a shooting at the University of Virginia and a student is in custody. (AP Photo/Steve Helber)
The Review | Opinion
Jim Ryan’s Resignation Is a Warning
By Robert Zaretsky

Upcoming Events

07-31-Turbulent-Workday_assets v2_Plain.png
Keeping Your Institution Moving Forward in Turbulent Times
Ascendium_Housing_Plain.png
What It Really Takes to Serve Students’ Basic Needs: Housing
Lead With Insight
  • Explore Content
    • Latest News
    • Newsletters
    • Letters
    • Free Reports and Guides
    • Professional Development
    • Events
    • Chronicle Store
    • Chronicle Intelligence
    • Jobs in Higher Education
    • Post a Job
  • Know The Chronicle
    • About Us
    • Vision, Mission, Values
    • DEI at The Chronicle
    • Write for Us
    • Work at The Chronicle
    • Our Reporting Process
    • Advertise With Us
    • Brand Studio
    • Accessibility Statement
  • Account and Access
    • Manage Your Account
    • Manage Newsletters
    • Individual Subscriptions
    • Group and Institutional Access
    • Subscription & Account FAQ
  • Get Support
    • Contact Us
    • Reprints & Permissions
    • User Agreement
    • Terms and Conditions
    • Privacy Policy
    • California Privacy Policy
    • Do Not Sell My Personal Information
1255 23rd Street, N.W. Washington, D.C. 20037
© 2025 The Chronicle of Higher Education
The Chronicle of Higher Education is academe’s most trusted resource for independent journalism, career development, and forward-looking intelligence. Our readers lead, teach, learn, and innovate with insights from The Chronicle.
Follow Us
  • twitter
  • instagram
  • youtube
  • facebook
  • linkedin