version 1.564, 2009/11/16 11:13:24
|
version 1.565, 2009/11/17 11:32:23
|
Line 499 sub printf_style_subst {
|
Line 499 sub printf_style_subst {
|
sub format_page_header { |
sub format_page_header { |
my ($width, $format, $assignment, $course, $student, $section) = @_; |
my ($width, $format, $assignment, $course, $student, $section) = @_; |
|
|
|
|
|
|
$width = &recalcto_mm($width); # Get width in mm. |
$width = &recalcto_mm($width); # Get width in mm. |
|
my $chars_per_line = int($width/1.6); # Character/textline. |
|
|
# Default format? |
# Default format? |
|
|
if ($format eq '') { |
if ($format eq '') { |
Line 514 sub format_page_header {
|
Line 517 sub format_page_header {
|
# but only truncate the course. |
# but only truncate the course. |
# - Allow the assignment to be 2 lines (wrapped). |
# - Allow the assignment to be 2 lines (wrapped). |
# |
# |
my $chars_per_line = $width/2; # Character/textline. |
|
|
|
|
|
|
|
|
|
my $name_length = int($chars_per_line *3 /4); |
my $name_length = int($chars_per_line *3 /4); |
my $sec_length = int($chars_per_line / 5); |
my $sec_length = int($chars_per_line / 5); |
Line 552 sub format_page_header {
|
Line 554 sub format_page_header {
|
my $testPrintout = '\\\\'.&mt('Construction Space').' \\\\'.&mt('Test-Printout '); |
my $testPrintout = '\\\\'.&mt('Construction Space').' \\\\'.&mt('Test-Printout '); |
$format =~ s/\\\\\s\\\\\s/$testPrintout/; |
$format =~ s/\\\\\s\\\\\s/$testPrintout/; |
} |
} |
|
# |
|
# We're going to trust LaTeX to break lines appropriately, but |
|
# we'll truncate anything that's more than 3 lines worth of |
|
# text. This is also assuming (which will probably end badly) |
|
# nobody's going to embed LaTeX control sequences in the title |
|
# header or rather that those control sequences won't get broken |
|
# by the stuff below. |
|
# |
|
my $total_length = 3*$chars_per_line; |
|
if (length($format) > $total_length) { |
|
$format = substr($format, 0, $total_length); |
|
} |
|
|
|
|
return $format; |
return $format; |
|
|