--- loncom/xml/londefdef.pm 2004/05/12 18:29:57 1.214 +++ loncom/xml/londefdef.pm 2004/06/08 14:13:21 1.221 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.214 2004/05/12 18:29:57 sakharuk Exp $ +# $Id: londefdef.pm,v 1.221 2004/06/08 14:13:21 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -156,15 +156,21 @@ sub start_html { @Apache::londefdef::table = (); $currentstring .= '\documentclass[letterpaper]{article}'; if ($ENV{'form.latex_type'}=~'batchmode') {$currentstring .='\batchmode';} - $currentstring .= '\newcommand{\keephidden}[1]{} - \renewcommand{\deg}{$^{\circ}$} - \usepackage{longtable} - \usepackage{textcomp} - \usepackage{makeidx} - \usepackage[dvips]{graphicx} - \usepackage{epsfig}\usepackage{calc} -\newenvironment{choicelist}{\begin{list}{}{\setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.05in}\setlength{\itemsep}{0.022in}\setlength{\parsep}{0in}\setlength{\belowdisplayskip}{0.04in}\setlength{\abovedisplayskip}{0.05in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.04in}}}{\end{list}} -\renewenvironment{theindex}{\begin{list}{}{{\vskip 1mm \noindent \large\textbf{Index}} \newline \setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.01in}\setlength{\itemsep}{0.1in}\setlength{\parsep}{-0.02in}\setlength{\belowdisplayskip}{0.01in}\setlength{\abovedisplayskip}{0.01in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.01in}}}{\end{list}}'; + $currentstring .= '\newcommand{\keephidden}[1]{}'. + '\renewcommand{\deg}{$^{\circ}$}'. + '\usepackage{longtable}'. + '\usepackage{textcomp}'. + '\usepackage{makeidx}'. + '\usepackage[dvips]{graphicx}'. + '\usepackage{epsfig}'. + '\usepackage{calc}'. + '\usepackage{amsmath}'. + '\usepackage{amssymb}'. + '\usepackage{amsfonts}'. + '\usepackage{amsthm}'. + '\usepackage{amscd}'. + '\newenvironment{choicelist}{\begin{list}{}{\setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.05in}\setlength{\itemsep}{0.022in}\setlength{\parsep}{0in}\setlength{\belowdisplayskip}{0.04in}\setlength{\abovedisplayskip}{0.05in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.04in}}}{\end{list}}'. + '\renewenvironment{theindex}{\begin{list}{}{{\vskip 1mm \noindent \large\textbf{Index}} \newline \setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.01in}\setlength{\itemsep}{0.1in}\setlength{\parsep}{-0.02in}\setlength{\belowdisplayskip}{0.01in}\setlength{\abovedisplayskip}{0.01in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.01in}}}{\end{list}}'; } return $currentstring; } @@ -1110,7 +1116,9 @@ sub start_p { $currentstring='\makebox['.$ENV{'form.textwidth'}.']{\hfill\llap{'; } elsif ($align eq 'left') { $currentstring='\noindent\makebox['.$ENV{'form.textwidth'}.']{\rlap{'; - } + } else { + $currentstring='\par '; + } my $signal=1;#
does not work inside ... foreach my $tag (@$tagstack) {if (lc($tag) eq 'b') {$signal=0;} if (!$signal) {$currentstring = '';} @@ -1146,8 +1154,11 @@ sub start_br { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - if ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') { - $currentstring .= '\vskip 0.2 mm '; + if (($$tagstack[-2] eq 'b') || ($$tagstack[-2] eq 'strong') || + ($$tagstack[-2] eq 'ol') || ($$tagstack[-2] eq 'ul')) { + $currentstring .= ' \vskip 0 mm '; + } elsif ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') { + $currentstring .= '\strut \\\\ \strut '; } } return $currentstring; @@ -1526,17 +1537,17 @@ sub start_ul { $currentstring .= ' \renewcommand{\labelitemi}{$\bullet$} \renewcommand{\labelitemii}{$\bullet$} \renewcommand{\labelitemiii}{$\bullet$} - \renewcommand{\labelitemiv}{$\bullet$}'; + \renewcommand{\labelitemiv}{$\bullet$}\strut '; } elsif ($TeXtype eq 'circle') { $currentstring .= ' \renewcommand{\labelitemi}{$\circ$} \renewcommand{\labelitemii}{$\circ$} \renewcommand{\labelitemiii}{$\circ$} - \renewcommand{\labelitemiv}{$\circ$}'; + \renewcommand{\labelitemiv}{$\circ$}\strut '; } elsif ($TeXtype eq 'square') { $currentstring .= ' \renewcommand{\labelitemi}{$\diamond$} \renewcommand{\labelitemii}{$\diamond$} \renewcommand{\labelitemiii}{$\diamond$} - \renewcommand{\labelitemiv}{$\diamond$}'; + \renewcommand{\labelitemiv}{$\diamond$}\strut '; } $currentstring .= '\begin{itemize}'; } @@ -1552,7 +1563,7 @@ sub end_ul { $currentstring = '\end{itemize} \renewcommand{\labelitemi}{$\bullet$} \renewcommand{\labelitemii}{$\bullet$} \renewcommand{\labelitemiii}{$\bullet$} - \renewcommand{\labelitemiv}{$\bullet$}'; + \renewcommand{\labelitemiv}{$\bullet$}\strut '; } return $currentstring; } @@ -1615,27 +1626,27 @@ sub start_ol { $currentstring .= ' \renewcommand{\labelenumi}{\arabic{enumi}.} \renewcommand{\labelenumii}{\arabic{enumii}.} \renewcommand{\labelenumiii}{\arabic{enumiii}.} - \renewcommand{\labelenumiv}{\arabic{enumiv}.}'; + \renewcommand{\labelenumiv}{\arabic{enumiv}.}\strut '; } elsif ($type eq 'A') { $currentstring .= ' \renewcommand{\labelenumi}{\Alph{enumi}.} \renewcommand{\labelenumii}{\Alph{enumii}.} \renewcommand{\labelenumiii}{\Alph{enumiii}.} - \renewcommand{\labelenumiv}{\Alph{enumiv}.}'; + \renewcommand{\labelenumiv}{\Alph{enumiv}.}\strut '; } elsif ($type eq 'a') { $currentstring .= ' \renewcommand{\labelenumi}{\alph{enumi}.} \renewcommand{\labelenumii}{\alph{enumii}.} \renewcommand{\labelenumiii}{\alph{enumiii}.} - \renewcommand{\labelenumiv}{\alph{enumiv}.} '; + \renewcommand{\labelenumiv}{\alph{enumiv}.} \strut '; } elsif ($type eq 'i') { $currentstring .= ' \renewcommand{\labelenumi}{\roman{enumi}.} \renewcommand{\labelenumii}{\roman{enumii}.} \renewcommand{\labelenumiii}{\roman{enumiii}.} - \renewcommand{\labelenumiv}{\roman{enumiv}.} '; + \renewcommand{\labelenumiv}{\roman{enumiv}.}\strut '; } elsif ($type eq 'I') { $currentstring .= ' \renewcommand{\labelenumi}{\Roman{enumi}.} \renewcommand{\labelenumii}{\Roman{enumii}.} \renewcommand{\labelenumiii}{\Roman{enumiii}.} - \renewcommand{\labelenumiv}{\Roman{enumiv}.} '; + \renewcommand{\labelenumiv}{\Roman{enumiv}.} \strut '; } $currentstring .= '\begin{enumerate}'; } @@ -1651,7 +1662,7 @@ sub end_ol { $currentstring = '\end{enumerate} \renewcommand{\labelenumi}{\arabic{enumi}.} \renewcommand{\labelenumii}{\arabic{enumii}.} \renewcommand{\labelenumiii}{\arabic{enumiii}.} - \renewcommand{\labelenumiv}{\arabic{enumiv}.}'; + \renewcommand{\labelenumiv}{\arabic{enumiv}.}\strut '; } return $currentstring; } @@ -1824,7 +1835,7 @@ sub start_table { $Apache::londefdef::table[-1]{'vvinc'} = ''; } if ($#Apache::londefdef::table==0) { - $Apache::londefdef::table[-1]{'output'}='\newline\setlength{\tabcolsep}{1 mm}'; + $Apache::londefdef::table[-1]{'output'}='\strut\newline\strut\setlength{\tabcolsep}{1 mm}'; } $Apache::londefdef::table[-1]{'output'}.=' \noindent \begin{tabular} '; $Apache::londefdef::table[-1]{'TeXlen'}=[]; @@ -2006,7 +2017,7 @@ sub end_table { } $output.=' \\\\ '.$Apache::londefdef::table[-1]{'hinc'}.' '; } - $Apache::londefdef::table[-1]{'output'} .= $header_of_table.$Apache::londefdef::table[-1]{'hinc'}.$output.'\end{tabular}\vskip 0 mm '; + $Apache::londefdef::table[-1]{'output'} .= $header_of_table.$Apache::londefdef::table[-1]{'hinc'}.$output.'\end{tabular}\strut\newline\strut '; if ($#Apache::londefdef::table > 0) { my $inmemory = $Apache::londefdef::table[-1]{'output'}; pop @Apache::londefdef::table; @@ -2271,6 +2282,8 @@ sub start_img { #if uploaded restore the path if ($src=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/simplepage\/([^\/]+)$/) { $src=&Apache::loncommon::propath($1,$2).'/userfiles/simplepage/'.$3; + } elsif ($src=~/^\/uploaded\/([^\/]+)\/([^\/]+)\/aboutme\/([^\/]+)$/) { + $src=&Apache::loncommon::propath($1,$2).'/userfiles/aboutme/'.$3; } #if original gif/jpg/png file exist do following: if (-e $src) {