|
40 | 40 |
|
41 | 41 | \RequirePackage{amsmath} |
42 | 42 | \RequirePackage{amssymb} % todo ? https://tex.stackexchange.com/a/3000/107497 recommends dropping amssymb in favor of unicode-math |
| 43 | +% but then the font loading gets messed up with mathspec |
| 44 | +%\RequirePackage{unicode-math} |
43 | 45 | \RequirePackage{amsthm} |
44 | 46 |
|
45 | 47 | \RequirePackage{graphicx} |
|
56 | 58 | \lxDocumentID{apex} |
57 | 59 |
|
58 | 60 | \numberwithin{figure}{section} |
| 61 | +\numberwithin{equation}{section} |
59 | 62 | \newcounter{savefigure} |
60 | 63 |
|
61 | 64 | \newtheoremstyle{apexExample}% name |
|
87 | 90 | \theoremstyle{apex} |
88 | 91 |
|
89 | 92 | \makeatletter |
90 | | -\renewenvironment{proof}[1][\proofname]{\par |
| 93 | +\renewenvironment{proof}[1][\proofname]{\pagebreak[2]\par |
91 | 94 | \pushQED{\qed}% |
92 | 95 | \normalfont \topsep6\p@\@plus6\p@\relax |
93 | 96 | \trivlist |
|
276 | 279 |
|
277 | 280 |
|
278 | 281 | \newcommand{\solution}{\bigbreak\par |
279 | | -\makebox[65pt][l]{\textsc{\small\textbf{Solution\lxAddClass{solutionTag}}}}% |
| 282 | + \makebox[65pt][l]{\textsc{\small\textbf{Solution\lxAddClass{solutionTag}}}}% |
| 283 | + \nopagebreak% |
280 | 284 | } |
281 | 285 |
|
282 | 286 | %% This is the no-star (regular) version of the example command. |
|
294 | 298 |
|
295 | 299 |
|
296 | 300 | % try this for \begin{example}/\end{example} |
297 | | -\newcommand{\eoehere}{} |
298 | 301 | \newcommand{\drawexampleline}{} |
299 | 302 | %\renewcommand{\examplestarred}[3]{% |
300 | 303 | % \begin{exampleEnv}[#2]\label{#1} |
|
311 | 314 | lines before break=5, |
312 | 315 | before upper={\setlength{\parindent}{\saveparindent}\noindent}, |
313 | 316 | boxsep=0pt, |
| 317 | + bottom=2pt, |
314 | 318 | overlay unbroken={ |
315 | 319 | \node[xshift=-2\marginlinelength,yshift=-.5\baselineskip] |
316 | 320 | (start\arabic{example})at(frame.north west){}; |
|
518 | 522 |
|
519 | 523 | \makeatletter |
520 | 524 | \newcommand{\exercisesubsubsection}{% |
521 | | -\@startsection{subsubsection}{3}{-1em}{\bigskipamount}{\bigskipamount}{\Large\textit}*} |
| 525 | + \closeenumerate% |
| 526 | + \@startsection{subsubsection}{3}{-1em}{\bigskipamount}{\bigskipamount}{\Large\textit}*} |
522 | 527 | \makeatother |
523 | 528 |
|
524 | | -\newcommand{\printconcepts}{\closeenumerate\exercisesubsubsection{Terms and Concepts}} |
525 | | -\newcommand{\printproblems}{\closeenumerate\exercisesubsubsection{Problems}} |
526 | | -\newcommand{\printreview}{\closeenumerate\exercisesubsubsection{Review}} |
| 529 | +\newcommand{\printconcepts}{\exercisesubsubsection{Terms and Concepts}} |
| 530 | +\newcommand{\printproblems}{\exercisesubsubsection{Problems}} |
| 531 | +\newcommand{\printreview}{\exercisesubsubsection{Review}} |
527 | 532 |
|
528 | 533 | \newcommand{\inanswersection}{% |
529 | 534 | \setboolean{printquestions}{false}% |
|
560 | 565 | %%%%%%%%%%%%% end the text. |
561 | 566 |
|
562 | 567 |
|
563 | | -\newcommand{\makeexercisesection}[2][\jobname]{% |
| 568 | +\newcommand{\printsolutions}[2][\jobname]{% |
564 | 569 | %\showans\answrite |
565 | 570 | % showans will write the contents of Calculus.answers to the log |
566 | 571 | % in latexml, this needs to happen before closing |
|
602 | 607 | \makeatother |
603 | 608 |
|
604 | 609 | \newcommand{\exautoref}[1]{% |
605 | | - \hyperref[#1]{Exercise~\ref*{#1}}% |
| 610 | + \hyperref[#1]{Ex\-er\-cise~\ref*{#1}}% |
606 | 611 | % {% |
607 | 612 | % \renewcommand{\Itemautorefname}{Exercise}% localize the upcoming reference |
608 | 613 | % \autoref{#1}% |
|
621 | 626 | \small% |
622 | 627 | \bigskip% |
623 | 628 | \begin{multicols}{2}% |
624 | | - \renewcommand{\Itemautorefname}{Exercise}% local b/c multicols = good |
| 629 | + \restartlist{enumerate} |
| 630 | + \renewcommand{\Itemautorefname}{Ex\-er\-cise}% local b/c multicols = good |
625 | 631 | \input{#1}% |
626 | 632 | \closeenumerate% |
627 | 633 | \end{multicols}% |
|
644 | 650 | \newcommand*{\answersForSection}[3]{% |
645 | 651 | \ifthenelse{\equal{#1}{\lastanswerchapter}}{}{% |
646 | 652 | \renewcommand{\lastanswerchapter}{#1}% apparently global. who knew? |
647 | | - \section*{Chapter #1} |
648 | 653 | \ifthenelse{\boolean{latexml}}{% |
649 | 654 | }{% |
650 | 655 | \belowpdfbookmark{Chapter #1}{solsol#1}% |
651 | 656 | } |
652 | 657 | % commandeer chapter and section numbering |
653 | 658 | \setcounter{chapter}{#1} |
654 | | -% \setcounter{answerchapter}{#1} |
655 | | -% \setcounter{answersection}{0} |
| 659 | + \section*{Chapter \thechapter} |
656 | 660 | }% |
657 | 661 | \setcounter{section}{#2} |
658 | | - \subsection*{\hyperref[exer#1.#2]{Exercises #1.#2}}\label{sol#1.#2} |
| 662 | + \subsection*{\hyperref[exer\thesection]{Exercises \thesection}}% |
| 663 | + \label{sol\thesection} |
659 | 664 | \ifthenelse{\equal{#2}{0}}{% |
660 | 665 | \loadAllAnswers{#3} |
661 | 666 | }{% |
|
676 | 681 | } |
677 | 682 | \newcommand*{\loadAnswers}[1]{% |
678 | 683 | \stepcounter{answersection}% |
679 | | - \lxenumerate{leftmargin=1.5em}\input{#1}\end{enumerate}% |
| 684 | + \begin{enumerate}[leftmargin=1.5em]\input{#1}\end{enumerate}% |
680 | 685 | \bigbreak% |
681 | 686 | } |
682 | 687 |
|
683 | 688 | \newcommand{\openenumerate}{\ifthenelse{\boolean{printquestions}% |
684 | 689 | \AND\NOT\boolean{enumopen}}{% |
685 | 690 | \setboolean{enumopen}{true}% |
686 | | - \lxenumerate{leftmargin=1.5em}% |
687 | | - \setcounter{enumi}{\value{saveexerciseenum}}% |
| 691 | + \begin{enumerate}[leftmargin=1.5em,resume]% |
688 | 692 | }{}} |
689 | 693 |
|
690 | 694 | \newcommand{\closeenumerate}{\ifthenelse{\boolean{printquestions}% |
691 | 695 | \AND\boolean{enumopen}}{% |
692 | | - \setcounter{saveexerciseenum}{\value{enumi}}% |
693 | 696 | \end{enumerate}% |
694 | 697 | \setboolean{enumopen}{false}% |
695 | 698 | }{}} |
|
698 | 701 | % and things went strange |
699 | 702 | \newcommand{\exerciseset}[3]{\ifthenelse{\boolean{printquestions}}{% |
700 | 703 | \closeenumerate% |
701 | | - \stepcounter{saveexerciseenum}% |
| 704 | + \stepcounter{enumi}% |
702 | 705 | \stepcounter{exercisesetcounter}% |
703 | | - \ifthenelse{\isodd{\value{saveexerciseenum}}}{}{% |
| 706 | + \ifthenelse{\isodd{\value{enumi}}}{}{% |
704 | 707 | \PackageInfo{apex}{% |
705 | | - Exercise set \theexercisesetcounter\space begins with \arabic{saveexerciseenum}% |
706 | | -% Section \thesection\space has an exercise set |
707 | | -% beginning with \arabic{saveexerciseenum}% |
| 708 | + Exercise set \theexercisesetcounter\space begins with \arabic{enumi}% |
708 | 709 | }% |
709 | 710 | }% |
710 | | - \noindent#1 \arabic{saveexerciseenum}--\ref*{enumiatendof\theexercisesetcounter}#2% |
711 | | - \addtocounter{saveexerciseenum}{-1}\ignorespaces% |
| 711 | + \pagebreak[1]% |
| 712 | + \noindent#1 \arabic{enumi}--\ref*{enumiatendof\theexercisesetcounter}#2% |
| 713 | + \addtocounter{enumi}{-1}\ignorespaces% |
| 714 | + \nopagebreak% |
712 | 715 | #3 |
| 716 | + \pagebreak[1]% |
713 | 717 | \label{enumiatendof\theexercisesetcounter}% |
714 | 718 | \ifthenelse{\isodd{\value{enumi}}}{% |
715 | 719 | \PackageInfo{apex}{% |
716 | 720 | Exercise set \theexercisesetcounter\space ends with \arabic{enumi}% |
717 | | -% Section \thesection\space has an exercise set ending with \arabic{enumi}% |
718 | 721 | }% |
719 | 722 | }{}% |
720 | 723 | }{ |
|
0 commit comments