I would like to create a macro command that would put everything inside brackets for example or any other character, till the end of a line or till the end of a group {\inchar ...}
. Something like a custom \bfseries
command. Using default commands or xparse
. It is interesting to see several implementation if possible.
That is, such an inputs should produce corresponding outputs
text text \inchar() text text text text
some other text on a new line
↓
text text (text text text text)
some other text on a new line
text text \inchar|] text text text text\\
some other text on a new line
↓
text text |text text text text]
some other text on a new line
text text \inchar\{\} text text text text\par
some other text on a new line
↓
text text {text text text text}
some other text on a new line
Also it should work in amsmath
environments
\begin{multline*}
abc\\
\inchar() def\\
ghi \inchar\{\} jkl + mno
\end{multline*}
↓
abc
(def)
ghi {jkl + mno}
\bfseries
certainly does not do what you think. It goes on until the end of the current group.