Skip to content

Instantly share code, notes, and snippets.

@djspiewak
Created March 12, 2023 22:33
Show Gist options
  • Save djspiewak/e9cf1a35ac69b96ee2a72e33afbd8aee to your computer and use it in GitHub Desktop.
Save djspiewak/e9cf1a35ac69b96ee2a72e33afbd8aee to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo '\documentclass{article}\begin{document}Lorem ipsum dolor sit amet\end{document}' > input.tex
pdflatex input
size=$(cat input.pdf | wc -c)
old_size=0
while [[ $old_size -lt $size ]]; do
echo '\documentclass{article}\begin{document}' > input.tex
cat input.pdf | base64 >> input.tex
echo '\end{document}' >> input.tex
pdflatex input
old_size=$size
size=$(cat input.pdf | wc -c)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment