0

I use the Latex package mdframed to define "environments" containing headlines and text. However, I would like to add some personal notes which should not (!) be displayed, if a boolean variable is set to false. How can I achieve that?

Semoi
  • 101
  • 1
    What have you tried so far? Please add a MWE. – epR8GaYuh Jun 22 '18 at 19:45
  • the stand art solutin wolul be to resort to any of tje usuall packages comment, version, or versions. You could also have a look to my answer to this post (https://tex.stackexchange.com/questions/437614) to stick with the "boolean variable" – Jhor Jun 23 '18 at 16:58

1 Answers1

0

This is how I did it, finally:

%% Define a boolean variable
\newif\ifDisplayToDos
\DisplayToDostrue   % display the toDo-environment 
%\DisplayToDosfalse % uncomment to hide the toDo-environment 

% This will be used below to define an empty environment via \NewEnviron
\usepackage{environ} 

% Depending on the boolean variable, I define the environment:
\ifDisplayToDos
  % define proper environment
  \newmdtheoremenv[backgroundcolor=red]{todo}{ToDo}[section]
\else
  % def. empty environment
  \NewEnviron{todo}{}
\fi
Semoi
  • 101