# Description

wrong newcommand preparsing:

the directive

\newcommand{\ol}{\overline}

transforms

$\ol{D(z_0,r)}$

into

$\overline$

but the correct output should be

$\overline{D(z_0,r)}$

In LaTeX it properly works.

Edit: changing the aforementioned latex directive into

\newcommand{\ol}[1]{\overline{#1}}

texla properly wokrs and returns

$\overline{ D(z_0,r) }$


I have to check if the presence of the number of arguments [n] is necessary.

ruphy edited projects, added Restricted Project; removed Restricted Project.Jan 10 2017, 2:15 PM
ruphy edited projects, added WikiToLearn: TeXLa; removed Restricted Project.Jan 10 2017, 2:31 PM
davidev added a comment.EditedJan 17 2017, 11:31 PM

The problem here is that the MacroParser always searches for arguments when it reads the newcommand command. With

\newcommand{\ol}{\overline}

it doesn't see arguments.
When the MacroParser then replaced the macro the argument of \ol{x,y,} are not read because it thinks that \ol doesn't need arguments.

I have to understand how to handle this case... that is a simple replace.
It is difficult to insert it in the actual workflow

davidev raised the priority of this task from Normal to High.Mar 2 2017, 4:32 PM

Now the macros without parameters are considered differently by the preparser. They are simply replaced.