I would like to replace blank lines in a command by the newline character \textCR
.
For example:
\documentclass{article}
\usepackage{pdfcomment}
\mypdfcomment[2][]{\pdfcomment[#1]{#2}}
\begin{document}
\mypdfcomment{first line
second line}
\end{document}
Here I would like
\mypdfcomment{first line
second line}
to produce
\pdfcomment{first line\textCR second line}
Background: pdfcomment
does not understand blank lines and instead uses \textCR
. It would be good not having to care about.
\mypdfcomment
\mypdfcomment
do the same as\pdfcomment
except for the replacement of the empty lines. Maybe you know what is going wrong in trying to use the solution below to replace\newline
and `\` as well (see comments)?