GeneralSelective commenting out

LaTeX specific issues not fitting into one of the other forums of this category.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Selective commenting out

Post by Juanjo »

Perhaps by pressing down ALT or CTRL keys you may access a wider range of symbols. Anyway, I suggested to write inline comments between \ and  or \ZZ and ZZ to save keystrokes and keep it simple. Let's add one more keystroke. Try

Code: Select all

\NewDocumentCommand\ZZ{+u{\ZZ}}{\ignorespaces}
and write

Code: Select all

It is quite easy now \ZZ thanks to the help of LaTeX Community \ZZ to introduce...
In fact, you can replace the first \ZZ by any macro name you like (say, \Z, \Y, \Com,...) and the second \ZZ by any token sequence you like (which can be the macro name itself, or start or not with \). For example, this works:

Code: Select all

\NewDocumentCommand\Inline{+u{Comment}}{\ignorespaces}
................................
It is quite easy now \Inline thanks to the help of LaTeX Community Comment to introduce
and this too

Code: Select all

\NewDocumentCommand\Inline{+u{\Comment}}{\ignorespaces}
................................
It is quite easy now \Inline thanks to the help of LaTeX Community \Comment to introduce
The only thing you can't write inside the inline comment is the token sequence that closes it. Choose your own macro name and token sequence. If this approach doesn't work for you, then you may stick to the \comment macro.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply