2

There are lots of ways to make comment in LaTex such as single percentage sign, \begin{comment} and so on, but as I know none of them use for creating comment for separating lines of a doc. It's good to know there is a way to make a group comment in LaTex.

ie:

we have text and command here and want to be comment(group1) . . . we have text and command here and want not to be comment(group2) . . . we have text and command here and want to be comment(group1) . . . we have text and command here and want not to be comment(group2) 

and other groups, now we want to comment one group and see result and then comment other group and uncomment first group and so on. for a bit challenging imagine that this groups of comment are distribute in multiple file (not all file but a part of it like one line in chapter 1, two lines in chapter 2, three lines in chapter 8 and ...).

any help would be appreciated.

6
  • 2
    Use the comment package. Commented Aug 12, 2017 at 16:01
  • 1
    Your question is answered in Commenting out large sections. However, you already mention you're using comment. Did you know you can specify a different environment to be similar to comment, like commentA, commentB, ... That way you can switch them on/off as you need. Commented Aug 12, 2017 at 16:09
  • Is your aim to have a document for multiple audiences? Then you might want to add this, because this would have different approaches. Commented Aug 12, 2017 at 16:34
  • @cfr I read comment package doc in section special comments it explains how to group some commands in one comment but I'm not I can use it with same name in multiple separated files as I explained in above. if you have an Idea I would be appreciated. @Werner thanks dude we have general way in there so I guess I can do like this \newif\ifstateA ,\newif\ifstateB and ... , \stateAtrue or \stateAfalse ... , \ifStateA ..... \fi . @TeXnician Its be good to have a general approach for this type of comments,better callssituational group comment. Commented Aug 12, 2017 at 17:30
  • Sorry, but I have no idea what you're asking. If @TeXnician is right, then we are not actually talking about comments, as far as I can tell. At least, I don't see the connection. (Unless it is just that some audiences shouldn't see some parts, while others should. Then you might say the content should be 'commented' for the first audience, but not for the second.) Commented Aug 12, 2017 at 22:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.