[texhax] A Self-Referential Logo
Martin Heller
mr_heller at yahoo.dk
Thu Oct 6 10:43:36 CEST 2011
Iraj Kalantari wrote, on 04-10-2011 17:29:
> I must say as a more involved project I imagine and hope for producing a multi-page pdf file that has a logo on each page of the very same page.
Try something like the below compiled with shell escape/write18 enabled.
% test.tex
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{calc}
\usepackage{pgffor}
\usepackage{lipsum}
\headheight=3cm
\def\realjobname{test}% <- change to match filename
\newcounter{logopage}
\rhead{\rule{0.1\paperwidth}{0.1\paperheight}}%
\ifx\logolevel\undefined
\gdef\logolevel{0}%
\foreach \runno in {0,1,...,5} {%
\immediate\write18{%
pdfLaTeX --jobname="\jobname\runno"
\gdef"\string\logolevel{\runno}\string\input\space\jobname"
}%
}%
\fi
\ifnum\logolevel>0
\setcounter{logopage}{\logolevel}%
\addtocounter{logopage}{-1}%
\rhead{%
\setlength{\fboxsep}{0pt}%
\fbox{\includegraphics[scale=0.1,page=\thepage]{\realjobname\thelogopage.pdf}}}%
\fi
\pagestyle{fancy}
\begin{document}
\lipsum
\end{document}
More information about the texhax
mailing list