Code Monkey home page Code Monkey logo

md2pdf's Introduction

๐Ÿ“Ÿ โ‡’ ๐Ÿ“„ md2pdf

A set of bash scripts to convert Markdown documents to PDF via LaTeX.

Prerequisites

You'll need to install the 2023 version of BasicTeX, along with pandoc.

brew install --cask basictex && brew install pandoc

Install

Clone the repository.

git clone [email protected]:aaronhooper/md2pdf.git

Usage

The main script you will want to use is ./bin/run.sh.

Put your Markdown files in ./src, then run the script in the project root with the following:

bin/run.sh src/document.md

Your freshly pressed PDF will be saved to dist and opened in Preview! ๐Ÿ˜Ž

Configuration

In ./bin/run.sh, you can configure SRC_DIR to the folder where your Markdown is located, and DIST_DIR to the folder where you want your PDFs to go, both relative to the directory you will run the command in.

For example, if you wish to run the command in the root of the project and want your src and dist folders to be located there, then set SRC_DIR to "./src" and DIST_DIR to "./dist" (the default settings).

Emoji

If you want to render emoji in your docs, you'll need to install the emoji package from CTAN using the tlmgr package manager.

sudo tlmgr install emoji

You'll also need lualatex as the PDF engine. Make sure that this is set in ./bin/build.sh. Then, add \usepackage{emoji} to the frontmatter of your doc.

---
header-includes:
  - \usepackage{emoji}
---

To insert an emoji into the document, type \emoji{name}. Here is a list of names you can use.

Gotchas

If you're linking to images using the ![alt text](./images/image.png) syntax, the path will be relative to the directory run.sh has been run in, not the src folder. If you are using the defaults, put your images folder in the root folder outside of ./src, and run the command there as well.

md2pdf's People

Contributors

fxaaron avatar

Watchers

Aaron Hooper avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.