1

I would like to extend my previous question and know how to type a comment, using delimiters, in any table cell to be suppressed in the compiled PDF without the need to use, for example, \iffalse...\fi.

For instance, here, the comment delimiters are << and >>.

\documentclass[border=1cm]{standalone}
\begin{document}

\begin{tabular}{cc}
    \hline 
    1st entry <<1st comment>> & 2nd entry <<2nd comment>>  \\ 
    \hline 
\end{tabular}

\end{document}

enter image description here

Diaa
  • 9,599
  • @Moriambar It is pretty close to what I need. However, is there a way to parse << and >> as comment delimiters. It is easier to handle without the need to define commands, especially in large tables. – Diaa Apr 16 '17 at 19:16
  • why use special syntax rather than \comment{1st comment} which can trivially be defined as \newcommand\comment[1]{} ? Or why not use standard TeX comment % – David Carlisle Apr 16 '17 at 20:00
  • @DavidCarlisle I see. I think I exaggerated a simple problem. – Diaa Apr 16 '17 at 20:03

1 Answers1

1

I don't recommend the following solution at all, since you will not be able to use the less-than character after that as usual any more.

After the lines

\catcode`<=\active
\def<<#1>>{}

you will be able to mark comments using <<...>>. But this may have undesirable consequences if you need < in any other context.

gernot
  • 49,614