I would like to create documents that include markdown within environments that can be hidden. Currently, I am using pandoc with a custom template and following the instructions for hiding environments here and this workaround for masking environments from the pandoc markdown interpreter.

Sample markdown file:

instructor: true

This is text that should always appear


This is some **markdown formatted** text that can be hidden/shown


This is some *markdown formatted* text that will always be shown.

Template being used:






If I adjust the template to use just one of the features (environment hiding or markdown within environments) the setup works as desired. The current template works correctly if instructor: true is set in YAML and fails if instructor: false is set.

If I manually modify the .tex file produced, replacing \End{inst} with \end{inst}, I get proper rendering of the file. It appears as if excludecomment isn't recognizing that \End has been letted. Any ideas on how to make this process work?

  • I assume that I'm running into the problem mentioned here where the comment environment is looking for \end{inst} exactly. I'd like to find a workaround. – bobthechemist Jan 11 at 18:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.