verilator/src/pod2latexfix

37 lines
1.5 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env perl
2012-04-15 18:51:04 +00:00
######################################################################
#
# Copyright 2002-2020 by Wilson Snyder. This program 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.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
2012-04-15 18:51:04 +00:00
#
######################################################################
# DESCRIPTION: Edits pod2latex output
use warnings;
2012-04-15 18:51:04 +00:00
my $Opt_DistTitle = $ARGV[0] or die "%Error: No disttitle specified,";
my $Opt_DistDate = $ARGV[1] or die "%Error: No distdate specified,";
my $header =
2020-02-24 23:11:56 +00:00
("\\usepackage[left=1.0in,right=1.0in,top=1.0in,bottom=1.0in]{geometry}\n"
."\\usepackage[pdftex,bookmarks=true,bookmarksnumbered=true,hypertexnames=false,breaklinks=true,colorlinks=true,linkcolor=blue]{hyperref}\n"
."\\usepackage{fancyhdr} \\pagestyle{fancy}\n"
2018-09-16 21:01:45 +00:00
."\\usepackage{graphicx}\n"
."\n"
."\\setlength{\\parindent}{0pt} \\setlength{\\parskip}{\\baselineskip}\n"
."\n"
2019-06-13 11:19:44 +00:00
."\\title{\\includegraphics[width=6cm]{docs/verilator_logo.png}\\\\ ${Opt_DistTitle}}\n"
."\\date{${Opt_DistDate}}\n"
2019-11-08 03:33:59 +00:00
."\\author{https:\/\/verilator.org}\n"
."\\lhead[${Opt_DistTitle}]{${Opt_DistTitle}}\n"
);
2012-04-15 18:51:04 +00:00
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";
}