31 lines
497 B
Plaintext
31 lines
497 B
Plaintext
|
#!/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"
|