4

I want to have 3 types of comments. Comments means it is (special formatted, e.g. colored) text in the resulting PDF file.

I want to switch them on or off selectively. I am not sure which of the comment related packages is related here.

\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}

The background to my question: I write a thesis as a student having two advisors.

  • There are comments/notes only for my eyes.
  • Comments only for advisor A but not for B.
  • Comments for A and B.

Depending on who I am showing the current state of my paper I need to switch off one or two types of the comments.

  • 1
    There are lots of packages which are fitting your needs. E.g. comment, luatodonotes, todonotes, etc. ctan.org/topic/editorial – Marco Daniel Mar 20 '17 at 9:51
  • @marcodaniel The question wasn't about selecting a package. It was about how to solve me needs with them. – buhtz Mar 20 '17 at 9:56
  • For me the question is too broad. I can provide an answer using the package comment After this your needs are increasing and so we change to something else -- and so on. Is there a possibility that you want a comment for A and you? – Marco Daniel Mar 20 '17 at 10:40
6

Three environments: commentA, commentB, and commentC. They can be selectively turned on and off with \Aon, \Aoff, \Bon, \Boff, \Con, and \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}

enter image description here

  • Could it be that there is no hyphenation in that comment blocks? – buhtz Mar 29 '17 at 14:38
  • @buhtz No, that is not the case. If I put \lipsum[1] in the comment block, it hyphenates just fine. – Steven B. Segletes Mar 30 '17 at 11:05
  • What is if you use scrartcl as documentclass? – buhtz Apr 9 '17 at 15:44
  • 1
    @buhtz When I take my MWE and replace article with scrartcl, everything compiles just fine. – Steven B. Segletes Apr 10 '17 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.