(defun my/latex-remove-NOTES-blocks (text backend info)
"Filter special blocks from latex export."
(when (eq backend 'latex)
(if (string/starts-with text "\\begin{NOTES}") "")))
(eval-after-load 'ox '(add-to-list
'org-export-filter-special-block-functions
'my/latex-remove-NOTES-blocks))