Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
blob: f5b58d093d1a772d89d931e98997b412435eda2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
LATEX="pdflatex"
MAXLINES=176

KEYID=${1:-E3462FD1}
FILENAME=fingerprint_${KEYID}

FP=`gpg --no-secmem-warning --fingerprint ${KEYID}| grep "\(^pub\|^uid\|fingerprint\)"`
NLINES=0
oldIFS=${IFS}
IFS="
"
for line in ${FP}; do
	NLINES=$((NLINES + 1))
done
IFS=${oldIFS}

(
cat << EOF
\\documentclass[a4paper]{letter}
  \\usepackage{multicol}
%  \\usepackage{vmargin}
%  \\setmarginsrb{10mm}{10mm}{10mm}{10mm}{0mm}{0mm}{0mm}{0mm}
  \\pagestyle{empty}
\\begin{document}
 \\begin{multicols}{2}
   \\tiny{
EOF
oldIFS=${IFS}
IFS="
"
CURLINES=0
while [ $((CURLINES + NLINES)) -le ${MAXLINES} ]; do
	echo "\\begin{verbatim}"
	for line in ${FP}; do
		echo $line
	done
	CURLINES=$((CURLINES + NLINES))
	echo "\\end{verbatim}\\"
done
IFS=${oldIFS}
cat << EOF
    }
  \\end{multicols}
\\end{document}
EOF
) > ${FILENAME}.tex

${LATEX} ${FILENAME}.tex
if [ $? = 0 ]; then
	rm ${FILENAME}.{tex,aux,log}
fi