我使用 Latex 包框架定义包含标题和文本的“环境”。但是,如果布尔变量设置为 false,我想添加一些不应显示的个人注释。我该如何实现?
答案1
最终,我这样做了:
%% 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