Table of Contents
This tip is about the how to Convert Files on Linux Command Line using Pandoc. So read this free guide, How to Convert Files on Linux Command Line using Pandoc step by step. If you have query related to same article you may contact us.
How to Convert Files on Linux Command Line using Pandoc – Guide
Pandoc can convert .docx files to .pdf and .html, but you might be thinking, “Word can also export files to .pdf and .html. What do I need Pandoc for?” You would have a good argument, but since Pandoc can convert so many formats, it can become your tool for all your conversion tasks. For example, many of us know that Markdown editors can export their Markdown files to .html. Pandoc can also be used to convert Markdown files to many other formats.
How to Use pandoc to convert files on Linux command line
Configuring Pandoc
Use Pandoc without any files
Steps:
Basics of Markdown
Note: Markdown files extension: .md
Blockquoted header
This is block citation text.
Example :
+ One– Two* Three Output:
Create a Markdown file
Before starting, create and populate a Markdown file first using the steps below in an Ubuntu environment,
converting files
Let’s convert the Markdown formatted file to HTML format using the command below, Command: pandoc -o sample.html sample.md
Specifying file formats
Pandoc allows you to specify the required file formats during conversion. Although not mandatory, sometimes you need to specify the format when both file formats use the same extension, such as “TeX” and “LaTeX” both use the “.tex” extension. Command: pandoc -f markdown -t latex -s -o sample.tex sample.mdDecode the syntax:
Generating PDFs
Pandoc makes use of the LatTeX pdf engine to generate pdfs. It is recommended to install a LatTeX editor to satisfy all dependencies correctly. The easy-to-use editor is “Texmaker.” Command to install Pandoc on various Linux based operating systems, Ubuntu: sudo apt-get install texmakerFedora: sudo dnf install texmakerManjaro: sudo pacman -Syu texmaker
easy steps
Final note
I hope you like the guide How to Convert Files on Linux Command Line using Pandoc. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.