diff --git a/bin/check_latex.tex b/bin/check_latex.tex index 7334f6e496..29b2e20fdf 100644 --- a/bin/check_latex.tex +++ b/bin/check_latex.tex @@ -13,30 +13,26 @@ % Artistic License for more details. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\documentclass[10pt]{amsart} +\documentclass[10pt]{exam} \input{packages.tex} +\usepackage[text={7.5in,9in},centering]{geometry} \usepackage[active,textmath,displaymath]{preview} % needed for dvipng -\usepackage{geometry} % needed for ``two column'' hardcopy format -\usepackage{fullpage} % needed for ``single column'' hardcopy format -\pagestyle{plain} -\textheight 9in -\oddsidemargin = -0.42in -\evensidemargin = -0.42in -\textwidth= 7.28in -\columnsep = .25in -\columnseprule = .4pt +\setlength{\columnsep}{.25in} +\setlength{\columnseprule}{.4pt} + +\renewcommand{\questionshook}{\leftmargin=0pt\labelwidth=-\labelsep} \input{CAPA.tex} +\input{PGML.tex} \begin{document} \voffset=-0.8in \newpage \setcounter{page}{1} \begin{multicols}{2} -\columnwidth=\linewidth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist index 3243a05eb4..e6c7e4bb99 100644 --- a/conf/localOverrides.conf.dist +++ b/conf/localOverrides.conf.dist @@ -550,10 +550,10 @@ $mail{feedbackRecipients} = [ #$hardcopyThemeNames = { #oneColumn => 'One Column', #twoColumn => 'Two Columns', - #XeLaTeX-oneColumn => 'English - one Column', - #XeLaTeX-twoColumn => 'English - two Columns', - #XeLaTeX-Hebrew-oneColumn => 'Hebrew/English - one Column', - #XeLaTeX-Hebrew-twoColumn => 'Hebrew/English - two Columns', + #'XeLaTeX-oneColumn' => 'English - one Column', + #'XeLaTeX-twoColumn' => 'English - two Columns', + #'XeLaTeX-Hebrew-oneColumn' => 'Hebrew/English - one Column', + #'XeLaTeX-Hebrew-twoColumn' => 'Hebrew/English - two Columns', #}; # This is needed to enforce an order that the options are presented when making a hardcopy diff --git a/conf/snippets/ASimpleCombinedHeaderFile.pg b/conf/snippets/ASimpleCombinedHeaderFile.pg index 2f6e168a1f..1affc23b53 100644 --- a/conf/snippets/ASimpleCombinedHeaderFile.pg +++ b/conf/snippets/ASimpleCombinedHeaderFile.pg @@ -16,24 +16,15 @@ TEXT($BEGIN_ONE_COLUMN); #################################################### # -# The item below printed out only when a hardcopy is made. +# The item below is printed out only when a hardcopy is made. # #################################################### - - TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); -\noindent {\large \bf $studentName} -\hfill -{\large \bf {\{protect_underbar($courseName)\}}} -% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX -% {\large \bf { Section: \{protect_underbar($sectionName)\} } } -\par -\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} due $formattedDueDate}} -%\par\noindent -% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. -%See the course web page for information http://yoururl/yourcourse +% This is a TeX comment +% Use this space to add header text to pdf hardcopies +% Text added here will not be displayed in the browser EOT @@ -75,7 +66,7 @@ EOT #################################################### # -# Anything between the BEGIN_TEXT AND END_TEXT lines +# Anything between the BEGIN_PGML AND END_PGML lines # will be printed in both screen and hardcopy output # #################################################### @@ -84,7 +75,46 @@ BEGIN_PGML END_PGML - TEXT($END_ONE_COLUMN); +#################################################### +# +# The following lines can be used to customize the PDF output +# by following the documentation for the LaTeX exam class +# http://mirrors.ctan.org/macros/latex/contrib/exam/examdoc.pdf +# +#################################################### + +TEXT(MODES(TeX => EV3(<<'EOT'),HTML=>"")); + +% match current hardcopy format +\pagestyle{headandfoot} +\firstpageheader{ + {\large \bf $studentName} \\ +% Uncomment the line below if this course has sections. +% {\large \bf Section: \{protect_underbar($sectionName)\}} \\ + {\large \bf Assignment \{protect_underbar($setNumber)\} due $formattedDueDate} +}{}{ + {\large \bf \{protect_underbar($courseName)\} \\ {} } +} +\ifdefined\nocolumns\firstpageheadrule\fi +\runningheader{}{}{} +\firstpagefooter{}{\thepage}{} +\runningfooter{}{\thepage}{} + +EOT + +# The following must be processed separately because of its use of the @-symbol + +TEXT(MODES(TeX => EV3P({processVariables => 0}, <<'EOT'), HTML => '')); +%==================================================================================% +% Uncomment the lines below to modify the formatting of problem numbers and points % +%==================================================================================% +%\pointpoints{pt.}{pts.} +%\makeatletter +%\qformat{{\bf Problem \thequestiontitle.} \dotfill \if@placepoints{\bf\footnotesize(\thepoints)}\fi} +%\makeatother + +EOT + ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopyPreamble.tex b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopyPreamble.tex index 1b06bf0078..4955ea6666 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopyPreamble.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopyPreamble.tex @@ -1,7 +1,9 @@ \batchmode -\documentclass[11pt]{amsart} +\documentclass[11pt]{exam} \input{packages.tex} +\usepackage[text={7.5in,9in},centering]{geometry} + % For XeLaTeX + polyglossia - using Hebrew and the Culmus fonts \usepackage{fontspec} \usepackage{xunicode} @@ -10,7 +12,7 @@ % see https://ctan.org/pkg/polyglossia \usepackage{polyglossia} -% bidi needs to be loaded AFTER caption,xcolor +% bidi needs to be loaded AFTER caption, xcolor, and geometry. \usepackage{bidi} \setdefaultlanguage{hebrew} @@ -28,11 +30,17 @@ % WeBWorK used Control+_ = ^_ for verbatim... so we change its charcode \catcode`\=12 -\usepackage{fullpage} - % This is used to signal PG that we are not using multicols \newcommand{\nocolumns}{} +% This removes the margin for questions from the exam class. At this point we only use questions and not parts or +% supparts, but if those are used a similar thing will be needed for those as well. +\renewcommand{\questionshook}{\leftmargin=0pt\labelwidth=-\labelsep} + +\makeatletter +\qformat{{\bf שאלה \thequestiontitle.} \if@placepoints{\textenglish{\bf\footnotesize(\thepoints)}}\fi \hfill} +\makeatother + \input{CAPA.tex} \input{PGML.tex} diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopySetFooter.pg b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopySetFooter.pg index cb6b9be060..59bbce43d6 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopySetFooter.pg +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopySetFooter.pg @@ -1,6 +1,6 @@ -# +# # hardcopySetFooter.pg - generic hardcopy set footer file -# +# DOCUMENT(); loadMacros( @@ -9,7 +9,6 @@ loadMacros( ); BEGIN_TEXT -$BR \newfontfamily\libertine{Linux Libertine O} diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopySetHeader.pg b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopySetHeader.pg index 7a357d2d13..8b13789179 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopySetHeader.pg +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-oneColumn/hardcopySetHeader.pg @@ -1,71 +1 @@ -DOCUMENT(); -loadMacros( - "PG.pl", - "PGbasicmacros.pl", -); - -TEXT($BEGIN_ONE_COLUMN); - -TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"",Latex2HTML=>"")); -\noindent {\large \bf $studentName} -\hfill -\noindent {\large \bf MTH 161 $sectionNumber Fall 2003} -\par - -EOT - -BEGIN_TEXT - -$BBOLD WeBWorK assignment number $setNumber is due : $formattedDueDate. $EBOLD - -$PAR -The -(* home page *) -\{ -#htmlLink(qq!http://www.math.rochester.edu/courses/161/home/!,"home -page") -\} -for the course contains the syllabus, grading policy and other -information. -$PAR -END_TEXT - -################## -# EDIT BELOW HERE -################## -BEGIN_TEXT -$HR -$PAR -This file is /conf/snippets/hardcopySetHeader.pg you can use it as -a model for creating files which introduce each problem set. -$PAR -$HR -END_TEXT -################## -# EDIT ABOVE HERE -################## -BEGIN_TEXT -The primary purpose of WeBWorK is to let you know that you are getting the correct answer or to alert -you if you are making some kind of mistake. Usually you can attempt a problem as many times as you want before -the due date. However, if you are having trouble figuring out your error, you should -consult the book, or ask a fellow student, one of the TA's or -your professor for help. Don't spend a lot of time guessing -- it's not very efficient or effective. -$PAR -Give 4 or 5 significant digits for (floating point) numerical answers. -For most problems when entering numerical answers, you can if you wish -enter elementary expressions such as \( 2\wedge3 \) instead of 8, \( sin(3*pi/2) \)instead -of -1, \( e\wedge (ln(2)) \) instead of 2, -\( (2+tan(3))*(4-sin(5))\wedge6-7/8 \) instead of 27620.3413, etc. - Here's the -\{ htmlLink(qq!http://webwork.math.rochester.edu/docs/docs/pglanguage/availableFunctions.html!,"list of the functions") \} - which WeBWorK understands. -$PAR -You can use the Feedback button on each problem -page to send e-mail to the professors. - - -$END_ONE_COLUMN -END_TEXT - -ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyPostamble.tex b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyPostamble.tex index 8e46f0cdb3..8e831736a7 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyPostamble.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyPostamble.tex @@ -1,4 +1,3 @@ -\end{multicols} \vfill \end{document} diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyPreamble.tex b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyPreamble.tex index 9f0e7c252a..21d28791ff 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyPreamble.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyPreamble.tex @@ -1,7 +1,9 @@ \batchmode -\documentclass[10pt]{amsart} +\documentclass[10pt]{exam} \input{packages.tex} +\usepackage[text={7.5in,9in},centering]{geometry} + % For XeLaTeX + polyglossia - using Hebrew and the Culmus fonts \usepackage{fontspec} \usepackage{xunicode} @@ -10,7 +12,7 @@ % see https://ctan.org/pkg/polyglossia \usepackage{polyglossia} -% bidi needs to be loaded AFTER caption,xcolor +% bidi needs to be loaded AFTER caption, xcolor, and geometry. \usepackage{bidi} \setdefaultlanguage{hebrew} @@ -28,9 +30,16 @@ % WeBWorK used Control+_ = ^_ for verbatim... so we change its charcode \catcode`\=12 -\usepackage[text={7.5in,9in},centering]{geometry} -\columnsep = .25in -\columnseprule = .4pt +\setlength{\columnsep}{.25in} +\setlength{\columnseprule}{.4pt} + +% This removes the margin for questions from the exam class. At this point we only use questions and not parts or +% supparts, but if those are used a similar thing will be needed for those as well. +\renewcommand{\questionshook}{\leftmargin=0pt\labelwidth=-\labelsep} + +\makeatletter +\qformat{{\bf שאלה \thequestiontitle.} \if@placepoints{\textenglish{\bf\footnotesize(\thepoints)}}\fi \hfill} +\makeatother \input{CAPA.tex} \input{PGML.tex} @@ -39,4 +48,3 @@ \voffset=-0.8in \newpage \setcounter{page}{1} -\begin{multicols}{2} diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetDivider.tex b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetDivider.tex index 2832139795..95f4a1bd28 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetDivider.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetDivider.tex @@ -1,8 +1,4 @@ -\end{multicols} % close off the columns from the set above - \newpage% -\setcounter{page}{1}% -\begin{multicols}{2} -\columnwidth=\linewidth % reopen the columns for the following set +\setcounter{page}{1}% diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetFooter.pg b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetFooter.pg index 28597e4dd1..59bbce43d6 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetFooter.pg +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetFooter.pg @@ -1,6 +1,6 @@ -# +# # hardcopySetFooter.pg - generic hardcopy set footer file -# +# DOCUMENT(); loadMacros( @@ -9,7 +9,6 @@ loadMacros( ); BEGIN_TEXT -$BEGIN_ONE_COLUMN \newfontfamily\libertine{Linux Libertine O} @@ -21,7 +20,6 @@ $BEGIN_ONE_COLUMN \noindent{\tiny נוצר על ידי \textenglish{WeBWorK} {\libertine \copyright}} \end{hebrew} -$END_ONE_COLUMN END_TEXT ENDDOCUMENT(); diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetHeader.pg b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetHeader.pg index 7a357d2d13..8b13789179 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetHeader.pg +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopySetHeader.pg @@ -1,71 +1 @@ -DOCUMENT(); -loadMacros( - "PG.pl", - "PGbasicmacros.pl", -); - -TEXT($BEGIN_ONE_COLUMN); - -TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"",Latex2HTML=>"")); -\noindent {\large \bf $studentName} -\hfill -\noindent {\large \bf MTH 161 $sectionNumber Fall 2003} -\par - -EOT - -BEGIN_TEXT - -$BBOLD WeBWorK assignment number $setNumber is due : $formattedDueDate. $EBOLD - -$PAR -The -(* home page *) -\{ -#htmlLink(qq!http://www.math.rochester.edu/courses/161/home/!,"home -page") -\} -for the course contains the syllabus, grading policy and other -information. -$PAR -END_TEXT - -################## -# EDIT BELOW HERE -################## -BEGIN_TEXT -$HR -$PAR -This file is /conf/snippets/hardcopySetHeader.pg you can use it as -a model for creating files which introduce each problem set. -$PAR -$HR -END_TEXT -################## -# EDIT ABOVE HERE -################## -BEGIN_TEXT -The primary purpose of WeBWorK is to let you know that you are getting the correct answer or to alert -you if you are making some kind of mistake. Usually you can attempt a problem as many times as you want before -the due date. However, if you are having trouble figuring out your error, you should -consult the book, or ask a fellow student, one of the TA's or -your professor for help. Don't spend a lot of time guessing -- it's not very efficient or effective. -$PAR -Give 4 or 5 significant digits for (floating point) numerical answers. -For most problems when entering numerical answers, you can if you wish -enter elementary expressions such as \( 2\wedge3 \) instead of 8, \( sin(3*pi/2) \)instead -of -1, \( e\wedge (ln(2)) \) instead of 2, -\( (2+tan(3))*(4-sin(5))\wedge6-7/8 \) instead of 27620.3413, etc. - Here's the -\{ htmlLink(qq!http://webwork.math.rochester.edu/docs/docs/pglanguage/availableFunctions.html!,"list of the functions") \} - which WeBWorK understands. -$PAR -You can use the Feedback button on each problem -page to send e-mail to the professors. - - -$END_ONE_COLUMN -END_TEXT - -ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyUserDivider.tex b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyUserDivider.tex index a23eb585dc..efe003a0a5 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyUserDivider.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-Hebrew-twoColumn/hardcopyUserDivider.tex @@ -1,7 +1,3 @@ -\end{multicols} % close off the columns from the set above - \newpage% -\setcounter{page}{1}% -\begin{multicols}{2} -\columnwidth=\linewidth % reopen the columns for the following set +\setcounter{page}{1}% diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopyPreamble.tex b/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopyPreamble.tex index 270df3cc33..7ebfcf48b6 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopyPreamble.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopyPreamble.tex @@ -1,7 +1,9 @@ \batchmode -\documentclass[11pt]{amsart} +\documentclass[11pt]{exam} \input{packages.tex} +\usepackage[text={7.5in,9in},centering]{geometry} + % For XeLaTeX + polyglossia \usepackage{fontspec} \usepackage{xunicode} @@ -22,19 +24,25 @@ %\setsansfont{sans font name} % If needed - can load the bidi package to support RTL and LTR languages -% using automatic direction changes (where it works) for Unicode UTF-8 +% using automatic direction changes (where it works) for Unicode UTF-8 % encoded text. -% The bidi package needs to be loaded AFTER caption, xcolor. +% The bidi package needs to be loaded AFTER caption, xcolor, and geometry. %\usepackage{bidi} % WeBWorK used Control+_ = ^_ for verbatim... so we change its charcode \catcode`\=12 -\usepackage{fullpage} - % This is used to signal PG that we are not using multicols \newcommand{\nocolumns}{} +% This removes the margin for questions from the exam class. At this point we only use questions and not parts or +% supparts, but if those are used a similar thing will be needed for those as well. +\renewcommand{\questionshook}{\leftmargin=0pt\labelwidth=-\labelsep} + +\makeatletter +\qformat{{\bf Problem \thequestiontitle.} \if@placepoints{\bf\footnotesize(\thepoints)}\fi \hfill} +\makeatother + \input{CAPA.tex} \input{PGML.tex} diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetDivider.tex b/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetDivider.tex index a66b59253a..efe003a0a5 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetDivider.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetDivider.tex @@ -1,4 +1,3 @@ \newpage% -\setcounter{page}{1}% - +\setcounter{page}{1}% diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetFooter.pg b/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetFooter.pg index df36143d36..97a6abe9b7 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetFooter.pg +++ b/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetFooter.pg @@ -1,6 +1,6 @@ -# +# # hardcopySetFooter.pg - generic hardcopy set footer file -# +# DOCUMENT(); loadMacros( @@ -9,7 +9,6 @@ loadMacros( ); BEGIN_TEXT -$BR \begin{english} \noindent {\tiny Generated by WeBWorK \copyright} diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetHeader.pg b/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetHeader.pg index 7a357d2d13..8b13789179 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetHeader.pg +++ b/conf/snippets/hardcopyThemes/XeLaTeX-oneColumn/hardcopySetHeader.pg @@ -1,71 +1 @@ -DOCUMENT(); -loadMacros( - "PG.pl", - "PGbasicmacros.pl", -); - -TEXT($BEGIN_ONE_COLUMN); - -TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"",Latex2HTML=>"")); -\noindent {\large \bf $studentName} -\hfill -\noindent {\large \bf MTH 161 $sectionNumber Fall 2003} -\par - -EOT - -BEGIN_TEXT - -$BBOLD WeBWorK assignment number $setNumber is due : $formattedDueDate. $EBOLD - -$PAR -The -(* home page *) -\{ -#htmlLink(qq!http://www.math.rochester.edu/courses/161/home/!,"home -page") -\} -for the course contains the syllabus, grading policy and other -information. -$PAR -END_TEXT - -################## -# EDIT BELOW HERE -################## -BEGIN_TEXT -$HR -$PAR -This file is /conf/snippets/hardcopySetHeader.pg you can use it as -a model for creating files which introduce each problem set. -$PAR -$HR -END_TEXT -################## -# EDIT ABOVE HERE -################## -BEGIN_TEXT -The primary purpose of WeBWorK is to let you know that you are getting the correct answer or to alert -you if you are making some kind of mistake. Usually you can attempt a problem as many times as you want before -the due date. However, if you are having trouble figuring out your error, you should -consult the book, or ask a fellow student, one of the TA's or -your professor for help. Don't spend a lot of time guessing -- it's not very efficient or effective. -$PAR -Give 4 or 5 significant digits for (floating point) numerical answers. -For most problems when entering numerical answers, you can if you wish -enter elementary expressions such as \( 2\wedge3 \) instead of 8, \( sin(3*pi/2) \)instead -of -1, \( e\wedge (ln(2)) \) instead of 2, -\( (2+tan(3))*(4-sin(5))\wedge6-7/8 \) instead of 27620.3413, etc. - Here's the -\{ htmlLink(qq!http://webwork.math.rochester.edu/docs/docs/pglanguage/availableFunctions.html!,"list of the functions") \} - which WeBWorK understands. -$PAR -You can use the Feedback button on each problem -page to send e-mail to the professors. - - -$END_ONE_COLUMN -END_TEXT - -ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyPostamble.tex b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyPostamble.tex index 8e46f0cdb3..8e831736a7 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyPostamble.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyPostamble.tex @@ -1,4 +1,3 @@ -\end{multicols} \vfill \end{document} diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyPreamble.tex b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyPreamble.tex index 8e0d61f39c..c7c0e47e9e 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyPreamble.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyPreamble.tex @@ -1,7 +1,9 @@ \batchmode -\documentclass[10pt]{amsart} +\documentclass[10pt]{exam} \input{packages.tex} +\usepackage[text={7.5in,9in},centering]{geometry} + % For XeLaTeX + polyglossia \usepackage{fontspec} \usepackage{xunicode} @@ -22,17 +24,24 @@ %\setsansfont{sans font name} % If needed - can load the bidi package to support RTL and LTR languages -% using automatic direction changes (where it works) for Unicode UTF-8 +% using automatic direction changes (where it works) for Unicode UTF-8 % encoded text. -% The bidi package needs to be loaded AFTER caption, xcolor. +% The bidi package needs to be loaded AFTER caption, xcolor, and geometry. %\usepackage{bidi} % WeBWorK used Control+_ = ^_ for verbatim... so we change its charcode \catcode`\=12 -\usepackage[text={7.5in,9in},centering]{geometry} -\columnsep = .25in -\columnseprule = .4pt +\setlength{\columnsep}{.25in} +\setlength{\columnseprule}{.4pt} + +% This removes the margin for questions from the exam class. At this point we only use questions and not parts or +% supparts, but if those are used a similar thing will be needed for those as well. +\renewcommand{\questionshook}{\leftmargin=0pt\labelwidth=-\labelsep} + +\makeatletter +\qformat{{\bf Problem \thequestiontitle.} \if@placepoints{\bf\footnotesize(\thepoints)}\fi \hfill} +\makeatother \input{CAPA.tex} \input{PGML.tex} @@ -40,5 +49,3 @@ \begin{document} \newpage \setcounter{page}{1} -\begin{multicols}{2} -\columnwidth=\linewidth diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetDivider.tex b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetDivider.tex index 2832139795..95f4a1bd28 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetDivider.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetDivider.tex @@ -1,8 +1,4 @@ -\end{multicols} % close off the columns from the set above - \newpage% -\setcounter{page}{1}% -\begin{multicols}{2} -\columnwidth=\linewidth % reopen the columns for the following set +\setcounter{page}{1}% diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetFooter.pg b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetFooter.pg index b3cfb96c4f..190920fda6 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetFooter.pg +++ b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetFooter.pg @@ -1,6 +1,6 @@ -# +# # hardcopySetFooter.pg - generic hardcopy set footer file -# +# DOCUMENT(); loadMacros( @@ -9,11 +9,9 @@ loadMacros( ); BEGIN_TEXT -$BEGIN_ONE_COLUMN \noindent {\tiny Generated by \copyright WeBWorK, http://webwork.maa.org, Mathematical Association of America} -$END_ONE_COLUMN END_TEXT ENDDOCUMENT(); diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetHeader.pg b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetHeader.pg index 7a357d2d13..8b13789179 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetHeader.pg +++ b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopySetHeader.pg @@ -1,71 +1 @@ -DOCUMENT(); -loadMacros( - "PG.pl", - "PGbasicmacros.pl", -); - -TEXT($BEGIN_ONE_COLUMN); - -TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"",Latex2HTML=>"")); -\noindent {\large \bf $studentName} -\hfill -\noindent {\large \bf MTH 161 $sectionNumber Fall 2003} -\par - -EOT - -BEGIN_TEXT - -$BBOLD WeBWorK assignment number $setNumber is due : $formattedDueDate. $EBOLD - -$PAR -The -(* home page *) -\{ -#htmlLink(qq!http://www.math.rochester.edu/courses/161/home/!,"home -page") -\} -for the course contains the syllabus, grading policy and other -information. -$PAR -END_TEXT - -################## -# EDIT BELOW HERE -################## -BEGIN_TEXT -$HR -$PAR -This file is /conf/snippets/hardcopySetHeader.pg you can use it as -a model for creating files which introduce each problem set. -$PAR -$HR -END_TEXT -################## -# EDIT ABOVE HERE -################## -BEGIN_TEXT -The primary purpose of WeBWorK is to let you know that you are getting the correct answer or to alert -you if you are making some kind of mistake. Usually you can attempt a problem as many times as you want before -the due date. However, if you are having trouble figuring out your error, you should -consult the book, or ask a fellow student, one of the TA's or -your professor for help. Don't spend a lot of time guessing -- it's not very efficient or effective. -$PAR -Give 4 or 5 significant digits for (floating point) numerical answers. -For most problems when entering numerical answers, you can if you wish -enter elementary expressions such as \( 2\wedge3 \) instead of 8, \( sin(3*pi/2) \)instead -of -1, \( e\wedge (ln(2)) \) instead of 2, -\( (2+tan(3))*(4-sin(5))\wedge6-7/8 \) instead of 27620.3413, etc. - Here's the -\{ htmlLink(qq!http://webwork.math.rochester.edu/docs/docs/pglanguage/availableFunctions.html!,"list of the functions") \} - which WeBWorK understands. -$PAR -You can use the Feedback button on each problem -page to send e-mail to the professors. - - -$END_ONE_COLUMN -END_TEXT - -ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyUserDivider.tex b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyUserDivider.tex index a23eb585dc..efe003a0a5 100644 --- a/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyUserDivider.tex +++ b/conf/snippets/hardcopyThemes/XeLaTeX-twoColumn/hardcopyUserDivider.tex @@ -1,7 +1,3 @@ -\end{multicols} % close off the columns from the set above - \newpage% -\setcounter{page}{1}% -\begin{multicols}{2} -\columnwidth=\linewidth % reopen the columns for the following set +\setcounter{page}{1}% diff --git a/conf/snippets/hardcopyThemes/oneColumn/hardcopyPreamble.tex b/conf/snippets/hardcopyThemes/oneColumn/hardcopyPreamble.tex index bd25a24b89..64f994f242 100644 --- a/conf/snippets/hardcopyThemes/oneColumn/hardcopyPreamble.tex +++ b/conf/snippets/hardcopyThemes/oneColumn/hardcopyPreamble.tex @@ -1,12 +1,20 @@ \batchmode -\documentclass[11pt]{amsart} +\documentclass[11pt]{exam} \input{packages.tex} -\usepackage{fullpage} +\usepackage[text={7.5in,9in},centering]{geometry} % This is used to signal PG that we are not using multicols \newcommand{\nocolumns}{} +% This removes the margin for questions from the exam class. At this point we only use questions and not parts or +% supparts, but if those are used a similar thing will be needed for those as well. +\renewcommand{\questionshook}{\leftmargin=0pt\labelwidth=-\labelsep} + +\makeatletter +\qformat{{\bf Problem \thequestiontitle.} \if@placepoints{\bf\footnotesize(\thepoints)}\fi \hfill} +\makeatother + \input{CAPA.tex} \input{PGML.tex} diff --git a/conf/snippets/hardcopyThemes/oneColumn/hardcopySetDivider.tex b/conf/snippets/hardcopyThemes/oneColumn/hardcopySetDivider.tex index a66b59253a..25cb763f38 100644 --- a/conf/snippets/hardcopyThemes/oneColumn/hardcopySetDivider.tex +++ b/conf/snippets/hardcopyThemes/oneColumn/hardcopySetDivider.tex @@ -1,4 +1,3 @@ \newpage% \setcounter{page}{1}% - diff --git a/conf/snippets/hardcopyThemes/oneColumn/hardcopySetFooter.pg b/conf/snippets/hardcopyThemes/oneColumn/hardcopySetFooter.pg index d556270b6c..862742aab9 100644 --- a/conf/snippets/hardcopyThemes/oneColumn/hardcopySetFooter.pg +++ b/conf/snippets/hardcopyThemes/oneColumn/hardcopySetFooter.pg @@ -9,7 +9,7 @@ loadMacros( ); BEGIN_TEXT -$BR + \noindent {\tiny Generated by \copyright WeBWorK, http://webwork.maa.org, Mathematical Association of America} END_TEXT diff --git a/conf/snippets/hardcopyThemes/oneColumn/hardcopySetHeader.pg b/conf/snippets/hardcopyThemes/oneColumn/hardcopySetHeader.pg deleted file mode 100644 index 7a357d2d13..0000000000 --- a/conf/snippets/hardcopyThemes/oneColumn/hardcopySetHeader.pg +++ /dev/null @@ -1,71 +0,0 @@ -DOCUMENT(); - -loadMacros( - "PG.pl", - "PGbasicmacros.pl", -); - -TEXT($BEGIN_ONE_COLUMN); - -TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"",Latex2HTML=>"")); -\noindent {\large \bf $studentName} -\hfill -\noindent {\large \bf MTH 161 $sectionNumber Fall 2003} -\par - -EOT - -BEGIN_TEXT - -$BBOLD WeBWorK assignment number $setNumber is due : $formattedDueDate. $EBOLD - -$PAR -The -(* home page *) -\{ -#htmlLink(qq!http://www.math.rochester.edu/courses/161/home/!,"home -page") -\} -for the course contains the syllabus, grading policy and other -information. -$PAR -END_TEXT - -################## -# EDIT BELOW HERE -################## -BEGIN_TEXT -$HR -$PAR -This file is /conf/snippets/hardcopySetHeader.pg you can use it as -a model for creating files which introduce each problem set. -$PAR -$HR -END_TEXT -################## -# EDIT ABOVE HERE -################## -BEGIN_TEXT -The primary purpose of WeBWorK is to let you know that you are getting the correct answer or to alert -you if you are making some kind of mistake. Usually you can attempt a problem as many times as you want before -the due date. However, if you are having trouble figuring out your error, you should -consult the book, or ask a fellow student, one of the TA's or -your professor for help. Don't spend a lot of time guessing -- it's not very efficient or effective. -$PAR -Give 4 or 5 significant digits for (floating point) numerical answers. -For most problems when entering numerical answers, you can if you wish -enter elementary expressions such as \( 2\wedge3 \) instead of 8, \( sin(3*pi/2) \)instead -of -1, \( e\wedge (ln(2)) \) instead of 2, -\( (2+tan(3))*(4-sin(5))\wedge6-7/8 \) instead of 27620.3413, etc. - Here's the -\{ htmlLink(qq!http://webwork.math.rochester.edu/docs/docs/pglanguage/availableFunctions.html!,"list of the functions") \} - which WeBWorK understands. -$PAR -You can use the Feedback button on each problem -page to send e-mail to the professors. - - -$END_ONE_COLUMN -END_TEXT - -ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/conf/snippets/hardcopyThemes/twoColumn/hardcopyPostamble.tex b/conf/snippets/hardcopyThemes/twoColumn/hardcopyPostamble.tex index 8e46f0cdb3..8e831736a7 100644 --- a/conf/snippets/hardcopyThemes/twoColumn/hardcopyPostamble.tex +++ b/conf/snippets/hardcopyThemes/twoColumn/hardcopyPostamble.tex @@ -1,4 +1,3 @@ -\end{multicols} \vfill \end{document} diff --git a/conf/snippets/hardcopyThemes/twoColumn/hardcopyPreamble.tex b/conf/snippets/hardcopyThemes/twoColumn/hardcopyPreamble.tex index f3b99744c5..cecfd9b2e2 100644 --- a/conf/snippets/hardcopyThemes/twoColumn/hardcopyPreamble.tex +++ b/conf/snippets/hardcopyThemes/twoColumn/hardcopyPreamble.tex @@ -1,10 +1,18 @@ \batchmode -\documentclass[10pt]{amsart} +\documentclass[10pt]{exam} \input{packages.tex} \usepackage[text={7.5in,9in},centering]{geometry} -\columnsep = .25in -\columnseprule = .4pt +\setlength{\columnsep}{.25in} +\setlength{\columnseprule}{.4pt} + +% This removes the margin for questions from the exam class. At this point we only use questions and not parts or +% supparts, but if those are used a similar thing will be needed for those as well. +\renewcommand{\questionshook}{\leftmargin=0pt\labelwidth=-\labelsep} + +\makeatletter +\qformat{{\bf Problem \thequestiontitle.} \if@placepoints{\bf\footnotesize(\thepoints)}\fi \hfill} +\makeatother \input{CAPA.tex} \input{PGML.tex} @@ -12,5 +20,3 @@ \begin{document} \newpage \setcounter{page}{1} -\begin{multicols}{2} -\columnwidth=\linewidth diff --git a/conf/snippets/hardcopyThemes/twoColumn/hardcopySetDivider.tex b/conf/snippets/hardcopyThemes/twoColumn/hardcopySetDivider.tex index 2832139795..25cb763f38 100644 --- a/conf/snippets/hardcopyThemes/twoColumn/hardcopySetDivider.tex +++ b/conf/snippets/hardcopyThemes/twoColumn/hardcopySetDivider.tex @@ -1,8 +1,3 @@ -\end{multicols} % close off the columns from the set above - \newpage% \setcounter{page}{1}% -\begin{multicols}{2} -\columnwidth=\linewidth % reopen the columns for the following set - diff --git a/conf/snippets/hardcopyThemes/twoColumn/hardcopySetFooter.pg b/conf/snippets/hardcopyThemes/twoColumn/hardcopySetFooter.pg index 32a8f0da72..190920fda6 100644 --- a/conf/snippets/hardcopyThemes/twoColumn/hardcopySetFooter.pg +++ b/conf/snippets/hardcopyThemes/twoColumn/hardcopySetFooter.pg @@ -9,11 +9,9 @@ loadMacros( ); BEGIN_TEXT -$BEGIN_ONE_COLUMN \noindent {\tiny Generated by \copyright WeBWorK, http://webwork.maa.org, Mathematical Association of America} -$END_ONE_COLUMN END_TEXT ENDDOCUMENT(); diff --git a/conf/snippets/hardcopyThemes/twoColumn/hardcopySetHeader.pg b/conf/snippets/hardcopyThemes/twoColumn/hardcopySetHeader.pg deleted file mode 100644 index 53d24cf546..0000000000 --- a/conf/snippets/hardcopyThemes/twoColumn/hardcopySetHeader.pg +++ /dev/null @@ -1,71 +0,0 @@ -DOCUMENT(); - -loadMacros( - "PG.pl", - "PGbasicmacros.pl", -); - -TEXT($BEGIN_ONE_COLUMN); - -TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"",Latex2HTML=>"")); -\noindent {\large \bf $studentName} -\hfill -\noindent {\large \bf MTH 161 $sectionNumber Fall 2003} -\par - -EOT - -BEGIN_TEXT - -$BBOLD WeBWorK assignment number $setNumber is due : $formattedDueDate. $EBOLD - -$PAR -The -(* home page *) -\{ -#htmlLink(qq!http://www.math.rochester.edu/courses/161/home/!,"home -page") -\} -for the course contains the syllabus, grading policy and other -information. -$PAR -END_TEXT - -################## -# EDIT BELOW HERE -################## -BEGIN_TEXT -$HR -$PAR -This file is /conf/snippets/hardcopySetHeader.pg you can use it as -a model for creating files which introduce each problem set. -$PAR -$HR -END_TEXT -################## -# EDIT ABOVE HERE -################## -BEGIN_TEXT -The primary purpose of WeBWorK is to let you know that you are getting the correct answer or to alert -you if you are making some kind of mistake. Usually you can attempt a problem as many times as you want before -the due date. However, if you are having trouble figuring out your error, you should -consult the book, or ask a fellow student, one of the TA's or -your professor for help. Don't spend a lot of time guessing -- it's not very efficient or effective. -$PAR -Give 4 or 5 significant digits for (floating point) numerical answers. -For most problems when entering numerical answers, you can if you wish -enter elementary expressions such as \( 2\wedge3 \) instead of 8, \( sin(3*pi/2) \)instead -of -1, \( e\wedge (ln(2)) \) instead of 2, -\( (2+tan(3))*(4-sin(5))\wedge6-7/8 \) instead of 27620.3413, etc. - Here's the -\{ htmlLink(qq!http://webwork.math.rochester.edu/docs/docs/pglanguage/availableFunctions.html!,"list of the functions") \} - which WeBWorK understands. -$PAR -You can use the Feedback button on each problem -page to send e-mail to the professors. - - -$END_ONE_COLUMN -END_TEXT - -ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/conf/snippets/hardcopyThemes/twoColumn/hardcopyUserDivider.tex b/conf/snippets/hardcopyThemes/twoColumn/hardcopyUserDivider.tex index a23eb585dc..25cb763f38 100644 --- a/conf/snippets/hardcopyThemes/twoColumn/hardcopyUserDivider.tex +++ b/conf/snippets/hardcopyThemes/twoColumn/hardcopyUserDivider.tex @@ -1,7 +1,3 @@ -\end{multicols} % close off the columns from the set above - \newpage% \setcounter{page}{1}% -\begin{multicols}{2} -\columnwidth=\linewidth % reopen the columns for the following set diff --git a/courses.dist/modelCourse/templates/ASimpleCombinedHeaderFile.pg b/courses.dist/modelCourse/templates/ASimpleCombinedHeaderFile.pg index c0edf73795..1affc23b53 100644 --- a/courses.dist/modelCourse/templates/ASimpleCombinedHeaderFile.pg +++ b/courses.dist/modelCourse/templates/ASimpleCombinedHeaderFile.pg @@ -7,7 +7,7 @@ DOCUMENT(); loadMacros( "PG.pl", "PGbasicmacros.pl", - # "source.pl", + #"source.pl", #uncommenting this will display "show source" button if that is permitted "PGcourse.pl", "PGML.pl" ); @@ -16,24 +16,15 @@ TEXT($BEGIN_ONE_COLUMN); #################################################### # -# The item below printed out only when a hardcopy is made. +# The item below is printed out only when a hardcopy is made. # #################################################### - - TEXT(MODES(TeX =>EV3(<<'EOT'),HTML=>"")); -\noindent {\large \bf $studentName} -\hfill -{\large \bf {\{protect_underbar($courseName)\}}} -% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX -% {\large \bf { Section: \{protect_underbar($sectionName)\} } } -\par -\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} closes $formattedDueDate}} -\par\noindent -% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. -%See the course web page for information http://yoururl/yourcourse +% This is a TeX comment +% Use this space to add header text to pdf hardcopies +% Text added here will not be displayed in the browser EOT @@ -51,7 +42,7 @@ EOT #################################################### TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); -$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} closes : $formattedDueDate. $EBOLD +$BBOLD WeBWorK Assignment \{ protect_underbar($setNumber) \} is due : $formattedDueDate. $EBOLD $PAR Here's the list of \{ htmlLink(qq!http://webwork.maa.org/wiki/Available_Functions!,"functions and symbols") \} @@ -61,7 +52,7 @@ EOT #################################################### # Uncomment and edit the lines below if this course has a web page. Note that this is comment in Perl mode. -# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceeding it. +# IMPORTANT: Make sure the EOT at the bottom is at the beginning of a line with no spaces preceding it. #TEXT(MODES(TeX =>"",HTML=>EV3(<<'EOT'))); #See the course web page for information \{ htmlLink(qq!http://yoururl/yourcourse!,"your course name") \} #EOT @@ -75,7 +66,7 @@ EOT #################################################### # -# Anything between the BEGIN_TEXT AND END_TEXT lines +# Anything between the BEGIN_PGML AND END_PGML lines # will be printed in both screen and hardcopy output # #################################################### @@ -84,7 +75,46 @@ BEGIN_PGML END_PGML - TEXT($END_ONE_COLUMN); +#################################################### +# +# The following lines can be used to customize the PDF output +# by following the documentation for the LaTeX exam class +# http://mirrors.ctan.org/macros/latex/contrib/exam/examdoc.pdf +# +#################################################### + +TEXT(MODES(TeX => EV3(<<'EOT'),HTML=>"")); + +% match current hardcopy format +\pagestyle{headandfoot} +\firstpageheader{ + {\large \bf $studentName} \\ +% Uncomment the line below if this course has sections. +% {\large \bf Section: \{protect_underbar($sectionName)\}} \\ + {\large \bf Assignment \{protect_underbar($setNumber)\} due $formattedDueDate} +}{}{ + {\large \bf \{protect_underbar($courseName)\} \\ {} } +} +\ifdefined\nocolumns\firstpageheadrule\fi +\runningheader{}{}{} +\firstpagefooter{}{\thepage}{} +\runningfooter{}{\thepage}{} + +EOT + +# The following must be processed separately because of its use of the @-symbol + +TEXT(MODES(TeX => EV3P({processVariables => 0}, <<'EOT'), HTML => '')); +%==================================================================================% +% Uncomment the lines below to modify the formatting of problem numbers and points % +%==================================================================================% +%\pointpoints{pt.}{pts.} +%\makeatletter +%\qformat{{\bf Problem \thequestiontitle.} \dotfill \if@placepoints{\bf\footnotesize(\thepoints)}\fi} +%\makeatother + +EOT + ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/courses.dist/modelCourse/templates/ASimpleHardCopyHeaderFile.pg b/courses.dist/modelCourse/templates/ASimpleHardCopyHeaderFile.pg index 1e4dcb3c57..cb478028ca 100644 --- a/courses.dist/modelCourse/templates/ASimpleHardCopyHeaderFile.pg +++ b/courses.dist/modelCourse/templates/ASimpleHardCopyHeaderFile.pg @@ -11,24 +11,56 @@ loadMacros( ); +#################################################### +# This section is for adding text to be displayed before the set of problems +#################################################### BEGIN_TEXT $BEGIN_ONE_COLUMN -\noindent {\large \bf $studentName} -\hfill -{\large \bf {\{protect_underbar($courseName)\}}} -% Uncomment the line below if this course has sections. Note that this is a comment in TeX mode since this is only processed by LaTeX -% {\large \bf { Section: \{protect_underbar($sectionName)\} } } -\par -\noindent{\large \bf {Assignment \{protect_underbar($setNumber)\} closes $formattedDueDate}} -\par\noindent -% Uncomment and edit the line below if this course has a web page. Note that this is a comment in TeX mode. -% See the course web page for information http://yoururl/yourcourse +% Use this space to add header text to pdf hardcopies $END_ONE_COLUMN END_TEXT +#################################################### +# This section configures the headers and footers according +# to the documentation for the LaTeX exam class +#################################################### + +BEGIN_TEXT +% match current hardcopy format +\pagestyle{headandfoot} +\firstpageheader{ + {\large \bf $studentName} \\ +% Uncomment the line below if this course has sections. +% {\large \bf Section: \{protect_underbar($sectionName)\}} \\ + {\large \bf Assignment \{protect_underbar($setNumber)\} due $formattedDueDate} +}{}{ + {\large \bf \{protect_underbar($courseName)\} \\ {} } +} +\ifdefined\nocolumns\firstpageheadrule\fi +\runningheader{}{}{} +\firstpagefooter{}{\thepage}{} +\runningfooter{}{\thepage}{} + +END_TEXT + +#################################################### +# The final section must be processed separately because of its use of the @-symbol +#################################################### + +TEXT(MODES(TeX => EV3P({processVariables => 0}, <<'EOT'), HTML => '')); +%==================================================================================% +% Uncomment the lines below to modify the formatting of problem numbers and points % +%==================================================================================% +%\pointpoints{pt.}{pts.} +%\makeatletter +%\qformat{{\bf Problem \thequestiontitle.} \dotfill \if@placepoints{\bf\footnotesize(\thepoints)}\fi} +%\makeatother + +EOT + ENDDOCUMENT(); diff --git a/lib/WeBWorK/ContentGenerator/Hardcopy.pm b/lib/WeBWorK/ContentGenerator/Hardcopy.pm index 08ee8a9eaa..40f7a41b08 100644 --- a/lib/WeBWorK/ContentGenerator/Hardcopy.pm +++ b/lib/WeBWorK/ContentGenerator/Hardcopy.pm @@ -962,7 +962,7 @@ async sub write_set_tex ($c, $FH, $TargetUser, $setID) { # write set header await $c->write_problem_tex($FH, $TargetUser, $MergedSet, 0, $header); # 0 => pg file specified directly - print $FH "\\medskip\\hrule\\nobreak\\smallskip"; + print $FH "\\medskip\\hrule\\nobreak\\smallskip\n\\begin{questions}\n"; # write each problem # for versioned problem sets (gateway tests) we like to include @@ -975,6 +975,8 @@ async sub write_set_tex ($c, $FH, $TargetUser, $setID) { $i++; } + print $FH "\\end{questions}\n"; + # write footer await $c->write_problem_tex($FH, $TargetUser, $MergedSet, 0, $footer); # 0 => pg file specified directly @@ -1179,24 +1181,23 @@ async sub write_problem_tex ($c, $FH, $TargetUser, $MergedSet, $problemID = 0, $ my $body_text = $pg->{body_text}; if ($problemID) { + my $id = $MergedProblem->problem_id; if (defined($MergedSet) && $MergedSet->assignment_type eq 'jitar') { # Use the pretty problem number if its a jitar problem - my $id = $MergedProblem->problem_id; - my $prettyID = join('.', jitar_id_to_seq($id)); - print $FH "{\\bf " . $c->maketext("Problem [_1].", $prettyID) . "}"; - } elsif ($MergedProblem->problem_id != 0) { - print $FH "{\\bf " - . $c->maketext("Problem [_1].", $versioned ? $versioned : $MergedProblem->problem_id) . "}"; + $id = join('.', jitar_id_to_seq($id)); + } elsif ($id != 0 && $versioned) { + $id = $versioned; # this cannot be right? } my $problemValue = $MergedProblem->value; if (defined($problemValue)) { - my $points = $problemValue == 1 ? $c->maketext('point') : $c->maketext('points'); - print $FH " {\\bf\\footnotesize($problemValue $points)}"; + print $FH "\\titledquestion{$id}[$problemValue]\n"; + } else { + print $FH "\\titledquestion{$id}\n"; } if ($c->{can_show_source_file} && $c->param("show_source_file") eq "Yes") { - print $FH " {\\footnotesize\\path|" . $MergedProblem->source_file . "|}"; + print $FH "{\\footnotesize\\path|" . $MergedProblem->source_file . "|}\n"; } print $FH "\\smallskip\n\n";