Using Typst to Help Me Study

I have been learning how to use Typst lately. I came from using LaTex then Quarto then Typst. I find Typst to be a lot more modern and easier to use than LaTex or Quarto. It has less boiler plate to get started than LaTex. It uses Markdown syntax just like Quartos. And it has a more robust scripting capability. One of the first thing I did with Typst was to create a Bingo card. Then I started using it to write my papers for my courses. Then one day while studying for one of my midterms. I realized I can use Typst to help me study by creating practice tests.

There is a part of the midterm where my prof has already told us what will be on it. We have to be able to match scripture passages to the corresponding doctrine that it teaches. I already took a similar course last semster by the same prof, so I have an idea of what the format of the midterm will look like. This mean that I can re-create a portion of the test (15% of it) using Typst. I thought this is a great idea because it will give me an excuse to use Typst and help me study for my midterm.

Below is the final Typst code that I used to generate the practice test. Click here to see the practice test it produced

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#import "@preview/suiji:0.5.1": *
#set text(size: 12pt)

#let rng = gen-rng-f(20260301)

#let questions = (
  "Heb 2:14": "Death of Christ as a victory over Satan.",
  "Rom 3:25": "Death of Christ as a propitiation",
  "Matt 20:28": "Death of Christ as a substitutionary act",
  "Isa 53:10-12": "OT anticipation of the resurrection of Christ",
  "Acts 11:18": "Repentance/faith as a gift of God",
  "Rom 5:1": "Faith as the means of jutification",
  "1 Thess 5:23": "Sanctification as a future reality",
  "Rom 8:29": "God’s foreknowledge of the saved",
  "Heb 3:14": "True faith is persevering faith.",
  "1 John 2:3": "Sanctification as a basis for assurace",
  "1 Cor 12:13": "All believers baptized in the Spirit",
  "Acts 13:48": "Foreordination the cause of faith",
  "1 Tim 2:4": "God desires to save all humans",
  "2 Peter 1:10": "The 'called' = the 'elect'",
  "James 1:18": "Regeneration through the word/gospel.",
  "Rom 8:30": "All the justified will be glorified",
  "1 Thess 4:16": "Resurrection of the saved at the return of Christ",
  "Rom 6:3-4": "Union with Christ in his death and resurrection",
  "Heb 10:10": "Definitive sanctification of the believer through Christ",
  "Titus 3:5": "Justification by faith alone",
)

#let verses = questions.keys()
#let phrase = questions.values()

#let (rng, phrase) = shuffle-f(rng, phrase)
#let c1 = counter("col1")
#let c2 = counter("col2")

= Practice Matching Test
Match the following verses with their corresponding theological doctrines:

#table(  columns: (1fr, auto),
  stroke: none,

  ..for x in verses.zip(phrase) {( 
    c1.step(),
    c2.step(),
    [#context c1.display(). \_\_\_ #x.at(1)], [#context c2.display("a)") #x.at(0)],
  )}
)

Line 6-30, is used to define the dictionary used to store the questions. The verses and phrases are split in line 29-30 so that when I can shuffle the pharses without changing the order of the verses.

#let rng = gen-rng-f(20260301) in line 4 generates the seeds to get reproducible random numbers. I use this later in line 32 #let (rng, phrase) = shuffle-f(rng, phrase) to shuffle the test questions around. By changing the number in the parameters of gen-rng-f I can randomize the order of the questions.

Line 42-47 is the where I generate the list of questions. I created two counters in line 33 and 34, this is used later in line 45 to generate two different kind of counters. One numerically and one alphabetically.

Future Improvements

In the future I would also want it to generate an answer key.