2

Following code renders completely fine but I still get the infuriating "missing $ inserted" error at line 6 and 12. I've got no idea where the problem lies.

Here's the code:

\documentclass[]{standalone}
\usepackage{amsmath}
\usepackage{mathtools}  
\begin{document}
$$ 
\begin{cases}
F&=ma \\

F&=Eq

\end{cases} $$ \end{document}

Thanks in advance!

Blues
  • 21
  • 1
  • 5
    No blank lines in math modes! – Stephen Aug 10 '23 at 13:10
  • 2
  • 1
    Use article instead of standalone. (Welcome to TeX.SE, by the way.) – Teepeemm Aug 10 '23 at 13:25
  • I've removed the blank lines and enclosed the cases environment in [ ]. Now I still get missing $ inserted error on top of a new "Bad math environment delimeter" on line 10. – Blues Aug 10 '23 at 13:27
  • Oh ok changing article to standalone fixed it. I've heard that using standalone is good when checking snippets of code on their own. Guess I'll have to look into what standalone is really useful for – Blues Aug 10 '23 at 13:29
  • @Blues If you want to have math environment with the standalone class, you can use the varwidth class option: \documentclass[varwidth]{standalone} – samcarter_is_at_topanswers.xyz Aug 10 '23 at 14:03
  • What exactly are you trying to show here? F&=ma does not really make sense in a cases env. In this env each row is of the form formula & condition, it is not meant for alignment like in align – daleif Aug 10 '23 at 14:07
  • 1
    standalone is nice for making a small image that you want to include elsewhere. But to do so, it pulls in lots of extra code. You can make the equation work with the varwidth option, but if you're trying to figure out a bug, then standalone introduces complications that can mask other things. (You've uncovered a firehose of information with this question, but I do want to encourage you. Your question and comments are showing some good understanding of what you've learned about TeX.) – Teepeemm Aug 10 '23 at 14:35

0 Answers0