When (La)TeX reads and tokenizes input under standard catcode-régime with standard-value for the integer-parameter \endlinechar, two consecutive endline-characters—in the .tex-input file they yield an empty line—get tokenized as the token \par which usually serves for ending the current paragraph (and having (La)TeX start a new paragraph in case material which triggers switching to horizontal mode follows).
In (La)TeX macros come in two flavours:
- Macros where the token
\par is allowed in the arguments. These are so-called "long macros" because when you wish to define such a macro by means of TeX primitives like \def or \edef or \gdef or \xdef, you need to add the prefix \long to the definition-primitive in use.
- Macros where the token
\par is not allowed in the arguments. Many people call them "short macros" because when defining them you omit the \long-prefix. When an argument of a short macro contains the token \par, then you get an error-message about "Runaway argument?... Paragraph ended before ... was complete".
\textbf is defined to call such a such a "short" macro whose name is \text@command, and to pass its argument as argument to that macro. Therefore the error message. You can easily circumvent that message by not having the token \par within the argument and instead having, e.g., the token sequence \csname par\endcsname in the argument, or the token \myparcopy after \let\myparcopy=\par:
\documentclass{report}
\newcommand{\noblablabla}[2]{\textbf{#1}-#2}
\begin{document}
\noblablabla{aaaabbbb}{xxxx} % this is OK
\noblablabla{aaaa\csname par\endcsname bbbb}{xxxx}
\end{document}
\documentclass{report}
\newcommand\myparcopy{}%
\newcommand{\noblablabla}[2]{\textbf{#1}-#2}
\begin{document}
\noblablabla{aaaabbbb}{xxxx} % this is OK
\let\myparcopy=\par
\noblablabla{aaaa\myparcopy bbbb}{xxxx}
\end{document}
\textbfforwards its argument to\text@command, which is declared as a short macro, so it can't contain a\parin its argument. You can circumvent this by using\endgrafinstead of the two consecutive newlines, but I don't think it is a good idea and you should change your macro if you want to have a newline there. – Skillmon Sep 18 '19 at 07:36\textbf{#1}to{\bfseries #1}. Why?\bfseriescan handle paragraph breaks -- recall that an all-blank input line generates a paragraph break -- in its scope, whereas\textbfcan not. – Mico Sep 18 '19 at 07:53{<fontswitch> #1}to<textcommand>{#1}, the former doesn't apply any italic correction whereas the latter would (though this shouldn't be an issue for\textbf, it could for\textit). – Skillmon Sep 18 '19 at 08:10{\itshape #1\/}? Not sure, so I am not modifying the answer... is italic correction dependent on the current font, the next font or both? – Rmano Sep 18 '19 at 09:03\/should be correct (it's dependent on the current font and the last symbol in#1and might be dependent on the next symbol in the following text). – Skillmon Sep 18 '19 at 09:18