I have created a macro like this:
\newcommand{\showsection}[2]{
\ifstrequal{#2}{}{}{\section{#1} #2}
}
It should be used like this in the document:
\showsection{Books}{
Do you know any good books?
}
If #2 is empty, as in this case below, the section title to not be shown:
\showsection{Books}{
}
Unfortunately, with some macros inside, which should sometimes appear blank, somehow something is getting through. Perhaps it is an extra space? No text is visible. I have put % after every line of the macros which I placed inside. How can I get the section titles to disappear in this case?
etoolbox. There are also described the commands\ifblankand\ifstrempty. Another mehtod is using the pacakgexparse. – Marco Daniel Dec 19 '11 at 12:52