verilator/src/pod2latexfix

34 lines
1.5 KiB
Plaintext
Raw Normal View History

2012-04-15 18:51:04 +00:00
#!/usr/bin/perl -w
######################################################################
#
# Copyright 2002-2018 by Wilson Snyder. Verilator is free software; you
2012-04-15 18:51:04 +00:00
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
######################################################################
# DESCRIPTION: Edits pod2latex output
my $Opt_DistTitle = $ARGV[0] or die "%Error: No disttitle specified,";
my $Opt_DistDate = $ARGV[1] or die "%Error: No distdate specified,";
my $header = ("\\usepackage[left=1.7in,right=1.7in,top=1.3in,bottom=1.3in]{geometry}\n"
."\\usepackage[pdftex,bookmarks=true,bookmarksnumbered=true,hypertexnames=false,breaklinks=true,linkbordercolor={0 0 1}]{hyperref}\n"
."\\usepackage{fancyhdr} \\pagestyle{fancy}\n"
."\\setlength{\\parindent}{0pt} \\setlength{\\parskip}{\\baselineskip}\n"
2015-03-13 11:38:17 +00:00
."\\title{${Opt_DistTitle}} \\date{${Opt_DistDate}} \\author{http:\/\/www.veripool.org}\n"
2012-04-15 18:51:04 +00:00
."\\lhead[${Opt_DistTitle}]{${Opt_DistTitle}}\n"
);
foreach my $line (<STDIN>) {
2018-05-13 23:21:08 +00:00
$line =~ s/(\\begin\{document\})/${header}$1/;
$line =~ s/(\\tableofcontents)/\\begin\{titlepage\} \\maketitle \\end\{titlepage\}\n$1/;
2012-04-15 18:51:04 +00:00
print "$line";
}