Aligning Equal Signs Vertically

Hello,

I want to align equal signs vertically within a Note. Is it possible to code the following? I have tried multiple times asking AI but pasting the code it gave me into CL just doesn’t work. The numbers in the equation will be generated randomly.

content: "`

\begin{aligned}
3x + 2 &= 8 \\
3x &= 8 - 2 \\
3x &= 6 \\

x & =2

\end{aligned}
`"

Thank you!

As far as I can tell, a Note won’t render \begin{aligned}. I tried it with the backslashes doubled, and the math just disappears. Two things that do work.

In a Note, close but not exact: pad the lower lines with em and en spaces.


r = randomGenerator()

a = r.int(2,6)
b = r.int(1,9)
xVal = r.int(1,6)

ax = numericValue("${a}*${xVal}")
total = numericValue("${ax}+${b}")

content: "`${a}x+${b}=${total}`\n\n   `${a}x=${total}-${b}`\n\n   `${a}x=${ax}`\n\n   `x=${xVal}`"

The gaps before lines 2 to 4 are em spaces (U+2003) and en spaces (U+2002); if the lines don’t indent after you paste, those characters didn’t survive the copy. The first few lines make the random numbers. If you use your own generator, set a, b, xVal, ax and total from it, and keep a and b single-digit: that keeps each left side the same width, so the spacing holds on every draw.

Exact: a table with the = in its own column. Add a table with 4 rows and 3 columns and paste this into its CL:


r = randomGenerator()

a = r.int(2,6)
b = r.int(1,9)
xVal = r.int(1,6)

ax = numericValue("${a}*${xVal}")
total = numericValue("${ax}+${b}")

cellContent(1,1): "${a}x+${b}"
cellContent(1,2): "="
cellContent(1,3): "${total}"

cellContent(2,1): "${a}x"
cellContent(2,2): "="
cellContent(2,3): "${total}-${b}"

cellContent(3,1): "${a}x"
cellContent(3,2): "="
cellContent(3,3): "${ax}"

cellContent(4,1): "x"
cellContent(4,2): "="
cellContent(4,3): "${xVal}"

cellEditable(1,1): false
cellEditable(1,2): false
cellEditable(1,3): false
cellEditable(2,1): false
cellEditable(2,2): false
cellEditable(2,3): false
cellEditable(3,1): false
cellEditable(3,2): false
cellEditable(3,3): false
cellEditable(4,1): false
cellEditable(4,2): false
cellEditable(4,3): false

Leave backticks out of cellContent; a table shows them as literal backticks and renders the math without them.

I worked these out by pasting your post into the free ChatGPT plugin called “CL for Desmos & Amplify” (it’s a free ChatGPT plugin I made for writing CL) and asking a couple of follow-ups (not affiliated with Amplify or Desmos; if your school manages your ChatGPT account, your admin may need to turn it on). It really saves me time on writing CL for assignments to my specs. You can find it by searching “desmos” in the ChatGPT plugin library. Last time I checked, it’s the only thing that comes up.

Activity Builder does not use the whole of LaTeX markup. It uses MathQuill, and I’m actually unsure if it uses all aspects of that version as well.

Thank you for your response!

I guess there is no align feature available yet.

I’m actually trying to set up a feedback that shows up when a student (or me when I’m tired) cannot solve a randomized problem and want to see the complete solution. I’ll see if I can tweak it so that I can use your table idea to show the solution instead.

I really appreciate the help!

FYI, cellEditable is unnecessary if you’re defining cellContent via CL. There’d be a conflict regarding which “wins” were it editable.