# What LaTeX packages can be compiled in CL?

**URL:** <https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409>\
**Category:** Questions\
**Created:** [March 4, 2019, 1:47am UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409 "2019-03-04T01:47:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jared\_Warner](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@Jared\_Warner](https://cl.desmos.com/u/Jared_Warner)\
**Post date:** [March 4, 2019, 1:47am UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/1 "2019-03-04T01:47:05Z")

</div>

I’m trying to write a piecewise-defined function in LaTeX. I want this LaTeX to be compiled in the content sink of a Note component. The standard way of doing this is something like:

f(x)=\begin{cases}5-x,&x\<3\\-1+\frac{1}{2}x,&x\ge3\end{cases}

When I make (what I think are) the necessary adjustments for CL script, the function shows up blank when I preview the activity.

Am I doing something wrong, or is the cases environment not supported in CL? Is there some documentation of the packages available for compiling in CL?

Furthermore, it’s not entirely clear to me when CL requires an extra backslash in LaTeX and when it doesn’t. Should I always add an extra backslash? What if the LaTeX code requires two successive backslashes? How many extra backslashes should be added in this case?

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [March 4, 2019, 2:17pm UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/2 "2019-03-04T14:17:41Z")

</div>

You can copy an equation from the graph area and paste into CL. It pastes as Latex.

---

<div class="post-metadata">

**Author:** ![Jared\_Warner](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@Jared\_Warner](https://cl.desmos.com/u/Jared_Warner)\
**Post date:** [March 4, 2019, 3:43pm UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/3 "2019-03-04T15:43:04Z")

</div>

Thanks for your response, but unless I’m missing something, I don’t think this method solves my problem. From what I understand, piecewise functions in the calculator are not defined using the cases environment in LaTeX. When I copy and paste a piecewise function from the calculator into CL, it doesn’t copy using cases.

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [March 4, 2019, 4:29pm UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/4 "2019-03-04T16:29:19Z")

</div>

Sorry, that was just a guess. Will wait to see what others say 🙂

---

<div class="post-metadata">

**Author:** ![eric](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/eric/32/10_2.png) [@eric](https://cl.desmos.com/u/eric)\
**Post date:** [March 4, 2019, 4:57pm UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/5 "2019-03-04T16:57:46Z")

</div>

We process Latex using a library called mathquill, which is basically something that behaves a lot like LaTeX, not the LaTeX software itself, so it doesn’t support packages. Playing around in the calculator is a good way to see what’s supported, but the set of packages supported is pretty limited (e.g. there’s no support for the cases environment currently). I don’t believe that we have explicit documentation of all supported commands.

As far as the back-slashes, that comes from CL, not from LaTeX directly. Backslash in a CL string means “take the next character exactly as it is, don’t use it to end the string, or start an interpolation, or anything else”. Because we want the slashes to go directly through to LaTeX, instead of being used to change how CL interprets the string, “\” in a CL string is the way to write “”. If you would need two successive slashes in latex, then you would need four in CL, although I hope that shouldn’t come up often…

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [March 4, 2019, 5:35pm UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/6 "2019-03-04T17:35:20Z")

</div>

So you don’t plan to use the coding to accomplish anything in the graph, you just want the code to appear as it normally would within the note area?  
So the main issue I’m seeing is how do you get CL to “take” the extra large curly brace and two rows afterwards"?

---

<div class="post-metadata">

**Author:** ![Jared\_Warner](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@Jared\_Warner](https://cl.desmos.com/u/Jared_Warner)\
**Post date:** [March 4, 2019, 6:07pm UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/7 "2019-03-04T18:07:47Z")

</div>

Thanks! This is very clear and helpful.

---

<div class="post-metadata">

**Author:** ![Jared\_Warner](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@Jared\_Warner](https://cl.desmos.com/u/Jared_Warner)\
**Post date:** [March 4, 2019, 6:08pm UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/8 "2019-03-04T18:08:49Z")

</div>

Yeah, that’s exactly right. From eric’s response, it seems that CL won’t “take” the cases environment.

---

<div class="post-metadata">

**Author:** ![ASmith](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/asmith/32/360_2.png) [@ASmith](https://cl.desmos.com/u/ASmith)\
**Post date:** [March 4, 2019, 7:29pm UTC](https://cl.desmos.com/t/what-latex-packages-can-be-compiled-in-cl/409/9 "2019-03-04T19:29:29Z")

</div>

wondering if you could place the equation as an image inside the graph as a work-around?

Or use multiple lines like this:  
f(x)={ line 1  
{ line 2

Just a few thoughts.
