ManticMoo.COM All Articles Jeff's Articles
Jeffrey P. Bigham

Merging Your Latex and Bibtex File Into One

Jeffrey P. Bigham

Related Ads

The final camera-ready versions of papers submitted to Computer Science conferences are usually submitted as PDF files along with the .tex file that created them. This LaTeX file needs to have all includes, inputs and bbl files inserted in place in one file. This is always pretty annoying, so I wrote the follow Perl script in order to merge all of my files into one psuedo-automatically. Be warned: it's pretty brittle, but unless you did something weird, it should work :)

Link to combiner.pl.


while($line = ) {
    if($line =~ /\\input{([^}]+)}/) {
	open(FILE, $1 . ".tex") or die("Couldn't find file: " . $1 . ".tex");
	@lines = ;
	close(FILE);
	print @lines;
    } elsif($line =~ /\\bibliography{([^}]+)}/) {
	open(FILE, $1 . ".bbl") or die("Couldn't find file: " . $1 . ".bbl");
	@lines = ;
      	close(FILE);
	print @lines;
    } else {
	print $line;
    }
}

Jeffrey P. Bigham
ManticMoo.COM All Articles Jeff's Articles