# How to avoid text style adoption in environment? [duplicate]

When I define a macro such as:

\newcommand{\mymacro}{a_{\text{sample}}}


the "sample" text is italic when used in e.g. an example environment.

How can I make sure it will not adjust to this environment?