# #StackBounty: #macros #xparse xparse modal command – custom macro like bfseries

### Bounty: 50

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 textpar
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}
``````

Get this bounty!!!

This site uses Akismet to reduce spam. Learn how your comment data is processed.