diff --git a/Dockerfile b/Dockerfile index 8ee4610..0fbf7b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt update && \ - apt install wget texlive-luatex texlive-lang-cjk lmodern texlive-xetex -y && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* + apt install wget texlive-luatex texlive-lang-cjk lmodern texlive-xetex -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* RUN wget https://github.com/jgm/pandoc/releases/download/2.7.2/pandoc-2.7.2-1-amd64.deb && \ dpkg -i pandoc-2.7.2-1-amd64.deb && \ diff --git a/README.md b/README.md index fd7ed90..c6b5d2b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ You can see example markdown file and converted PDF file from the link below👇 ## Getting Started 1. Pull docker image. + ```bash $ docker pull plass/mdtopdf ``` @@ -22,29 +23,46 @@ $ docker pull plass/mdtopdf ⚠️ This docker image size is **1.68GB**. I recommend pulling it using the fast Internet connection. 2. Generate PDF file. + ```bash $ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtopdf INPUT.md ``` ## Advanced Usages +### Generate 2 columns PDF file + +```bash +$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtopdf-2cols INPUT.md +``` + ### Generate PDF file on save ```bash $ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf w-mdtopdf INPUT.md ``` +### Generate 2 columns PDF file on save + +```bash +$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf w-mdtopdf-2cols INPUT.md +``` + ### Set alias You can decrease typing using `alias` command as below, ```bash $ echo "alias mdtopdf='docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtopdf'" >> ~/.bash_profile +$ echo "alias mdtopdf-2cols='docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtopdf-2cols'" >> ~/.bash_profile $ echo "alias w-mdtopdf='docker run -it --rm -v `pwd`:/workdir plass/mdtopdf w-mdtopdf'" >> ~/.bash_profile +$ echo "alias w-mdtopdf-2cols='docker run -it --rm -v `pwd`:/workdir plass/mdtopdf w-mdtopdf-2cols'" >> ~/.bash_profile $ source ~/.bash_profile - + $ mdtopdf INPUT.md +$ mdtopdf-2cols INPUT.md $ w-mdtopdf INPUT.md +$ w-mdtopdf-2cols INPUT.md ``` **zsh** : Modify `.zshrc` instead of `.bash_profile`. @@ -54,4 +72,5 @@ $ w-mdtopdf INPUT.md ```bash $ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtotex INPUT.md +$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtotex-2cols INPUT.md ``` diff --git a/scripts/mdtopdf-2cols b/scripts/mdtopdf-2cols new file mode 100755 index 0000000..e32f287 --- /dev/null +++ b/scripts/mdtopdf-2cols @@ -0,0 +1,7 @@ +#!/bin/bash +str=$1 +pandoc -s -N ${str%.*}.md -o ${str%.*}.pdf -V documentclass=ltjarticle --pdf-engine=lualatex \ +-F pandoc-crossref \ +-M "crossrefYaml=/config/crossref_config.yaml" \ +-V geometry:margin=1in \ +-V classoption=twocolumn diff --git a/scripts/mdtotex-2cols b/scripts/mdtotex-2cols new file mode 100755 index 0000000..7a07880 --- /dev/null +++ b/scripts/mdtotex-2cols @@ -0,0 +1,7 @@ +#!/bin/bash +str=$1 +pandoc -s -N ${str%.*}.md -o ${str%.*}.tex -V documentclass=ltjarticle --pdf-engine=lualatex \ +-F pandoc-crossref \ +-M "crossrefYaml=/config/crossref_config.yaml" \ +-V geometry:margin=1in \ +-V classoption=twocolumn \ No newline at end of file diff --git a/scripts/w-mdtopdf-2cols b/scripts/w-mdtopdf-2cols new file mode 100755 index 0000000..8b28974 --- /dev/null +++ b/scripts/w-mdtopdf-2cols @@ -0,0 +1,3 @@ +#! /bin/bash + +watcher $1 mdtopdf-2cols $1 diff --git a/scripts/w-mdtotex-2cols b/scripts/w-mdtotex-2cols new file mode 100755 index 0000000..626b542 --- /dev/null +++ b/scripts/w-mdtotex-2cols @@ -0,0 +1,3 @@ +#! /bin/bash + +watcher $1 mdtotex-2cols $1