Created
December 17, 2020 00:35
-
-
Save nikto-b/3dbdd06d9d7c17c26a277205e7a94905 to your computer and use it in GitHub Desktop.
generate homework report from many images
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/bash | |
files=$(ls photo*.jpg) | |
count=1 | |
for i in $(echo $files); do | |
cp $i ./$count.jpg | |
jpegoptim --size=100K $count.jpg | |
count=$(($count+1)) | |
done | |
p=$(ls -t [0-9]*.jpg) | |
l=$(for i in $(echo $p); do | |
echo '\includegraphics[width=\linewidth]{'$i'}' | |
done) | |
echo '\documentclass{article} | |
\usepackage[T2A]{fontenc} | |
\usepackage[utf8x]{inputenc} | |
\usepackage[english, russian]{babel} | |
\usepackage{graphicx} | |
\graphicspath{ {./} } | |
\begin{document} | |
\Huge | |
ДЗ \\ | |
ФИО \\ | |
ГРУППА \\ | |
ШИФР \\' > a.tex | |
echo "$l" >> a.tex | |
echo '\end{document}' >> a.tex | |
rm -f a.pdf | |
latexmk -pdf ./a.tex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment