选择性地打开/关闭多种类型的评论

选择性地打开/关闭多种类型的评论

我想要三种类型的评论。评论表示它是生成的 PDF 文件中的文本(特殊格式,例如彩色)。

我想有选择地打开或关闭它们。我不确定这里与评论相关的哪个包相关。

\documentclass{scrartcl}
\usepackage{xltxtra}
\usepackage{microtype}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new]{german}

\usepackage{comment}
\includecomment{comment}

\begin{document}
\begin{comment}
comment - only for me
\end{comment}

\begin{comment}
comment - only for advisor A
\end{comment}

\begin{comment}
comment - for advisor A and B
\end{comment}
\end{document}

我的问题背景是:我作为一名学生写了一篇论文,有两位导师。

  • 只有我自己能看到的评论/注释。
  • 评论仅针对顾问 A,不针对 B。
  • 对 A 和 B 的评论。

根据我向谁展示我的论文的当前状态,我需要关闭一到两种类型的评论。

答案1

三种环境:commentAcommentB和。可以使用、、、、和commentC选择性地打开或关闭它们。\Aon\Aoff\Bon\Boff\Con\Coff

\documentclass{article}
\usepackage{environ,lipsum,xcolor}
\NewEnviron{commentA}{}
\newcommand\Aon{\RenewEnviron{commentA}{\color{red}\BODY}}
\newcommand\Aoff{\RenewEnviron{commentA}{}}
\NewEnviron{commentB}{}
\newcommand\Bon{\RenewEnviron{commentB}{\color{blue}\BODY}}
\newcommand\Boff{\RenewEnviron{commentB}{}}
\NewEnviron{commentC}{}
\newcommand\Con{\RenewEnviron{commentC}{\color{cyan}\BODY}}
\newcommand\Coff{\RenewEnviron{commentC}{}}
\begin{document}
\Aon
\Bon
\Con
\lipsum[1]
\begin{commentA}
\lipsum[2]
\end{commentA}
\begin{commentB}
\lipsum[2]
\end{commentB}
\begin{commentC}
\lipsum[2]
\end{commentC}

\Aoff
\lipsum[1]
\begin{commentA}
\lipsum[2]
\end{commentA}
\begin{commentB}
\lipsum[2]
\end{commentB}
\begin{commentC}
\lipsum[2]
\end{commentC}

\Boff
\lipsum[1]
\begin{commentA}
\lipsum[2]
\end{commentA}
\begin{commentB}
\lipsum[2]
\end{commentB}
\begin{commentC}
\lipsum[2]
\end{commentC}

\Coff
\lipsum[1]
\begin{commentA}
\lipsum[2]
\end{commentA}
\begin{commentB}
\lipsum[2]
\end{commentB}
\begin{commentC}
\lipsum[2]
\end{commentC}
\lipsum[3]

\end{document}

在此处输入图片描述

相关内容