0

I defined several new commands like this:

\newcommand{\NAME1}[1]{\textcolor[rgb]{0.41,0.66,0.88}{(NAME1): #1}}
\newcommand{\NAME2}[1]{\textcolor[rgb]{0.8,0.2,0.3}{(NAME2): #1}}

I used them to add comments and I would like to know how can I add something in my preamble maybe to choose whether I want those commands to be included or not in the final pdf?

Thanks

aripod
  • 107
  • First of all, "commands" are not included in the pdf, it depends on how you use it. Secondly, you cannot put digits in command names. – Alan Xiang Sep 08 '20 at 03:41
  • Of course commands will not be included, I meant the TEXT that is generated with those commands. The numbers are just an EXAMPLE. There are DIFFERENT NAMES...I thought those 2 things were PRETTY obvious to clarify them.... – aripod Sep 08 '20 at 05:39
  • Well, more explanation could be helpful. Of course you can declare a boolean variable like this example and use a macro to toggle between true/false code. However, since there is only one line of code, you can also write two versions in the preamble and comment the one you don't want... – Alan Xiang Sep 08 '20 at 06:33
  • I was thinking if there would be an option to "exinclude" a list of commands in one line on the preamble for example rather than using two versions....because like that I could just simply comment out in each line they are written which is what I am doing now but it is troublesome – aripod Sep 08 '20 at 07:14
  • @airpod Again, the example link may be helpful. You can set a boolean variable with \newif and form your definition like so:\iflong <def1> \else <def2> \fi. Now you can switch between <def1> and <def2> by using one command. – Alan Xiang Sep 08 '20 at 14:37

0 Answers0