Skip to content

Instantly share code, notes, and snippets.

@psaikko
psaikko / tex2clip.sh
Created August 12, 2019 18:56
Read LaTeX source from standard input, render to PNG and move to clipboard. Paste nice equations anywhere.
#!/usr/bin/env bash
tmpdir="$(mktemp -d)"
texfile="$tmpdir/tmp.tex"
echo "\documentclass[varwidth]{standalone}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{color}
\usepackage[utf8]{inputenc}
\begin{document}
" > "$texfile"