Home > best practices > Stamp Papers with Their Citation

Stamp Papers with Their Citation

Wouldn’t it be convenient if the citation of the paper was available as part of the pdf document? You wouldn’t have to google for the information.

We can do so with the help of a simple perl script — the stamp is formatted using latex and is integrated with the original document to generate another version that has the stamp at the top of the page.

Below is a snapshot of document that was stamped using this script. Note the publication venue, location, month and year of publication at the top of the paper. The pdf is available here.


Here is the script:


$numArgs = $#ARGV + 1;
if($numArgs != 3){
    print "Usage: ./stamp.pl <input pdf> <output pdf> \"year etc.\"\n";

$input_pdf = $ARGV[0];
$output_pdf = $ARGV[1];

$text = <<END 
%\\fancyhead[CO,CE]{\\protect \\centering $ARGV[2]}
\\centering $ARGV[2] 

open TEX_OUT, '>stamp.tex';
print TEX_OUT $text;
close TEX_OUT;

system('pdflatex stamp.tex');
system("pdftk $input_pdf stamp stamp.pdf output $output_pdf"); 
Categories: best practices
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: