File tree Expand file tree Collapse file tree 14 files changed +84
-195
lines changed
Expand file tree Collapse file tree 14 files changed +84
-195
lines changed Original file line number Diff line number Diff line change 2323 python-version : ${{ env.PYTHON_VERSION }}
2424 - uses : awalsh128/cache-apt-pkgs-action@v1.3.0
2525 with :
26- packages : texlive-latex-base
26+ packages : texlive-latex-extra
2727 version : 1.0
2828 - name : Install Python Dependencies
2929 run : |
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11\documentclass {article }
22
3- \begin {document }
3+ \usepackage {comment }
4+
5+ % This is a common method for including/excluding solutions from the PDF.
6+ \includecomment {solution}
7+ % \excludecomment{solution}
48
5- \newenvironment {SomeSolutionDividerName}{}{ }
9+ \begin { document }
610
711\section* {Minimal Example }
812
@@ -12,25 +16,25 @@ \section*{Minimal Example}
1216
1317\begin {enumerate }
1418
15- \item Here is some interesting information. Calculate the following:
19+ \item Here is some interesting information. Calculate the following:
1620
17- \begin {enumerate }
18- \item $ 1 +1 $
19- \item $ 2 +2 $
20- \end {enumerate }
21+ \begin {enumerate }
22+ \item $ 1 +1 $
23+ \item $ 2 +2 $
24+ \end {enumerate }
2125
22- \begin {SomeSolutionDividerName }
23- \begin {enumerate }
24- \item $ 1 +1 =2 $
25- \item $ 2 +2 =4 $
26- \end {enumerate }
27- \end {SomeSolutionDividerName }
26+ \begin {solution }
27+ \begin {enumerate }
28+ \item $ 1 +1 =2 $
29+ \item $ 2 +2 =4 $
30+ \end {enumerate }
31+ \end {solution }
2832
29- \item This questions has no parts. What is the solution?
33+ \item This questions has no parts. What is the solution?
3034
31- \begin {SomeSolutionDividerName }
32- This is the solution.
33- \end {SomeSolutionDividerName }
35+ \begin {solution }
36+ This is the solution.
37+ \end {solution }
3438
3539\end {enumerate }
3640
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
3- """A filter that parses files where solutions come after the whole questions and are broken down by part."""
3+ """A filter that parses files where solutions come after the whole question and are broken down by part.
4+
5+ i.e. Parts follow each other, and solutions for those parts follow next.
6+ """
47
58from typing import Optional
69
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ \documentclass [12pt ]{article }
2+
3+ \usepackage {comment }
4+
5+ % This is a common method for including/excluding solutions from the PDF.
6+ \includecomment {solution}
7+ % \excludecomment{solution}
8+
9+ \begin {document }
10+
11+ \section* {Minimal Example }
12+
13+ \begin {enumerate }
14+
15+ \item Here is some interesting information. Calculate the following:
16+
17+ \begin {enumerate }
18+ \item $ 1 +1 $
19+
20+ \begin {solution }
21+ $ 1 +1 = 2 $
22+ \end {solution }
23+
24+
25+ \item $ 2 +2 $
26+
27+ \begin {solution }
28+ $ 2 +2 =4 $
29+ \end {solution }
30+
31+ \end {enumerate }
32+
33+ \item This questions has no parts. What is the solution?
34+
35+ \begin {solution }
36+ This is the solution.
37+ \end {solution }
38+
39+ \end {enumerate }
40+
41+ \end {document }
Original file line number Diff line number Diff line change @@ -59,5 +59,6 @@ def pandoc_filter(
5959 if pandoc_filter .question :
6060 module .add_question (main_text = "\n " .join (pandoc_filter .question ))
6161 module .current_question .add_solution (pf .stringify (elem ))
62+ module .current_question ._last_part ["solution" ] -= 1
6263 pandoc_filter .question = []
6364 return None
File renamed without changes.
Original file line number Diff line number Diff line change 11\documentclass [12pt ]{article }
22
3- \newenvironment {AnyName}{}{}
3+ \usepackage {comment }
4+
5+ % This is a common method for including/excluding solutions from the PDF.
6+ \includecomment {solution}
7+ % \excludecomment{solution}
48
59\begin {document }
610
@@ -15,8 +19,7 @@ \subsection{}
1519 \item The filter still works even if there aren't any parts
1620\end {enumerate }
1721
18- \begin {AnyName }
19- \paragraph {Solution }
22+ \begin {solution }
2023
2124 This is the final answer. It contains the solutions for all parts without breaking them up.
2225
@@ -26,14 +29,14 @@ \subsection{}
2629
2730 The solution is copied across all parts.
2831
29- \end {AnyName }
32+ \end {solution }
3033
3134\subsection {}
3235
3336This is question 2.
3437
35- \begin {AnyName }
36- \paragraph { Solution } And here's the solution
37- \end {AnyName }
38+ \begin {solution }
39+ And here's the solution
40+ \end {solution }
3841
3942\end {document }
You can’t perform that action at this time.
0 commit comments