In mimeTeX, an abundance of macros like \cd = \cdot, \fr = \frac and \sq = \sqrt are allowed. This kind of macros are easily created in own LaTeX documentens, using \newcommand. Other mimeTeX macros are so to speak "bracket free"; for instance, \te hallo is possible to use instead of \text{hello}. My question is, whether this kind of macros too are possible to imitate in LaTeX, and, if so, how that is done.

1 Answer
1

would put hello in the argument to \text. The argument to te ends at the first space (or newline) where the space after \te does not count as it never makes a space token, it is used to terminate the command name.

However in general you should not do this. A major design aim in LaTeX is to give a consistent top level syntax to commands: mandatory arguments get {} optional arguments get [] etc.

Judging from the use case in the comments it seems that you do not in fact want want \te to take an argument at all but want the plain Tex/LaTeX2.09 usage

\newcommand\te{\rm}

will make \te switch to an upright roman font for the rest of the current expression.

Great! Is it possible to make it work for longer arguments, like \te how do you do (that should be interpreted as \text{how do you do}? The reason I'm asking this is that I'm converting from mimeTeX to mathJax on a web forum where \te is frequently used in the beginning of math environments to generate chemical reaction formulas and similar non-italic objects.
–
PoetryInMotionMar 23 '13 at 20:30

Yes but you need to replace the ` ` that I put in the definition before { by whatever sequence of tokens you want to end the argument, you need some marker eg \par will work to go as far as the next blank line. But beware this is a TeX forum and this is a TeX answer, MathJax does not use TeX, it emulates simple TeX syntax but if you do anything too tricky with low level tex code it will not be supported.
–
David CarlisleMar 23 '13 at 20:34

@PoetryInMotion, yes, you can do this. But latex need to know where is the end of macro's argument. So, you can write \def\te#1|{\text{#1}} and after this write \te More than one word|. All text till | will become argument of \text.
–
Eddy_EmMar 23 '13 at 20:35