Added if_solutions methods
All checks were successful
CI / Typst formatting (push) Successful in 9s
CI / Typos (push) Successful in 17s
CI / Build (push) Successful in 15m19s

Reviewed-on: #5
Co-authored-by: Mark <mark@betalupi.com>
Co-committed-by: Mark <mark@betalupi.com>
This commit is contained in:
Mark 2025-01-23 13:08:50 -08:00 committed by Mark
parent ede934369b
commit b9751385d1
4 changed files with 13 additions and 9 deletions

View File

@ -137,7 +137,11 @@
}
}
#let notsolution(content) = {
#let if_solutions(content) = {
if show_solutions { content }
}
#let if_no_solutions(content) = {
if not show_solutions { content }
}

View File

@ -126,7 +126,7 @@ Fill the following tropical addition and multiplication tables
#let col = 10mm
#notsolution(
#if_no_solutions(
table(
columns: (1fr, 1fr),
align: center,

View File

@ -63,7 +63,7 @@ where all exponents represent repeated tropical multiplication.
Draw a graph of the tropical polynomial $f(x) = x^2 #tp 1x #tp 4$. \
#hint([$1x$ is not equal to $x$.])
#notsolution(graphgrid(none))
#if_no_solutions(graphgrid(none))
#solution([
$f(x) = min(2x , 1+x, 4)$, which looks like:
@ -132,7 +132,7 @@ How can we use the graph to determine these roots?
Graph $f(x) = -2x^2 #tp x #tp 8$. \
#hint([Use half scale. 1 box = 2 units.])
#notsolution(graphgrid(none))
#if_no_solutions(graphgrid(none))
#solution([
#graphgrid({
@ -210,7 +210,7 @@ and always produces $7$ for sufficiently large inputs.
#problem()
Graph $f(x) = 1x^2 #tp 3x #tp 5$.
#notsolution(graphgrid(none))
#if_no_solutions(graphgrid(none))
#solution([
The graphs of all three terms intersect at the same point:
@ -261,7 +261,7 @@ How are the roots of $f$ related to its coefficients?
#problem()
Graph $f(x) = 2x^2 #tp 4x #tp 4$.
#notsolution(graphgrid(none))
#if_no_solutions(graphgrid(none))
#solution(
graphgrid({

View File

@ -10,7 +10,7 @@ Consider the polynomial $f(x) = x^3 #tp x^2 #tp 3x #tp 6$. \
- use this graph to find the roots of $f$
- write (and expand) a product of linear factors with the same graph as $f$.
#notsolution(graphgrid(none))
#if_no_solutions(graphgrid(none))
#solution([
- Roots are 1, 2, and 3.
@ -48,7 +48,7 @@ Consider the polynomial $f(x) = x^3 #tp x^2 #tp 6x #tp 6$. \
- use this graph to find the roots of $f$
- write (and expand) a product of linear factors with the same graph as $f$.
#notsolution(graphgrid(none))
#if_no_solutions(graphgrid(none))
#solution([
- Roots are 1, 2.5, and 2.5.
@ -82,7 +82,7 @@ Consider the polynomial $f(x) = x^3 #tp 6x^2 #tp 6x #tp 6$. \
- use this graph to find the roots of $f$
- write (and expand) a product of linear factors with the same graph as $f$.
#notsolution(graphgrid(none))
#if_no_solutions(graphgrid(none))
#solution([
- Roots are 2, 2, and 2.