
Hello, you can use modes. ----------- \definemode[ModeA][keep] \definemode[ModeB][keep] % ... \starttext \startmode[ModeA] \macroA \stopmode \startmode[ModeB] \macroB \stopmode \stoptext ----------- Then you type: context --mode=ModeA yourfile.tex or context --mode=ModeB yourfile.tex If you want to run both \macroA and \macroB, context --mode=ModeA,ModeB yourfile.tex You can also use \startnotmode[ModeA] ... \stopnotmode to run something only when ModeA is not active. Massi Il 27/04/25 20:42, Joel via ntg-context ha scritto:
I have a single *.tex file that I have setup, here's a simple minimal example:
\define\macroA{This outputs some stuff.}
\define\macroB{\input knuth }
\define\macroC{This outputs other stuff.}
\define\macroD{This outputs other stuff.}
\define\macroE{This outputs other stuff.}
\define[2]\macroF{This is text #1 and #2.}
\define\macroG{This outputs other stuff.}
\define\macroH{This outputs other stuff.}
\starttext
\macroA %\macroB %\macroC %\macroD %\macroE
%%% some more code
\macroF{a}{b} \macroG \macroH
\stoptext
Normally, I will compile it as above, so only two of the macros actually appear. But sometimes, for testing purposes, I want to make sure my code is functioning good, so I will go an un-comment all of the macros, and then compile, and it basically does a test, making sure all of the macros in my code function perfectly. When testing, it looks like this:
\starttext
\macroA \macroB \macroC \macroD \macroE
%%% some more code
\macroF{a}{b} \macroG \macroH
\stoptext
Because the actual file is quite large, commenting and un-commenting the lines takes a long time, and can lead to mistakes. Is there any simpler way to easily switch between the two versions?
--Joel
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________