snippet latexpic

This commit is contained in:
gutmet 2020-11-23 17:14:08 +01:00
parent 084106bbd5
commit cc34de45df

30
latexpic Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -e
color=$1
input=$2
outpdf="/tmp/latexpic.pdf"
outpng="/tmp/latexpic.png"
cat <<EOF | pdflatex --output-directory /tmp --jobname latexpic --
\documentclass[12pt,varwidth]{standalone}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{pagecolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\color{$1}
\begin{document}
$input
\end{document}
EOF
convert -density 600 "$outpdf" -quality 90 "$outpng"
xdg-open "$outpng"