Created
September 13, 2016 22:06
-
-
Save mmha/20b489ebdec0b72d65f5b94c6a5626a7 to your computer and use it in GitHub Desktop.
Render Latex and copy the image into the clipboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TEMPDIR=`mktemp -d --tmpdir=/tmp` | |
CURDIR=`pwd` | |
cd $TEMPDIR | |
echo "\documentclass[convert]{standalone}\begin{document}" > src.tex | |
echo $1 >> src.tex | |
echo "\end{document}" >> src.tex | |
pdflatex -shell-escape src.tex > /dev/null | |
cat src.png | xclip -selection c -t image/png | |
cd $CURDIR | |
rm -rf $TEMPDIR | |
# Usage: ./formula.sh "\(\frac{1}{2 \cdot \pi}\)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment