I have
\documentclass[11pt]{article}
\usepackage{amsthm}
\usepackage{etoolbox}
\newtoggle{sol}
\toggletrue{sol}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
Text
\iftoggle{sol}{Text}
\end{theorem}
\end{document}
and I am getting and error sayin that \begin{theorem} was ended by \end{document}.
What might I be doing wrong?
\documentclass
command, include any necessary packages and be as small as possible to demonstrate your problem. It's really hard to trouble shoot an error if you are not given enough code to reproduce it.\iftoggle{sol}{true code}{false code}
. As you haven't given the false code the\end{theorem}
is being eaten up and used as this instead, causing your error.