version 1.315, 2004/07/15 15:53:30
|
version 1.316.2.2, 2004/09/22 20:49:45
|
Line 540 sub details_for_menu {
|
Line 540 sub details_for_menu {
|
|
|
sub latex_corrections { |
sub latex_corrections { |
|
|
my ($number_of_columns,$result) = @_; |
my ($number_of_columns,$result,$selectionmade) = @_; |
|
|
# $result =~ s/\\includegraphics{/\\includegraphics\[width=\\minipagewidth\]{/g; |
# $result =~ s/\\includegraphics{/\\includegraphics\[width=\\minipagewidth\]{/g; |
$result =~ s/\$number_of_columns/$number_of_columns/g; |
$result =~ s/\$number_of_columns/$number_of_columns/g; |
$result =~ s/(\\end{document})/\\strut\\vspace\*{-4 mm}\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License $1/; |
if ($selectionmade ne '1') { |
|
$result =~ s/(\\end{document})/\\strut\\vspace\*{-4 mm}\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License $1/; |
|
} else { |
|
$result =~ s/(\\end{document})/\\strut\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License $1/; |
|
} |
$result =~ s/(\\end{longtable}\s*)(\\strut\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill})/$2$1/g; |
$result =~ s/(\\end{longtable}\s*)(\\strut\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill})/$2$1/g; |
$result =~ s/(\\end{longtable}\s*)\\strut\\newline/$1/g; |
$result =~ s/(\\end{longtable}\s*)\\strut\\newline/$1/g; |
#-- LaTeX corrections |
#-- LaTeX corrections |
Line 625 sub print_latex_header {
|
Line 629 sub print_latex_header {
|
} |
} |
|
|
sub path_to_problem { |
sub path_to_problem { |
my ($urlp,$LaTeXwidth)=@_; |
my ($urlp,$colwidth)=@_; |
my $newurlp = ''; |
my $newurlp = ''; |
$LaTeXwidth=~s/\s*mm\s*$//; |
$colwidth=~s/\s*mm\s*$//; |
my $HowMany = length($urlp)*2; |
#characters average about 2 mm in width |
if ($HowMany > $LaTeXwidth) { |
if (length($urlp)*2 > $LaTeXwidth) { |
my @temporrary = split '/',$urlp; |
my @elements = split '/',$urlp; |
my $HowManyNew = 0; |
my $curlength=0; |
for (my $ii=0;$ii<=$#temporrary;$ii++) { |
foreach my $element (@elements) { |
if ($temporrary[$ii] ne '') { |
if ($curlength+(length($element)*2) > $colwidth) { |
$HowManyNew += length($temporrary[$ii])*2; |
$newurlp .= '|\vskip -1 mm \noindent \verb|'; |
if ($HowManyNew < $LaTeXwidth ) { |
$curlength=0; |
$newurlp .= '/'.$temporrary[$ii]; |
} else { |
} else { |
$curlength+=length($element)*2; |
$HowManyNew = 0; |
|
$newurlp .= '|\vskip -1 mm \noindent \verb|'; |
|
$ii--; |
|
} |
|
} |
} |
|
$newurlp.='/'.$element; |
} |
} |
} else { |
} else { |
$newurlp=$urlp; |
$newurlp=$urlp; |
Line 1030 ENDPART
|
Line 1031 ENDPART
|
#loop over students |
#loop over students |
my $flag_latex_header_remove = 'NO'; |
my $flag_latex_header_remove = 'NO'; |
my %moreenv; |
my %moreenv; |
|
$moreenv{'instructor_comments'}='hide'; |
$moreenv{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); |
$moreenv{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); |
$moreenv{'print_discussions'}=$helper->{'VARS'}->{'PRINT_DISCUSSIONS'}; |
$moreenv{'print_discussions'}=$helper->{'VARS'}->{'PRINT_DISCUSSIONS'}; |
if ($helper->{'VARS'}->{'PRINT_DISCUSSIONS'} eq 'yes') {$moreenv{'problem_split'}='yes';} |
if ($helper->{'VARS'}->{'PRINT_DISCUSSIONS'} eq 'yes') {$moreenv{'problem_split'}='yes';} |
Line 1174 ENDPART
|
Line 1176 ENDPART
|
} |
} |
#-------------------------------------------------------- corrections for the different page formats |
#-------------------------------------------------------- corrections for the different page formats |
$result = &page_format_transformation($papersize,$laystyle,$numberofcolumns,$helper->{'VARS'}->{'PRINT_TYPE'},$result,$helper->{VARS}->{'assignment'},$helper->{'VARS'}->{'TABLE_CONTENTS'},$helper->{'VARS'}->{'TABLE_INDEX'},$selectionmade); |
$result = &page_format_transformation($papersize,$laystyle,$numberofcolumns,$helper->{'VARS'}->{'PRINT_TYPE'},$result,$helper->{VARS}->{'assignment'},$helper->{'VARS'}->{'TABLE_CONTENTS'},$helper->{'VARS'}->{'TABLE_INDEX'},$selectionmade); |
$result = &latex_corrections($number_of_columns,$result); |
$result = &latex_corrections($number_of_columns,$result,$selectionmade); |
for (my $i=1;$i<=$#print_array;$i++) {$print_array[$i] = &latex_corrections($number_of_columns,$print_array[$i]);} |
for (my $i=1;$i<=$#print_array;$i++) {$print_array[$i] = &latex_corrections($number_of_columns,$print_array[$i],$selectionmade);} |
#changes page's parameters for the one column output |
#changes page's parameters for the one column output |
if ($numberofcolumns == 1) { |
if ($numberofcolumns == 1) { |
$result =~ s/\\textwidth\s*=\s*\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /; |
$result =~ s/\\textwidth\s*=\s*\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /; |