% creates a pdf sheet of your GPG key to use in signing parties
﻿\documentclass[a4paper,9pt]{scrartcl} % 2>/dev/null || <<'\end{document}'

\UseRawInputEncoding
% Key ID to print - THIS IS ALL YOU HAVE TO CHANGE
\newcommand{\keyid}{87961FCAF97854FF}

% Number of repetitions
\newcommand{\repetitions}{18}

% Author: Volker Diels-Grabsch <v@njh.eu>
% This code is public domain. modified by TyKayn contact@cipherbliss.com 87961FCAF97854FF

\usepackage[hmargin=0.25cm,vmargin=0.25cm]{geometry}
\usepackage{xcolor,forloop}
\usepackage{listings}
\usepackage{multicol}
\lstset{basicstyle=\footnotesize}
\lstset{rulesepcolor=\color{gray}}
\lstset{breaklines=true, breakatwhitespace=true}
\begin{document}
\begin{multicols}{2}
\immediate\write18{gpg --fingerprint \keyid >fingerprint-plain.txt}
\lstinputlisting{fingerprint-plain.txt}
\newcounter{ct}
\forloop{ct}{1}{\value{ct}<\repetitions}{\vfill
\hrule\lstinputlisting{fingerprint-plain.txt}}

\end{multicols}
\end{document}

# Configure shell to abort in case of an unexpected error
set -e

# Generate PDF
pdflatex --shell-escape fingerprint.tex

# Remove temporary files
rm -f fingerprint.log fingerprint.aux fingerprint-plain.txt
