1

I've defined a new command in the document's preamble. For the sake of this question the following (tested!) example:

\newcommand{\multipleargs}[3]{{#1}-{#2}-{#3}}

Using [cmd]-M on MacOS I want to be able to enter:

\multipleargs{A}{B}{C}

But when I try this, LyX only provides me with a "hole" for the first argument. Adding braces myself only results in "text" rather than passing the enclosed text as arguments.

And, yes, I know I can use the TeX-mode ([cmd]-L on MacOS) and type

$\multipleargs{A}{B}{C}$

But this question is about using commands with multiple arguments in the formula editor.

I don't want to use the LyX macro system because I want to collect these command later in my own style.

Please don't provide an alternative to \multipleargs, it is just a silly example to illustrate the formula editing question ;-)

2
  • Typing \{ in the math mode works for me. Does that work for you?
    – scottkosty
    Commented Apr 27, 2018 at 19:23
  • 1
    Hi @scottkosty, Thanks! I had no clue it would be that simple. Please make it an answer instead of a comment, so I can give it a thumbs up and increase your reputation.
    – nanitous
    Commented Apr 30, 2018 at 23:31

1 Answer 1

2

In order to tell LyX that you want to enter a literal {, you must enter a backslash before. So you should enter the two-character sequence \{. An alternative is to paste the full string \multipleargs{A}{B}{C} (with all args) into a math inset all at once.

It is ironic that entering { leads to the LaTeX \{ and entering \{ leads to the LaTeX {.

1
  • Precisely that irony threw me off ;-) Thanks again!
    – nanitous
    Commented May 1, 2018 at 11:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .