version 1.488, 2006/10/20 17:37:20
|
version 1.489, 2006/10/23 10:40:09
|
Line 62 my $resources_printed;
|
Line 62 my $resources_printed;
|
sub printf_style_subst { |
sub printf_style_subst { |
my ($item, $format_string, $repl) = @_; |
my ($item, $format_string, $repl) = @_; |
|
|
while ($format_string =~m/\G[^%]*(%(\d*)\Q$item\E)/g) { |
while ($format_string =~m/%\d*\Q$item\E/) { |
my $fmt = $1; |
my $fmt = $1; |
my $size = $2; |
my $size = $2; |
my $subst = $repl; |
my $subst = $repl; |
Line 70 sub printf_style_subst {
|
Line 70 sub printf_style_subst {
|
$subst = substr($subst, 0, $size); |
$subst = substr($subst, 0, $size); |
} |
} |
my $newpos = pos($format_string) + length($subst) - length($fmt); |
my $newpos = pos($format_string) + length($subst) - length($fmt); |
$format_string =~ s/\Q$fmt\E\G/$subst/; |
$format_string =~ s/\Q$fmt\E/$subst/; |
pos($format_string)=$newpos; |
pos($format_string)=$newpos; |
} |
} |
return $format_string; |
return $format_string; |
Line 128 sub format_page_header {
|
Line 128 sub format_page_header {
|
$format = &printf_style_subst("a", $format, $assignment); |
$format = &printf_style_subst("a", $format, $assignment); |
$format = &printf_style_subst("c", $format, $course); |
$format = &printf_style_subst("c", $format, $course); |
$format = &printf_style_subst("n", $format, $student); |
$format = &printf_style_subst("n", $format, $student); |
|
|
|
# If the user put %'s in the format string, they must be escaped |
|
# to \% else LaTeX will think they are comments and terminate |
|
# the line.. which is bad!!! |
|
|
|
$format =~ s/%/\\%/g; |
} |
} |
|
|
|
|