I use the package xcomment to make a stripped down version of mynotes.tex, including only theorems, definitions, etc. E.g.:
\documentclass{article}
\usepackage{xcomment}
\usepackage{docmute}
% Other necessary packages
\xcomment{definition,notation,theorem,proposition,lemma,corollary}
\begin{document}
\input{mynotes.tex}
\end{document}
It would be helpful to also include section headings. The problem is that \section{...} is not an environment like \begin{...} \end{...}, so it will be ignored by xcomment.
Is there a way to include them? Or should I look at other packages like comment (the problem is, that I don't know if comment can only include the above mentioned environments and section headers)?
\sectioncommands should be included in the resulting file, as well as my desired theorem environments. – Gargantuar Dec 30 '21 at 10:54...in\section{...}(and also some specified environments). But no outside text, no toc, noexamplesandremarksenvironments, etc. – Gargantuar Dec 30 '21 at 12:10