--- loncom/interface/lonprintout.pm 2009/05/02 22:16:09 1.552
+++ loncom/interface/lonprintout.pm 2009/06/17 10:21:33 1.554.2.1
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.552 2009/05/02 22:16:09 foxr Exp $
+# $Id: lonprintout.pm,v 1.554.2.1 2009/06/17 10:21:33 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -70,6 +70,10 @@ my $ssi_last_error; # The error text fr
my $ssi_retry_count = 5; # Some arbitrary value.
+# Font size:
+
+my $font_size = 'normalsize'; # Default is normalsize...
+
# Fetch the contents of a resource, uninterpreted.
# This is used here to fetch a latex file to be included
@@ -114,6 +118,24 @@ sub annotate {
return $result;
}
+#
+# Set a global document font size:
+# This is done by replacing \begin{document}
+# with \begin{document}{\some-font-directive
+# and \end{document} with
+# }\end{document
+#
+sub set_font_size {
+
+ my ($text) = @_;
+
+ $text =~ s/\\begin{document}/\\begin{document}{\\$font_size/;
+ $text =~ s/\\end{document}/}\\end{document}/;
+ return $text;
+
+
+}
+
# include_pdf - PDF files are included into the
# output as follows:
# - The PDF, if necessary, is replicated.
@@ -2222,6 +2244,11 @@ ENDPART
$URLback=~s|^/~|/priv/|;
}
}
+ #
+ # Final adjustment of the font size:
+ #
+
+ $result = set_font_size($result);
#-- writing .tex file in prtspool
my $temp_file;
@@ -2306,7 +2333,7 @@ ENDPART
# If there's been an unrecoverable SSI error, report it to the user
if ($ssi_error) {
my $helpurl = &Apache::loncommon::top_nav_help('Helpdesk');
- $r->print('
'.
+ $r->print('
'.&mt('An unrecoverable network error occurred:').'
'.
&mt('At least one of the resources you chose to print could not be rendered due to an unrecoverable error when communicating with a server:').
'
'.$ssi_last_error_resource.'
'.$ssi_last_error.
'
'.&mt('You can continue using the link provided below, but make sure to carefully inspect your output file! The errors will be marked in the file.').'
'.
@@ -3550,9 +3577,9 @@ sub render {
my $i;
for ($i = 1; $i <= $maxColumns; $i++) {
if ($i == 2) {
- $result .= "\n";
+ $result .= ''."\n";
} else {
- $result .= "\n";
+ $result .= ''."\n";
}
}
@@ -3568,9 +3595,9 @@ sub render {
$_=~/(\w+)/;
my $papersize=$1;
if ($paperSize[$i]=~/$DefaultPaperSize/) {
- $result .= "\n";
+ $result .= ''."\n";
} else {
- $result .= "\n";
+ $result .= ''."\n";
}
$i++;
}
@@ -3579,8 +3606,8 @@ sub render {